From: David Galloway Date: Thu, 17 Oct 2019 18:07:57 +0000 (-0400) Subject: ansible: Update playbooks for CentOS8 compatibility X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e0ebbacc92c916f00b9bed1ca8cd928aeb31b33c;p=ceph-build.git ansible: Update playbooks for CentOS8 compatibility Signed-off-by: David Galloway --- diff --git a/ansible/examples/slave.yml b/ansible/examples/slave.yml index 835403a3..320f5426 100644 --- a/ansible/examples/slave.yml +++ b/ansible/examples/slave.yml @@ -126,7 +126,7 @@ when: ansible_os_family == "RedHat" - name: Install RPM requirements - yum: + package: name: "{{ item }}" state: present with_items: @@ -156,9 +156,9 @@ - rpmdevtools - openssl-devel - libffi-devel - when: ansible_pkg_mgr == "yum" + when: ansible_os_family == "RedHat" - - name: install packages from epel + - name: install packages from epel (<=7) yum: name: "{{ item }}" state: present @@ -167,7 +167,22 @@ with_items: - jq - python-pip - when: ansible_os_family == "RedHat" + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version|int <= 7 + + - name: install packages from epel (>=8) + dnf: + name: "{{ item }}" + state: present + enablerepo: epel + update_cache: yes + with_items: + - jq + - python3-pip + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version|int >= 8 # Run the equivalent of "apt-get update" as a separate step - apt: diff --git a/ansible/examples/slave_libvirt.yml b/ansible/examples/slave_libvirt.yml index 7725192c..03ecccfe 100644 --- a/ansible/examples/slave_libvirt.yml +++ b/ansible/examples/slave_libvirt.yml @@ -1,4 +1,5 @@ --- +# This playbook needs to be updated for EL8 compatibility - hosts: all become: true diff --git a/ansible/examples/slave_libvirt_static.yml b/ansible/examples/slave_libvirt_static.yml index 44cfeef7..76c77b92 100644 --- a/ansible/examples/slave_libvirt_static.yml +++ b/ansible/examples/slave_libvirt_static.yml @@ -2,6 +2,8 @@ # This playbook is used to configure static libvirt&&vagrant slaves. # Ubuntu >= 16.04 and CentOS 7.3 are the only tested distros # +# This playbook needs to be updated for EL8 compatibility +# # Example usage: # On a baremetal node already configured by the github.com/ceph/ceph-cm-ansible common role, # `cd ceph-build/ansible && cp examples/slave_libvirt_static.yml .` then: diff --git a/ansible/examples/slave_static.yml b/ansible/examples/slave_static.yml index 326fff5c..cfb1e8ad 100644 --- a/ansible/examples/slave_static.yml +++ b/ansible/examples/slave_static.yml @@ -93,9 +93,9 @@ mode: 0644 when: ansible_pkg_mgr == "yum" - - name: Install RPM requirements + - name: Install RPM requirements (All distro versions) sudo: yes - yum: + package: name: "{{ item }}" state: present update_cache: yes @@ -104,8 +104,6 @@ - epel-release - java-1.8.0-openjdk - git - - python-pip - - python-virtualenv - libtool #- rpm-sign - autoconf @@ -127,10 +125,37 @@ - rpmdevtools - openssl-devel - libffi-devel - when: ansible_pkg_mgr == "yum" + when: + - ansible_os_family == "RedHat" + + - name: Install RPM requirements (<=7) + sudo: yes + package: + name: "{{ item }}" + state: present + update_cache: yes + with_items: + - python-pip + - python-virtualenv + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version|int <= 7 + + - name: Install RPM requirements (>=8) + sudo: yes + package: + name: "{{ item }}" + state: present + update_cache: yes + with_items: + - python3-pip + - python3-virtualenv + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version|int >= 8 - name: install packages from epel - yum: + package: name: jq state: present enablerepo: epel