salt: CloudLinux not detected as os_family: RedHat (consequences of #28951)
Due to the change in #28951, all CloudLinux versions now have the os_family grain of ‘CloudLinux Server’. This is because the _OS_NAME_MAP in grains/core.py:929 was not updated to be consistent with the change.
The consequences of this, I’m sure you can imagine, are considerable and terminal to state execution.
Curently:
'cloudserve': 'CloudLinux',
This would need changing to:
'cloudlinux: 'CloudLinux',
This then cascades to also break the grains osfinger and osmajorrelease because they rely on os_family.
nb. Even setting a manual grain in /etc/salt/grains on the minion for os_family: RedHat does not fix the broken osfinger/osmajorrelease grains, as the test used to set these depends on the value of os_family determined earlier in grains/core.py (this is, perhaps, another problem; that manual grains are not respected during determination of other values)
# salt-minion --versions-report
Salt Version:
Salt: 2015.8.8.2
Dependency Versions:
Jinja2: 2.2.1
M2Crypto: 0.20.2
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.5.0
Python: 2.6.6 (r266:84292, Jul 29 2015, 18:30:53)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.4.1
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: redhat 6.7 Aleksei Gubarev
machine: x86_64
release: 2.6.32-673.8.1.lve1.4.3.el6.x86_64
system: CloudLinux Server 6.7 Aleksei Gubarev
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (15 by maintainers)
@MadsRC We never “gave” it its own
os_family. The way this works is that theosgrain is checked against a mapping ofosgrains toos_familynames, and if no match is found, as a fallback we use theosgrain itself as theos_family. It looks like, way back in 2013, the /etc/redhat-release or /etc/os-release (or whatever it is that we read the OS name from) began withCloudServeror something like that. At some point, this appears to have changed. So, the entry in the_OS_NAME_MAPno longer matches, which means we don’t identify theosgrain asCloudLinux, which consequently means there is no match in the_OS_FAMILY_MAPwhich maps theosgrain to itsos_family.I opened https://github.com/saltstack/salt/pull/36408 to properly identify CloudLinux so that it gets the RedHat
os_family.Also, just FYI, I think it is possible to manually set the
osandos_familygrains using grains.setvalsThis will add these grains to
/etc/salt/grains. I’m not 100 percent certain this solution will work though as I haven’t tested it. In other words, I don’t know if core grains evaluation happens before or after/etc/salt/grainsis evaluated.We don’t often recommend people manually set important grains like this because it can have unexpected consequences, but this is one of the exceptions to the rule.