September 2018
Beginner to intermediate
214 pages
5h 53m
English
Since playbooks are written in YAML, you have a bit of wiggle room regarding what the code looks like when introducing task arguments. Again, although Ansible will accept the code and the task will be executed, it is easy to end up with long lines of code for an averagely complicated task. This is what a one-line Ansible task looks like:
- name: Copy user configurationcopy: src=/home/admin/setup.conf dest=/usr/local/projects/ owner=setup group=dev mode=0677 backup=yes
Instead of this, we can follow a neat and more organized YAML structure, by adding white spaces in front of each task argument. The playbook should look as follows:
- name: Copy user configurationcopy: src: /home/admin/setup.confdest: /usr/local/projects/ ...
Read now
Unlock full access