Skip to main content
SaltStack Support

Setting file and directory permissions

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

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

/var/www/html/wiki/data:
  file.directory:
    - dir_mode: 755
    - file_mode: 666
      - recurse:
      - mode

For more information visit: http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#module-salt.states.file

  • Was this article helpful?