Commit e0bf24a2 authored by julian.gethmann's avatar julian.gethmann

Update version comparison

Fix issue #41 and make Opera role run again
parent 4f228ff6
---
- name: "Install basic client software"
apt:
name: "{{ item }}"
name: "{{ client_software }}"
state: present
with_items: "{{ client_software }}"
# with_items: "{{ client_software }}"
when: ansible_distribution == 'Ubuntu'
become: yes
- name: "Install basic client software"
dnf:
name: "{{ item }}"
name: "{{ client_software }}"
state: present
with_items: "{{ client_software }}"
# with_items: "{{ client_software }}"
when: ansible_distribution == 'Fedora'
become: yes
......@@ -20,7 +20,7 @@
line: "HIGHLEVEL_PACKAGE_MANAGER=dnf"
regexp: "HIGHLEVEL_PACKAGE_MANAGER=.*"
backup: yes
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "18")
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= "18")
- name: yum as package manager
become: yes
......@@ -29,7 +29,7 @@
line: "HIGHLEVEL_PACKAGE_MANAGER=yum"
regexp: "HIGHLEVEL_PACKAGE_MANAGER=.*"
backup: yes
when: (ansible_distribution == "CentOS" and ansible_distribution_major_version <= "7")
when: (ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) <= "7")
- name: apt as package manager
lineinfile:
......
......@@ -26,7 +26,7 @@
server ntp3.scc.kit.edu
server ntp4.scc.kit.edu
tags: ntp
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version >= 28)
when: (ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) >= 28)
- name: insert SCC into ntp configuration
become: yes
......@@ -41,7 +41,7 @@
server ntp3.scc.kit.edu
server ntp4.scc.kit.edu
tags: ntp
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version < 28)
when: (ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) < 28)
- name: Set timezone
become: yes
......
......@@ -10,13 +10,13 @@
package:
name: python-firewall
state: present
when: ((ansible_distribution == "Fedora" and ansible_distribution_major_version < 28) or
(ansible_distribution == "CentOS" and ansible_distribution_major_version >= 7))
when: ((ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) < 28)) or
(ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) >= 7)))
- name: Warn about firewalld not working
debug:
msg: Because python3-firewall is not working with the firewalld module, this tasks will not work!
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= 28)
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 28)
- name: Open port 22 on Fedora/CentOS
become: yes
......@@ -24,8 +24,8 @@
port: 22/tcp
state: enabled
permanent: true
when: ((ansible_distribution == "Fedora" and ansible_distribution_major_version < 28) or
(ansible_distribution == "CentOS" and ansible_distribution_major_version >= 7))
when: ((ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) < 28) or
(ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) >= 7))
notify:
- reload firewalld
- restart firewalld
......
......@@ -4,7 +4,7 @@
dnf:
name: "http://www.aps.anl.gov/Accelerator_Systems_Division/Accelerator_Operations_Physics/downloads/elegant-{{ item.value }}.{{ ansible_distribution|lower }}.{{ ansible_distribution_major_version }}.mpich.{{ ansible_architecture }}.rpm"
state: present
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int == item.key|int
when: ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) == item.key|int
with_dict: "{{ ele_version }}"
tags: elegant
......
......@@ -4,7 +4,7 @@
dnf:
name: "http://www.aps.anl.gov/Accelerator_Systems_Division/Accelerator_Operations_Physics/downloads/SDDSToolKit-{{ item.value }}.{{ ansible_distribution|lower }}.{{ ansible_distribution_major_version }}.{{ ansible_architecture }}.rpm"
state: present
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int == item.key|int
when: ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) == item.key|int
with_dict: "{{ sddstk_version }}"
tags:
- elegant
......
......@@ -7,7 +7,7 @@
with_items:
- rpcbind
- python3-firewall
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version >= 28)
when: (ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) >= 28)
- name: install dependencies
dnf:
......@@ -16,7 +16,7 @@
with_items:
- rpcbind
- python-firewall
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version < 28)
when: (ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) < 28)
- name: copy export file
copy:
......@@ -40,4 +40,4 @@
- 2049/tcp
- 111/tcp
notify: reload firewall
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version < 28)
when: (ansible_distribution == 'Fedora' and (ansible_distribution_major_version|int) < 28)
......@@ -24,17 +24,9 @@
- name: install dependencies
become: yes
dnf:
name: "{{ item }}"
name: ['libpng15', 'xcb-util-image', 'xcb-util-wm', 'xcb-util-keysyms', 'xcb-util-renderutil', 'xterm', 'pcre-utf16']
state: present
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "24")
with_items:
- 'libpng15'
- 'xcb-util-image'
- 'xcb-util-wm'
- 'xcb-util-keysyms'
- 'xcb-util-renderutil'
- 'xterm'
- 'pcre-utf16'
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 24)
# Work around for Fedora 25 vs. CentOS 7
- name: create dir for CentOS 7 libs
......@@ -44,7 +36,7 @@
state: directory
group: users
mode: g+rwx
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 22)
- name: copy libraries from real CentOS 7 host (server)
become: yes
......@@ -57,7 +49,7 @@
- { dest: 'libicui18n.so.50', src: 'libicui18n.so.50.1.2' }
- { dest: 'libicuuc.so.50', src: 'libicuuc.so.50.1.2' }
- { dest: 'libicudata.so.50', src: 'libicudata.so.50.1.2' }
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 22)
- name: make CentOS7 libs available
become: yes
......@@ -66,7 +58,7 @@
content: "{{ opera_path }}/CentOS7libs"
backup: yes
notify: ldconfig
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version | int) >= 22)
- name: install RHEL 6 deps
become: yes
......@@ -74,8 +66,8 @@
name: hwloc
state: present
when:
(ansible_distribution == "CentOS" and ansible_distribution_major_version == "6") or
(ansible_distribution == "RHEL" and ansible_distribution_major_version == "6")
(ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) == 6) or
(ansible_distribution == "RHEL" and (ansible_distribution_major_version|int) == 6)
- name: install RHEL 7 deps
become: yes
......@@ -83,9 +75,9 @@
name: hwloc-libs
state: present
when:
(ansible_distribution == "CentOS" and ansible_distribution_major_version == "7") or
(ansible_distribution == "RHEL" and ansible_distribution_major_version == "7") or
(ansible_distribution == "Fedora" and ansible_distribution_major_version >= "24")
(ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) == 7) or
(ansible_distribution == "RHEL" and (ansible_distribution_major_version|int) == 7) or
(ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 24)
- name: copy profile.d
become: yes
......
......@@ -8,7 +8,7 @@
args:
warn: False
changed_when: false
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= 24)
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 24)
tags: ripgrep
- name: install ripgrep
......@@ -16,7 +16,7 @@
dnf:
name: ripgrep
state: present
when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= 24)
when: (ansible_distribution == "Fedora" and (ansible_distribution_major_version|int) >= 24)
tags: ripgrep
# This needs to be done: TODO CentOS 7
......@@ -28,7 +28,7 @@
# state: present
# enabled: yes
# yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo
# when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == 7)
# when: (ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) == 7)
# tags: ripgrep
#
# - name: install ripgrep
......@@ -36,5 +36,5 @@
# yum:
# name: ripgrep
# state: present
# when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == 7)
# when: (ansible_distribution == "CentOS" and (ansible_distribution_major_version|int) == 7)
# tags: ripgrep
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment