[Bug 964445] New: salt grains : os_family and osrelease_info
http://bugzilla.opensuse.org/show_bug.cgi?id=964445 Bug ID: 964445 Summary: salt grains : os_family and osrelease_info Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.1 Hardware: Other OS: Other Status: NEW Severity: Major Priority: P5 - None Component: Other Assignee: bnc-team-screening@forge.provo.novell.com Reporter: osynge@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- If you make an SLS file as such: {% if grains['os_family'] == 'Suse' %} {% if grains['osrelease_info'].0 == '42' %} /etc/zypp/repos.d/home_osynge_vmcatcher.repo: file: - managed - source: - salt://jenkins-swarm/home:osynge:vmcatcher.repo - user: root - group: root - mode: 600 - makedirs: False {% endif %} {% endif %} {% if grains['os'] == 'openSUSE Leap' %} {% if grains['osrelease_info'].0 == '42' %} /etc/zypp/repos.d/home_osynge_vmcatcher.repo: file: - managed - source: - salt://jenkins-swarm/home:osynge:vmcatcher.repo - user: root - group: root - mode: 600 - makedirs: False {% endif %} {% endif %} {% if grains['os'] == 'openSUSE Leap' %} /etc/zypp/repos.d/home_osynge_vmcatcher.repo: file: - managed - source: - salt://jenkins-swarm/home:osynge:vmcatcher.repo - user: root - group: root - mode: 600 - makedirs: False {% endif %} It should error as duplicate states as all these filters match on LEAP. SO the bugs are that {% if grains['os_family'] == 'Suse' %} Does not work on LEAP. and that {% if grains['osrelease_info'].0 == '42' %} Does not work on LEAP. Corresponding solutions work for redhat closes such as Scientific Linux. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
Bernhard Wiedemann
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c1
Andreas Stieger
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c2
Richard Brown
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c3
Duncan Mac-Vicar
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c4
--- Comment #4 from Owen Synge
We had some issues with Leap because Leap is inconsistent to the rest of distros on what information it puts on each os-release fields.
See https://github.com/SUSE/spacewalk/wiki/Salt-on-SUSE
But those were patched. And if I start a Leap container with docker:
docker start -ti opensuse:42.1 /bin/bash
I can't reproduce what Owen Mentions "{% if grains['os_family'] == 'Suse' %} Does not work on LEAP."
bash-4.2# salt-call --local grains.get os_family local: Suse
"{% if grains['osrelease_info'].0 == '42' %} Does not work on LEAP."
bash-4.2# salt-call --local grains.get osrelease_info local: - 42 - 1
osrelease_info is an array. Can you index arrays like that in jinja?
Why not grains['osrelease_info'[0]
This is now working for me, ad can be closed as fixed. Best regards Owen -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c5
Richard Brown
We had some issues with Leap because Leap is inconsistent to the rest of distros on what information it puts on each os-release fields.
Very nice documentation of a very valid approach I think openSUSE should consider - has this been proposed in a bug somewhere or in opensuse-factory@? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c6
--- Comment #6 from Duncan Mac-Vicar
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
Dominique Leuenberger
http://bugzilla.opensuse.org/show_bug.cgi?id=964445
http://bugzilla.opensuse.org/show_bug.cgi?id=964445#c7
--- Comment #7 from Dominique Leuenberger
participants (1)
-
bugzilla_noreply@novell.com