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, 2020 in Ansible by akhtar
• 38,230 points
3,355 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, 2020 by MD
• 95,440 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, 2020 in Ansible by anonymous
• 160 points
3,624 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
3,863 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
5,400 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 11, 2019 in Ansible by Drake
1,102 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
• 58,090 points
2,470 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 8, 2020 in Ansible by MD
• 95,440 points
4,050 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, 2020 in Ansible by MD
• 95,440 points
3,407 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP