Skip to content
Snippets Groups Projects
Verified Commit 7be38f39 authored by nd's avatar nd
Browse files

cleaned up role

parent b68cccba
No related branches found
No related tags found
No related merge requests found
files: {}
files_default:
group: root
owner: root
mode: "0700"
state: touch
src: ~
content: ~
template: ~
template_vars: {}
- set_fact:
defaultfile:
group: root
owner: root
mode: "0700"
state: touch
src: ~
content: ~
template: ~
template_vars: {}
file: "{{ {}|combine(files_default, item.value|d({}), {'path': item.key} ) }}"
- set_fact:
file: "{{ defaultfile|combine(item.value|d({}), {'path': item.key} ) }}"
- name: create file/folder
- name: "create file/folder (file module, {{ file.path }})"
when:
- not file.content
- not file.template
- not file.src
file:
path: "{{ file.path }}"
group: "{{ file.group }}"
......@@ -25,23 +13,14 @@
src: "{{ file.src }}"
state: "{{ file.state }}"
- name: create file/folder
- name: "create file/folder (copy module, {{ file.path }})"
when:
- file.content
- not file.src
- file.content or file.src
- file.state != 'link'
copy:
dest: "{{ file.path }}"
group: "{{ file.group }}"
owner: "{{ file.owner }}"
mode: "{{ file.mode }}"
content: "{{ file.content }}"
- name: create file/folder
when:
- file.src
copy:
dest: "{{ file.path }}"
group: "{{ file.group }}"
owner: "{{ file.owner }}"
mode: "{{ file.mode }}"
src: "{{ file.src }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment