Why is it that on the playbook.yml
under the command task to be executed, some modules have a quotation mark while some does not?
For example, if you check the syntax below, the module line
is with embedded in a quotation mark but script
is not.
- name: 'Execute a script on all web server nodes and start httpd service'
hosts: web_nodes
tasks:
- name: 'Update entry into /etc/resolv.conf'
lineinfile:
path: /etc/resolv.conf
line: 'nameserver 10.1.250.10'
- name: 'Execute a script'
script: /tmp/install_script.sh
Both modules take as parameter for
line
orcmd
a string.Your question is about the YAML Syntax
when to quote and YAML Gotchas
Also a style guide can be a reason of different ways of when and how to quote.