Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version comparision for RedHat based distributions #35

Open
wojciech-kopras opened this issue Dec 6, 2018 · 0 comments
Open

Version comparision for RedHat based distributions #35

wojciech-kopras opened this issue Dec 6, 2018 · 0 comments

Comments

@wojciech-kopras
Copy link

In file tasks/persist-redhat.yml to compare version number it's better to use filter |int >= 7 and |int < 7 - then the comparision will work correctly also for versions bigger than 9. This change will make this role working properly also on Fedora 28 servers - as it happened to me..

It's mentioned here:

Tip: Sometimes you’ll get back a variable that’s a string and you’ll want to do a math operation comparison on it. You can do this like so:

tasks:

  • shell: echo "only on Red Hat 6, derivatives, and later"
    when: ansible_facts['os_family'] == "RedHat" and ansible_facts['lsb']['major_release']|int >= 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant