ANSIBLE.FILE(3)

NAME
file - Sets attributes of files

DESCRIPTION

Sets attributes of files, symlinks, and directories, or removes files/symlinks/directories. Many other modules support the same options as the file module - including copy, template, and assemble.

OPTIONS

context
    accepts only default as value. This will restore a file's SELinux context in the policy. Does nothing if no default value is available. Choices: default.

group
    name of the group that should own the file/directory, as would be fed to chown

mode
    mode the file or directory should be, such as 0644 as would be fed to chmod

owner
    name of the user that should own the file/directory, as would be fed to chown

path
    defines the file being managed, unless when used with state=link, and then sets the destination to create a symbolic link to using src(required)

recurse
    recursively set the specified file attributes (applies only to state=directory) Choices: yes,no. (default: no)(Added in Ansible version 1.1.)

selevel
    level part of the SELinux file context. This is the MLS/MCS attribute, sometimes known as the range. _default feature works as for seuser. (default: s0)

serole
    role part of SELinux file context, _default feature works as for seuser.

setype
    type part of SELinux file context, _default feature works as for seuser.

seuser
    user part of SELinux file context. Will default to system policy, if applicable. If set to _default, it will use the user portion of the policy if available

src path of the file to link to (applies only to state=link).

state
    If directory, all immediate subdirectories will be created if they do not exist. If file, the file will NOT be created if it does not exist, see the copy or template module if you want that behavior. If link, the symbolic link will be created or changed. If absent, directories will be recursively deleted, and files or symlinks will be unlinked. Choices: file,link,directory,absent. (default: file)."

NOTES

See also copy, template, assemble

EXAMPLES

Example from Ansible Playbooks
file: path=/etc/foo.conf owner=foo group=foo mode=0644

file: src=/file/to/link/to dest=/path/to/symlink owner=foo group=foo state=link
None

AUTHOR
Michael DeHaan

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#file