resources: file: Implement file attributes

Add owner which must be username or uid of the file owner, group which is
the group name or gid of the file, and mode which is the octal unix file
permissions.

Add separate implementation for Go 1.6 and lower.
This commit is contained in:
Mildred Ki'Lya
2017-02-13 23:55:17 +01:00
committed by James Shubin
parent b9976cf693
commit 8c2c552164
8 changed files with 327 additions and 12 deletions

View File

@@ -247,6 +247,15 @@ The exec resource can execute commands on your system.
The file resource manages files and directories. In `mgmt`, directories are
identified by a trailing slash in their path name. File have no such slash.
It has the following properties:
- `path`: file path (directories have a trailing slash here)
- `content`: raw file content
- `state`: either `exists` (the default value) or `absent`
- `mode`: octal unix file permissions
- `owner`: username or uid for the file owner
- `group`: group name or gid for the file group
#### Path
The path property specifies the file or directory that we are managing.