How to create a directory using Ansible?

0 votes

Hi Guys,

I am new in Ansible. I want to create one directory in my remote nodes using Ansible-Playbook. How can I do that?

Aug 9 in Ansible by akhtar
• 25,030 points
61 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the file module. To create a directory, you need to specify the option state=directory. I have attached one playbook for your reference below.

- name: Creates directory
  file:
    path: /src/www
    state: directory
answered Aug 9 by MD
• 56,480 points

Related Questions In Ansible

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
167 views
0 votes
1 answer

How to create a key pair on AWS using Ansible-Playbook?

Hi@akhtar, You can find the ec2_key module in ...READ MORE

answered Aug 12 in Ansible by MD
• 56,480 points
47 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
• 56,480 points
129 views
0 votes
1 answer

How to create a user using Ansible Playbook?

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

answered Sep 1 in Ansible by MD
• 56,480 points
35 views
+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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
677 views
+2 votes
1 answer
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
58 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
• 56,480 points
170 views