Skip to main content
SaltStack Support

Setting the owner of a directory and file

To set directory and file ownership in a state file you can use the 'file' module in the state file. 

Here is an example of setting directory and files ownership recursively. This SLS file will set the owner on the wiki directory and all of the sub-directories and files: 

    - user: apache
    - group: apache
    - recurse:
      - user
      - group

For more information visit:

  • Was this article helpful?