How to create docker volume using Ansible

0 votes

Hi Guys,

I am trying to launch one container with docker volume using Ansible playbook. For that I need to create a volume first. How can I do that using same playbook?

Sep 20, 2020 in Ansible by akhtar
• 38,260 points
2,599 views

1 answer to this question.

0 votes

Hi@akhtar,

We can create a volume docker resource using the docker_volume module. This module is available in Ansible 2.4 or higher version. You can see the below playbook. It may help you.

vars:
  docker_volume: db_data

- name: "Create a Volume"
  docker_volume:
    name: "{{ docker_volume }}"
answered Sep 20, 2020 by MD
• 95,460 points

Related Questions In Ansible

0 votes
1 answer

devops , how to create user using ansible playbook

root doesn't need a password to switch ...READ MORE

answered Jul 16, 2018 in Ansible by Kalgi
• 2,680 points
1,157 views
0 votes
1 answer

How to create a new encrpted file using Ansible Vault?

If you are creating a new file ...READ MORE

answered Jan 29, 2019 in Ansible by Kyraa
1,061 views
0 votes
2 answers

How to create MySQL tables using Ansible?

--- - hosts: dbserver   tasks:    - name: create a table ...READ MORE

answered Mar 19, 2019 in Ansible by Ankit Tyagi
8,076 views
0 votes
1 answer

How to increase aws ebs volume using ansible ?

Hey, I am unaware of any specific ...READ MORE

answered Sep 9, 2019 in Ansible by Kalgi
• 52,350 points
5,069 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,020 points
2,738 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
4,363 views
0 votes
1 answer

How to create a docker container using Ansible?

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

answered Sep 20, 2020 in Ansible by MD
• 95,460 points
1,142 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