How to use variable template in shell or command

Hi everyone,

I want to something like this

  • name: Run the setup script
    shell: “{{ SITE_DIR }}”/setup_jibs.sh creates=“{{ item }}/run_setup_jibs_DO_NOT_REMOVE.sh”

and yaml complain as it is not valid

The first after the shell: must be a value that is why. If I put something

  • name: Run the setup script
    shell: cmd=“{{ SITE_DIR }}”/setup_jibs.sh creates=“{{ item }}/run_setup_jibs_DO_NOT_REMOVE.sh”

then yaml will be OK (noted the cmd= ; But i guess it wont work - shell does not have that attributes cmd and takes that as a string for teh shell to execute.

How can I get that done?

Similar to the command module as well

Thanks

Instead of quoting each individual value, quote the whole line like this:

- name: Run the setup script
  shell: "{{ SITE_DIR }}/setup_jibs.sh creates={{ item
}}/run_setup_jibs_DO_NOT_REMOVE.sh"

Thanks will try.

Kind regards