add support to create symlinks
This commit is contained in:
parent
de7432a953
commit
fecf438ec6
2 changed files with 8 additions and 2 deletions
|
|
@ -15,9 +15,12 @@ group: root
|
||||||
# permission bits, can be octal number or the string representation
|
# permission bits, can be octal number or the string representation
|
||||||
mode: 0700
|
mode: 0700
|
||||||
|
|
||||||
# can be 'present', 'absent', 'directory', or 'touch' (ensure file is created and set modification time to now, but do not change the content)
|
# can be 'present', 'absent', 'directory', or 'touch' (ensure file is created and set modification time to now, but do not change the content), 'link'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
# target if state is 'link'
|
||||||
|
src: ''
|
||||||
|
|
||||||
# set the file content, mutaly exclusive with "template". Only handeled if the state if 'file'
|
# set the file content, mutaly exclusive with "template". Only handeled if the state if 'file'
|
||||||
content: ''
|
content: ''
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
mode: "0700"
|
mode: "0700"
|
||||||
state: touch
|
state: touch
|
||||||
|
src: ~
|
||||||
content: ~
|
content: ~
|
||||||
template: ~
|
template: ~
|
||||||
template_vars: {}
|
template_vars: {}
|
||||||
|
|
@ -20,11 +21,13 @@
|
||||||
group: "{{ file.group }}"
|
group: "{{ file.group }}"
|
||||||
owner: "{{ file.owner }}"
|
owner: "{{ file.owner }}"
|
||||||
mode: "{{ file.mode }}"
|
mode: "{{ file.mode }}"
|
||||||
|
src: "{{ file.src }}"
|
||||||
state: "{{ file.state }}"
|
state: "{{ file.state }}"
|
||||||
|
|
||||||
- name: create file/folder
|
- name: create file/folder and set content
|
||||||
when:
|
when:
|
||||||
- file.content
|
- file.content
|
||||||
|
- not file.src
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ file.path }}"
|
dest: "{{ file.path }}"
|
||||||
group: "{{ file.group }}"
|
group: "{{ file.group }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue