Is there a way to add a list of parameters to a module from a predefined variable?
For instance, I might have the following vars defined:
common_keys_core:
networks:
- network1
restart: always
common_keys_apps:
networks:
- network1
- proxy1
restart: unless-stopped
common_keys_media:
networks:
- network2
- proxy1
restart: "no"
And a docker container like this:
- name: Launch traefik container
docker_container:
name: traefik
image: 'traefik:latest'
state: started
<insert common_keys_core here>
...
As outlined in the example above, I'd like to insert the common_keys_core variable as parameters for the docker container.
I have many different containers that require different sets of parameters that can by grouped by core, apps or media. The example I gave is just a simplified version to illustrate my situation.
Docker has a way of doing this using extension fields as follows:
traefik:
<<: *common-keys-core
container_name: traefik