I'm trying to find an easy way to specify args to a command.
The args contain '=' signs triggering the error
A variable inserted a new parameter into the module args. Be sure to quote variables if they contain equal signs (for example: "{{var}}").
Can you help me find the magic syntax?
- hosts: somehost
vars:
- container_commands:
ops_registry_1: -e SOMEVAR='122' -e bla='123' -e another='1233'
- container_name: ops_registry_1
tasks:
- name: run docker command
raw: "docker run {{ container_commands[container_name] }} registry:2.0"
I've considered:
- putting all the args in a environment hash and join them, but I guess it's the same issue.
- using with_items but this gave the same issue
- using single , double etc.. quotes
thanks for your assistance
raw: "docker run {{ container_commands[container_name] }} registry:2.0"
python-simplejson
on older (Python 2.4 and before) hosts that need it as a dependency to
run modules, since nearly all core modules require it. Another is
speaking to any devices such as routers that do not have any Python
installed. In any other case, using the shell or command module is much more appropriate. Have you tried command or shell?