--alias on docker_network

9 views
Skip to first unread message

Javi Legido

unread,
Apr 30, 2020, 2:35:32 AM4/30/20
to Ansible Project
Good morning.

Is '--alias' docker network parameter supported by docker_network ansible module?

Use case: I would like to "ansibilize" below native docker command:

docker network connect --alias erp.example.com --alias drive.example.com network-nginx-proxy nginx-proxy

I was not able to find the option.

Many thanks.

Javier

Felix Fontein

unread,
Apr 30, 2020, 2:39:55 AM4/30/20
to ansible...@googlegroups.com
Hi

> Is '--alias
> <https://docs.docker.com/engine/reference/commandline/network_connect/#create-a-network-alias-for-a-container>'
> docker network parameter supported by docker_network
> <https://docs.ansible.com/ansible/latest/modules/docker_network_module.html#parameters>
> ansible module?
>
> Use case: I would like to "ansibilize" below native docker command:
>
> docker network connect --alias erp.example.com --alias
> drive.example.com network-nginx-proxy nginx-proxy

The docker_network module manages docker networks, it only provides
basic functionality to connect containers to the network (see
https://docs.ansible.com/ansible/latest/modules/docker_network_module.html#parameter-connected).

To connect containers to networks, use the docker_container module
(https://docs.ansible.com/ansible/latest/modules/docker_container_module.html#parameter-networks).
(Just make sure that you don't accidentally recreate or restart your
container! You can use the `comparisons` option to prevent that.)

Cheers,
Felix

Javi Legido

unread,
Apr 30, 2020, 3:27:18 AM4/30/20
to ansible...@googlegroups.com
Many thanks Felix

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20200430083934.2f936b46%40rovaniemi.
Reply all
Reply to author
Forward
0 new messages