mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Make the example somewhat more feature complete
New users might think that "state=started" implies that the service is also started at boot-time, which isn't. By adding it, this change makes a clear distinction between the service state, and whether it is enabled (at boot). And makes the example more feature-complete as this is what most people would be doing anyway.
This commit is contained in:
@@ -67,8 +67,8 @@ For starters, here's a playbook that contains just one play::
|
|||||||
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
|
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
|
||||||
notify:
|
notify:
|
||||||
- restart apache
|
- restart apache
|
||||||
- name: ensure apache is running
|
- name: ensure apache is running (and enable it at boot)
|
||||||
service: name=httpd state=started
|
service: name=httpd state=started enabled=yes
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart apache
|
- name: restart apache
|
||||||
service: name=httpd state=restarted
|
service: name=httpd state=restarted
|
||||||
|
|||||||
Reference in New Issue
Block a user