@@ -370,7 +370,7 @@ pull (Puppet way) vs push (ansible way) --> push braucht weder daemon noch sonst
370370- Transporters:
371371` ssh ` , ` local ` , ` winrm ` , ` docker ` ,...
372372- Modules:
373- ` file ` , ` template ` , ` firewalld ` , ` service ` , ` yum ` ,...
373+ ` file ` , ` template ` , ` firewalld ` , ` systemd_service ` , ` yum ` ,...
374374- Dynamic inventories:
375375` vmware ` , ` cloudscale ` , ` foreman ` , ` azure ` , ` aws ` ,...
376376
@@ -615,14 +615,14 @@ right:
615615### quoting of variables or spacing
616616wrong:
617617` ` ` yaml
618- - ansible.builtin.service :
618+ - ansible.builtin.systemd_service :
619619 name : {{ item }}
620620 state : started
621621 loop : " {{my_services}}"
622622` ` `
623623right:
624624` ` ` yaml
625- - ansible.builtin.service :
625+ - ansible.builtin.systemd_service :
626626 name : " {{ item }}"
627627 state : started
628628 loop : " {{ my_services }}"
@@ -801,7 +801,7 @@ A bit more complex:
801801 name: mariadb
802802 state: installed
803803 - name: start mariadb
804- ansible.builtin.service :
804+ ansible.builtin.systemd_service :
805805 name: mariadb
806806 state: started
807807` ` `
@@ -931,7 +931,7 @@ Don't name your Variables after Magic Variables
931931## Bonus Level: Loops!
932932``` yaml
933933- name : start and enable two services
934- ansible.builtin.service :
934+ ansible.builtin.systemd_service :
935935 name : " {{ item }}"
936936 state : started
937937 enabled : true
@@ -1284,7 +1284,7 @@ Example (no roles yet):
12841284 - ansible.builtin.dnf:
12851285 name: httpd
12861286 state: installed
1287- - service :
1287+ - ansible.builtin.systemd_service :
12881288 name: httpd
12891289 state: started
12901290` ` `
@@ -1389,7 +1389,7 @@ Example Playbook:
13891389 notify: restart sshd
13901390 handlers:
13911391 - name: restart sshd
1392- ansible.builtin.service :
1392+ ansible.builtin.systemd_service :
13931393 name: sshd
13941394 state: restarted
13951395```
@@ -1410,7 +1410,7 @@ Example Playbook:
14101410 notify : restart sshd
14111411 handlers :
14121412 - name : sshd restart
1413- ansible.builtin.service :
1413+ ansible.builtin.systemd_service :
14141414 name : sshd
14151415 state : restarted
14161416 listen : restart sshd
@@ -1443,11 +1443,11 @@ Only second handler will run when a task notifies `restart web services`
14431443` ` ` yaml
14441444handlers:
14451445 - name: restart web services
1446- ansible.builtin.service :
1446+ ansible.builtin.systemd_service :
14471447 name: memcached
14481448 state: restarted
14491449 - name: restart web services
1450- ansible.builtin.service :
1450+ ansible.builtin.systemd_service :
14511451 name: apache
14521452 state: restarted
14531453` ` `
0 commit comments