Initial commit
This commit is contained in:
commit
9641e5a2f7
3 changed files with 28 additions and 0 deletions
1
defaults/main.yml
Normal file
1
defaults/main.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
files: {}
|
||||||
23
tasks/file.yml
Normal file
23
tasks/file.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
- set_fact:
|
||||||
|
defaultfile:
|
||||||
|
group: root
|
||||||
|
owner: root
|
||||||
|
mode: "0700"
|
||||||
|
state: present
|
||||||
|
content: ~
|
||||||
|
template: ~
|
||||||
|
template_vars: {}
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
file: "{{ defaultfile|combine(item.value|d({}), {'path': item.key} ) }}"
|
||||||
|
|
||||||
|
- name: create file/folder
|
||||||
|
when:
|
||||||
|
- not file.content
|
||||||
|
- not file.template
|
||||||
|
file:
|
||||||
|
path: "{{ file.path }}"
|
||||||
|
group: "{{ file.group }}"
|
||||||
|
owner: "{{ file.owner }}"
|
||||||
|
mode: "{{ file.mode }}"
|
||||||
|
state: "{{ file.state }}"
|
||||||
4
tasks/main.yml
Normal file
4
tasks/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
- name: handle files
|
||||||
|
with_dict: "{{ files }}"
|
||||||
|
include_tasks:
|
||||||
|
file: file.yml
|
||||||
Loading…
Add table
Add a link
Reference in a new issue