Manage information about files on the minion, set/read user, group data
depends: |
|
---|
Change the group of a file
CLI Example:
salt '*' file.chgrp c:\temp\test.txt administrators
Chown a file, pass the file the desired user and group
CLI Example:
salt '*' file.chown c:\temp\test.txt myusername administrators
Return a dictionary object with the Windows file attributes for a file.
CLI Example:
salt '*' file.get_attributes c:\temp\a.txt
Return the id of the group that owns a given file
CLI Example:
salt '*' file.get_gid c:\temp\test.txt
Return the group that owns a given file
CLI Example:
salt '*' file.get_group c:\temp\test.txt
Return the mode of a file
Right now we're just returning None because Windows' doesn't have a mode like Linux
CLI Example:
salt '*' file.get_mode /etc/passwd
Return the id of the user that owns a given file
CLI Example:
salt '*' file.get_uid c:\temp\test.txt
Return the user that owns a given file
CLI Example:
salt '*' file.get_user c:\temp\test.txt
Convert the group id to the group name on this system
CLI Example:
salt '*' file.gid_to_group S-1-5-21-626487655-2533044672-482107328-1010
Convert the group to the gid on this system
CLI Example:
salt '*' file.group_to_gid administrators
Set file attributes for a file. Note that the normal attribute means that all others are false. So setting it will clear all others.
CLI Example:
salt '*' file.set_attributes c:\temp\a.txt normal=True
salt '*' file.set_attributes c:\temp\a.txt readonly=True hidden=True
Set the mode of a file
This just calls get_mode, which returns None because we don't use mode on Windows
CLI Example:
salt '*' file.set_mode /etc/passwd 0644
Return a dict containing the stats for a given file
CLI Example:
salt '*' file.stats /etc/passwd
Convert a uid to a user name
CLI Example:
salt '*' file.uid_to_user S-1-5-21-626487655-2533044672-482107328-1010
Convert user name to a uid
CLI Example:
salt '*' file.user_to_uid myusername
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.