Hi,
The following examples gave me a syntax error, appreciate clues to use template inside creates statement.
shell: “cp /tmp/{{ my_server }}.crt /etc/{{ my_server }}.crt”
args:
creates: /etc/{{ my_server }}.crt
Thank you.
Kind regards,
- j
Hi,
The following examples gave me a syntax error, appreciate clues to use template inside creates statement.
shell: “cp /tmp/{{ my_server }}.crt /etc/{{ my_server }}.crt”
args:
creates: /etc/{{ my_server }}.crt
Thank you.
Kind regards,
It might help to actually state what the “syntax error” is.
Also what version of ansible are you using?
Thanks Matt, please see following comments:
It might help to actually state what the “syntax error” is.
ERROR: Syntax Error while loading YAML script copyCert.yml
creates: /etc/{{ my_server }}.crt
^
Also what version of ansible are you using?
ansible-1.7-1.el6.noarch
If you share the whole exception you should find it’s giving you helper text telling you what to do with it.
Let us know if not.
meanwhile, it seems you are doing a local copy, which is a little curious compared to doing a remote copy (copy module).
All being said, this is the simplest possible representation:
shell: cp /tmp/{{my_server}}.crt /etc/{{my_server}}.crt creates=/etc/{{my_server}}.crt
Thanks Michael, that does the trick.
Much appreciate it.