I have a working local_action task which I like to write in yaml syntax. But it seems that this is either not possible or tricky. There are some mentions in the net that people have tried to do so. I have not found a proof that it is not possible...
This is the working code (inline):
- name: create opt file
local_action: template src=templates/module-deployment.opt.j2 dest=/tmp/{{ inventory_hostname }}/module-deployment.opt
This is my closest version to structure the code (but not yaml syntax):
- name: create opt file
local_action: template
src=templates/module-deployment.opt.j2
dest=/tmp/{{ inventory_hostname }}/module-deployment.opt
This is what I would have expected but this is not working:
- name: create opt file
local_action:
template:
src: templates/module-deployment.opt.j2
dest: tmp/{{ inventory_hostname }}/module-deployment.opt
The error message is not too helpful.
The offending line appears to be:
- name: create opt file for contentPump
^ here
Does anyone know if it is possible to archive this?
This is what I would have expected but this is not working [ ]
You can always rely on the documentation instead of your own expectations:
- name: create opt file
local_action:
module: template
src: templates/module-deployment.opt.j2
dest: tmp/{{ inventory_hostname }}/module-deployment.opt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With