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,260 points
4,721 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,460 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
5,631 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
5,056 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
7,023 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
2,405 views
+2 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
7,767 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,460 points
5,229 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,460 points
4,758 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