- name: Update the Apache configaction: copy src=httpd.conf dest=/etc/httpd/httpd.confthe following one does not work- name: Update the Apache configaction: copysrc: httpd.confdest: /etc/httpd/httpd.confAny idea to split a long action?
Your indentation is off.Several options.# (1) complex arguments by passing a hash to the module
- name: Update the Apache config
copy:src: httpd.confdest: /etc/httpd/httpd.conf
# (2) or equivalently
- name: Update the Apache configaction:
module: copysrc: httpd.confdest: /etc/httpd/httpd.conf# (3) YAML line continuations
- name: Update the Apache config
copy: >src=httpd.conf
dest=/etc/httpd/httpd.conf# )4_ YAML line continuations
- name: Update the Apache configaction: copy >src=httpd.conf
dest=/etc/httpd/httpd.conf
I generally prefer option 1 or 3.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
> # (3) YAML line continuations> - name: Update the Apache config> copy: >> src=httpd.conf> dest=/etc/httpd/httpd.conf
(3) Also seems to work without the ">", for example:copy:src=httpd.confdest=/etc/httpd/httpd.confFormatting long lines is something we run into frequently with a lot of people working on the same playbooks, would a section on line continuation in the best practices section of the docs make sense?I wouldn't mind taking a stab at it if it's something the community would find useful.-John
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.