diff --git a/README.md b/README.md index 3772684aea83115ecc0bb5d5d1ecfc663222a765..d89fbcb7d2d5284a79f6dc80b87e560031a810f3 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,12 @@ group: root # permission bits, can be octal number or the string representation 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 +# target if state is 'link' +src: '' + # set the file content, mutaly exclusive with "template". Only handeled if the state if 'file' content: '' diff --git a/tasks/file.yml b/tasks/file.yml index 49fcf51f3df377a16cc821b816a576da47465cd8..5654c15284f69ae97d2276b48fe46e616771760c 100644 --- a/tasks/file.yml +++ b/tasks/file.yml @@ -4,6 +4,7 @@ owner: root mode: "0700" state: touch + src: ~ content: ~ template: ~ template_vars: {} @@ -22,11 +23,13 @@ group: "{{ file.group }}" owner: "{{ file.owner }}" mode: "{{ file.mode }}" + src: "{{ file.src }}" state: "{{ file.state }}" - name: create file/folder (copy content) when: - file.content + - not file.src copy: dest: "{{ file.path }}" group: "{{ file.group }}"