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 in Ansible by akhtar
• 28,720 points
63 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 by MD
• 66,500 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,620 points
226 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
182 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
3,587 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
• 51,970 points
1,503 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,700 points
846 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
• 66,500 points
429 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 in Ansible by MD
• 66,500 points
42 views