I already asked that question on ansible-devel mailing list: https://groups.google.com/forum/#!msg/ansible-devel/aXyKGHRtDcQ/GvUxgopZAQAJ
I am trying to log into private docker container registry and I need to use a json-string as a password. So I do the following
`
docker_login:
registry: cr.yandex
username: json_key
password: “{{ lookup(‘file’, ‘key.json’) }}”
reauthorize: yes
`
And I got an error “Get https://cr.yandex/v2/: unauthorized: Password is invalid - must be JSON key”.
When I ran “ansible-playbook” in verbose mode I saw that the content of the file “key.json” was transcoded – double quotes were changed to single quotes so it have become an invalid json string.
Felix Fontein from ansible-devel mailing list pointed that the problem is that Ansible interprets JSON file as a dictionary, parses it and passes it on as a dictionary.
Is there any way to tell Ansible not to parse .json file to dictionary and keep it as a string?