Talk:Ansible: Difference between revisions

Line 145:
* Playbooks do not change anything if the host is already in desired state.
* Avoid modules like command, shell & raw as they are not idempotent by nature.
 
== Task Attribute ==
 
* Most important Attribute is Task attribute:
 
<pre>
tasks:
- name: run service
service: name=vsftpd enabled=true
</pre>
 
* Here '-' marks beginning of a list of attributes.
* If multiple tasks are defined, each first attribute of task starts with '-'.
 
== Other Attributes ==
 
name: specify a specific label to play
hosts: uses patterns to define on which hosts to run a play
remote_user: overwrites the remote_user setting in ansible.cfg
become: overwrites the become setting in ansible.cfg
become_method: overwrites the become_method setting in ansible.cfg
become_user: overwrites the become_user setting in ansible.cfg