How to change the owner, or chown -R user: user equivalent with a salt sink?

I just study the salt column to begin the automation of preparation and deployment. I am having trouble finding how to recursively establish ownership of a directory after extracting the archive. When I use the user and group properties, I get a warning that this function will be omitted from archive.extracted in a future version (carbon).

It seems so trivial, but I cannot find a good way to make the equivalent of chown -R user:user in a directory that is extracted from the tar that I am unpacking.

The only thing I could find through googling was to add the cmd.run statement to the status file that runs chown and require an instruction that decompresses tar. There must be a better way, right?

EDIT: The cmd.run training cmd.run fine, it seems to work.

+4
source share
1 answer

This is how I used it. I am extracting the file and then file.directory which sets the permission.

 /path/to/extracted/dir: file.directory: - user: <someuser> - group: <group> - mode: 755 # some permission - recurse: - user - group - require: - archive: <State id of `archive.extracted`> 
+8
source

All Articles