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