Any tips on reading in the group_vars and making them available to the docker module via “env”? I have searched for examples. I know that i can call out key:values. I don’t know if i’m missing something for using group_vars with docker run and ansible?
As an example. I know that i can include variables like this:
- name: run hello docker container
docker:
docker_api_version: 1.18
name: hello
registry: “docker.registry.dv.mycompany.com”
pull: always
image: docker.registry.dv.mycompany.com/towens/hello:latest
ports: 9080:8080
state: reloaded
env:
DOCKER_ENV: DEV
any tips on doing this more dynamically would be appreciated.
env:
DOCKER_DB: “{{DOCKER_DB}}”
JNDI: “{{JNDI}}”
FAKE_VAR: “{{FAKE_VAR}}”
ANOTHER_FAKE_VAR: “{{ANOTHER_FAKE_VAR}}”