Created
August 1, 2014 14:47
-
-
Save asmacdo/dce90969b500f8be96b2 to your computer and use it in GitHub Desktop.
Create multiple directories with ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Make sure the sites-available, sites-enabled and conf.d directories exist | |
file: | |
path: "{{nginx_dir}}/{{item}}" | |
owner: root | |
group: root | |
mode: 0755 | |
recurse: yes | |
state: directory | |
with_items: ["sites-available", "sites-enabled", "conf.d"] |
Wow! I have no memory of creating this gist, but I'm glad it was useful! <3
How in the world did you find this?
I was trying to configure a nginx reverse proxy with ansible and had the problem that some folders were not available. So I googled for "ansible mkdir -p". This gist was the first result and also perfectly matching my usecase.
Have a nice day! ๐
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exactly what i was searching for. Thanks a lot :) ๐