Set umask for an individual salt state
-
Is there a way to set the umask for the pip state module or is there a more generic way to set the umask before specific state modules are run? In ansible the pip module takes a umask parameter. I do not see an equivalent option in the salt pip state module. We run salt-call with a umask of 007 but we need to install certain python packages with more open permissions; is there a way to do this?
-
No, there's no facility for changing the umask of the running Salt process.
What you could do is start a new process with
cmd.run
:install python module: cmd.run: - name: pip install foo - umask: '077' - unless: - fun: pip.is_installed pkgname: foo
install python module at version:
cmd.run:
- name: pip install bar==4.2
- umask: '077'
- unless:
- pip freeze | grep bar==4.2