Create a network in Docker using Ansible playbook.

0 votes

Hi Guys,

 I am new to Ansible. I want to create a network in docker using Ansible playbook. How cam I do that?

Sep 20 in Ansible by akhtar
• 27,980 points
74 views

1 answer to this question.

0 votes

Hi@akhtar,

The docker_network module (Ansible 2.2 or higher) can create a network in docker. You can use this module to create the network and after that use the docker_container module to lunch the container within that network.

vars:
  docker_network: ansible_net

- name: "Create a network"
  docker_network:
    name: "{{ docker_network }}"
answered Sep 20 by MD
• 64,820 points

Related Questions In Ansible

0 votes
2 answers

How to create a directory in remote nodes using Ansible-Playbook?

You can read install and setup apache ...READ MORE

answered Aug 23 in Ansible by anonymous
• 160 points
77 views
0 votes
1 answer

How do I wget a file from web server using shell in the ansible playbook

Hey Ayaan, you could probably use this ...READ MORE

answered Jan 24, 2019 in Ansible by Anushri
1,638 views
0 votes
1 answer

Create directories and download files in Ansible using Ansible playbook

Hey @Yash,  you could either use file module ...READ MORE

answered Jan 24, 2019 in Ansible by Cerdin
2,472 views
0 votes
1 answer

obtain information about a file in windows using ansible playbook

Hey @Travis, you can use the win_stat ...READ MORE

answered Jun 10, 2019 in Ansible by Drake
344 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,680 points
838 views
0 votes
1 answer

How to create a docker container using Ansible playbook?

Hi@akhtar, You can use the docker_container module in ...READ MORE

answered Aug 7 in Ansible by MD
• 64,820 points
357 views
0 votes
1 answer

How to create a security group in AWS using Ansible-Playbook?

Hi@akhtar, You can use the ec2_group module in ...READ MORE

answered Aug 13 in Ansible by MD
• 64,820 points
209 views