I use json to compact my docker environment variables, the problem is that the docker module parser splits on ',' character to signify a new key/value pair, meaning that more than one key doesn't work. eg
docker: env='options={"foo":"bar"}' //ok
docker: env='options={"foo":"bar","baz":"qux"}' //error because of comma
Is it possible to add an escape for the comma, eg '\,' or ',,' ?
Also, where do you see the latest docker module code? I found this link but it says its been merged into the main repository.
https://github.com/cove/docker-ansible/blob/master/docker-ansible.py
| env = dict(type='list'), |
docker:
env:
options: {"foo":"bar","baz":"qux"}
other_arguments_here: 1234
And basically use full YAML, without any splitting magic.
If someone would like to help test that change, that would be great, otherwise, please file a github ticket and we can try it.
It would also be nice if we could do it in a compatible way, but this is probably not be possible.
Docker is new and has broken APIs in the past, we may also have to :)
--
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.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/69fe3bf1-6a74-484c-b997-8c07dd229478%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- name: "Try to inject commas in env strings" docker: image="readytalk/tomcat-native:8.0.9" state="running" env='CATALINA_OPTS="-Dconfig.zookeepers=zookeeper1,zookeeper2"'fatal: [newman] => failed to parse: Traceback (most recent call last): File "/home/sgoings/.ansible/tmp/ansible-tmp-1408553551.73-77442219569203/docker", line 2163, in <module> main() File "/home/sgoings/.ansible/tmp/ansible-tmp-1408553551.73-77442219569203/docker", line 724, in main net = dict(default=None) File "/home/sgoings/.ansible/tmp/ansible-tmp-1408553551.73-77442219569203/docker", line 1086, in __init__ self._check_argument_types() File "/home/sgoings/.ansible/tmp/ansible-tmp-1408553551.73-77442219569203/docker", line 1623, in _check_argument_types self.params[k] = dict([x.strip().split("=", 1) for x in value.split(",")])ValueError: dictionary update sequence element #1 has length 1; 2 is requiredTo view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a24d0c7e-11d2-4c79-8bc3-564fdb4e4876%40googlegroups.com.