diff options
author | James Cammarata <jimi@sngx.net> | 2014-08-26 09:09:08 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-08-26 09:09:08 -0500 |
commit | 311c10c8e51fc260214809e7365b879aef8fb1c8 (patch) | |
tree | f4bb45f8d310b6fce1dfdc7db5d3bfa6a0efcc0f /files | |
parent | 8be0be1564940fca4b392a62363e0f04a2b4a24e (diff) | |
download | ansible-modules-extras-311c10c8e51fc260214809e7365b879aef8fb1c8.tar.gz |
Docs updates to add examples for symbolic modes
Also fixes missing doc fragments missing in template and assemble
Diffstat (limited to 'files')
-rw-r--r-- | files/assemble | 5 | ||||
-rw-r--r-- | files/copy | 6 | ||||
-rw-r--r-- | files/file | 7 | ||||
-rw-r--r-- | files/template | 4 |
4 files changed, 18 insertions, 4 deletions
diff --git a/files/assemble b/files/assemble index e3d42c7a..a16431b9 100644 --- a/files/assemble +++ b/files/assemble @@ -79,11 +79,8 @@ options: U(http://docs.python.org/2/library/re.html). required: false default: null - others: - description: - - all arguments accepted by the M(file) module also work here - required: false author: Stephen Fromm +extends_documentation_fragment: files ''' EXAMPLES = ''' @@ -95,6 +95,12 @@ EXAMPLES = ''' # Example from Ansible Playbooks - copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644 +# The same example as above, but using a symbolic mode equivalent to 0644 +- copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode="u=rw,g=r,o=r" + +# Another symbolic mode example, adding some permissions and removing others +- copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode="u+rw,g-wx,o-rwx" + # Copy a new "ntp.conf file into place, backing up the original if it differs from the copied version - copy: src=/mine/ntp.conf dest=/etc/ntp.conf owner=root group=root mode=644 backup=yes @@ -94,6 +94,13 @@ EXAMPLES = ''' with_items: - { path: 'x', dest: 'y' } - { path: 'z', dest: 'k' } + +# touch a file, using symbolic modes to set the permissions (equivalent to 0644) +- file: path=/etc/foo.conf state=touch mode="u=rw,g=r,o=r" + +# touch the same file, but add/remove some permissions +- file: path=/etc/foo.conf state=touch mode="u+rw,g-wx,o-rwx" + ''' def main(): diff --git a/files/template b/files/template index 3dd2ece4..7ba072fc 100644 --- a/files/template +++ b/files/template @@ -51,12 +51,16 @@ notes: - "Since Ansible version 0.9, templates are loaded with C(trim_blocks=True)." requirements: [] author: Michael DeHaan +extends_documentation_fragment: files ''' EXAMPLES = ''' # Example from Ansible Playbooks - template: src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode=0644 +# The same example, but using symbolic modes equivalent to 0644 +- template: src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode="u=rw,g=r,o=r" + # Copy a new "sudoers" file into place, after passing validation with visudo - template: src=/mine/sudoers dest=/etc/sudoers validate='visudo -cf %s' ''' |