Changing a files user and setting uid needs 2 runs, e.g.
first: File.recurse('/tmp',user='nobody')
and then: File.managed('/tmp/check_pidfile',user=root,mode='4750')
-> -rwxrwx--- 1 root nobody 11K Jan 18 15:10 check_pidfile
after a second run of File.managed('/tmp/check_pidfile',user=root,mode='4750')
-> -rwsrwx--- 1 root nobody 11K Jan 18 15:10 check_pidfile
Interesting. Can you post the output of salt --versions-report, please?
Salt: 2014.7.0
Python: 2.7.9 (default, Dec 11 2014, 04:42:00)
Jinja2: 2.7.3
M2Crypto: 0.22
msgpack-python: 0.4.4
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: 1.4.0
PyYAML: 3.11
ioflo: 1.0.1
PyZMQ: 14.4.1
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
Having the same problem here. This is my salt --versions output.
Salt: 2014.7.2
Python: 2.7.8 (default, Sep 5 2014, 12:34:45)
Jinja2: 2.7.3
M2Crypto: 0.22
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.4.1
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
Seeing this as well on Ubuntu Trusty
Just hit this issue myself:
Salt: 2015.5.3
Python: 2.6.9 (unknown, Apr 1 2015, 18:16:00)
Jinja2: 2.7.2
M2Crypto: 0.21.1
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.3.1
RAET: Not Installed
ZMQ: 3.2.5
Mako: Not Installed
Tornado: 4.1
FWIW, I'm still hitting this issue in Salt: 2015.5.8
For a workaround, make a second state that sets everything again and is dependent on the first state.
generate_salt_key_as_salt:
file.managed:
# Make sure to sync this state with the workaround state below.
- name: {{ app }}/generate_salt_key_as_salt
- user: salt
- group: minion_key_mgrs
- mode: '4750' #setuid, rwxr-x---
workaround-issue-19834:
# Because of a bug in salt, we need to run this state again.
# https://github.com/saltstack/salt/issues/19834
file.managed:
- name: {{ app }}/generate_salt_key_as_salt
- user: salt
- group: minion_key_mgrs
- mode: '4750' #setuid, rwxr-x---
- require:
- file: generate_salt_key_as_salt
Of course, you could accomplish something similar with a jinja loop. But since it's already a gross workaround I don't mind the copy-paste ugliness.
I've just got the setgid issue (ie. setting a file group and changing the setgid bit) on a fully updated ArchLinux:
Salt Version:
Salt: 2016.11.5
Dependency Versions:
ioflo: 1.6.7
Jinja2: 2.9.6
libnacl: 1.5.0
M2Crypto: 0.24.0
msgpack-python: 0.4.8
pycrypto: 2.6.1
Python: 2.7.13 (default, Feb 11 2017, 12:22:40)
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: 0.6.7
Tornado: 4.5.1
ZMQ: 4.2.1
System Versions:
dist:
machine: x86_64
release: 4.10.13-1-ARCH
system: Linux
@Phomias : thank you for the workaround :)
Happy Birthday issue #19834 ! :tada: :birthday: :gift:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
This seems fixed in 2019.2.0, thanks! Could anybody close the issue?
$ salt --versions-report | grep -v 'Not Installed'
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: 1.12.3
Jinja2: 2.10.1
M2Crypto: 0.30.1
msgpack-python: 0.6.1
pycparser: 2.19
pycrypto: 3.8.1
Python: 2.7.16 (default, Mar 11 2019, 18:59:25)
PyYAML: 3.13
PyZMQ: 18.0.1
Tornado: 5.1.1
ZMQ: 4.3.1
System Versions:
dist:
locale: UTF-8
machine: x86_64
release: 5.0.9-arch1-1-ARCH
system: Linux
Thank you for updating this issue. It is no longer marked as stale.
Yeah seems to be fixed here too :)
Most helpful comment
Happy Birthday issue #19834 ! :tada: :birthday: :gift: