]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
use dnf when yum is not available 502/head
authorSébastien Han <seb@redhat.com>
Thu, 28 Jan 2016 18:11:22 +0000 (19:11 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 28 Jan 2016 18:11:22 +0000 (19:11 +0100)
fixes the `importError: No module named yum` see here:
https://jenkins.ceph.com/job/ceph-ansible-pull-requests/45/console

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-common/tasks/installs/install_rgw_on_redhat.yml
roles/ceph-common/tasks/installs/redhat_ceph_repository.yml
roles/ceph-mds/tasks/docker/pre_requisite.yml
roles/ceph-mon/tasks/docker/pre_requisite.yml
roles/ceph-osd/tasks/docker/pre_requisite.yml
roles/ceph-restapi/tasks/docker/pre_requisite.yml
roles/ceph-rgw/tasks/docker/pre_requisite.yml

index 4d665933023c59a1492f08fc9349ace04f38bdc8..0eacdb733f3f7bd589821fa018105d3c9105b615 100644 (file)
@@ -4,6 +4,14 @@
     name: "{{ item }}"
     state: present
   with_items: redhat_package_dependencies
+  when: ansible_pkg_mgr == "yum"
+
+- name: install dependencies
+  dnf:
+    name: "{{ item }}"
+    state: present
+  with_items: redhat_package_dependencies
+  when: ansible_pkg_mgr == "dnf"
 
 - name: configure ceph yum repository
   include: redhat_ceph_repository.yml
     - ceph-mon
   when:
     ceph_stable_rh_storage and
-    mon_group_name in group_names
+    mon_group_name in group_names and
+    ansible_pkg_mgr == "yum"
+
+- name: install red hat storage ceph mon
+  dnf:
+    name: "{{ item }}"
+    state: latest
+  with_items:
+    - ceph
+    - ceph-mon
+  when:
+    ceph_stable_rh_storage and
+    mon_group_name in group_names and
+    ansible_pkg_mgr == "dnf"
 
 - name: install red hat storage ceph osd
   yum:
     - ceph-osd
   when:
     ceph_stable_rh_storage and
-    osd_group_name in group_names
+    osd_group_name in group_names and
+    ansible_pkg_mgr == "yum"
+
+- name: install red hat storage ceph osd
+  dnf:
+    name: "{{ item }}"
+    state: latest
+  with_items:
+    - ceph
+    - ceph-osd
+  when:
+    ceph_stable_rh_storage and
+    osd_group_name in group_names and
+    ansible_pkg_mgr == "dnf"
 
 - name: install Inktank Ceph Enterprise RBD Kernel modules
   yum:
   with_items:
     - "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm"
     - "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm"
-  when: ceph_stable_ice
+  when:
+    ceph_stable_ice and
+    ansible_pkg_mgr == "yum"
+
+- name: install Inktank Ceph Enterprise RBD Kernel modules
+  dnf:
+    name: "{{ item }}"
+  with_items:
+    - "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm"
+    - "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm"
+  when:
+    ceph_stable_ice and
+    ansible_pkg_mgr == "dnf"
 
 - name: install rados gateway
   yum:
     name: ceph-radosgw
     state: latest
   when:
-    rgw_group_name in group_names
+    rgw_group_name in group_names and
+    ansible_pkg_mgr == "yum"
+
+- name: install rados gateway
+  dnf:
+    name: ceph-radosgw
+    state: latest
+  when:
+    rgw_group_name in group_names and
+    ansible_pkg_mgr == "dnf"
 
 - name: configure rbd clients directories
   file:
index 39ff7051eb2c861721b2c10c4aea3b46548d0443..3dac9ab8904a434cd87b69a848030269b4a3c670 100644 (file)
     - httpd
     - mod_fastcgi
     - mod_fcgid
+  when: ansible_pkg_mgr == "yum"
+
+- name: install apache and fastcgi
+  dnf:
+    name: "{{ item }}"
+    state: present
+  with_items:
+    - httpd
+    - mod_fastcgi
+    - mod_fcgid
+  when: ansible_pkg_mgr == "dnf"
 
 - name: install rados gateway vhost
   template:
index 1654ceebe3eddaca03d1596c425e78e3fbe010cc..f896aeb279af37a3d720c4ea2c94601ce9caefda 100644 (file)
   yum:
     name: http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
   changed_when: false
-  when: ceph_stable
+  when:
+    ceph_stable and
+    ansible_pkg_mgr == "yum"
+
+- name: add ceph stable repository
+  dnf:
+    name: http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
+  changed_when: false
+  when:
+    ceph_stable and
+    ansible_pkg_mgr == "dnf"
 
 - name: add ceph development repository
   yum:
     name: http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm
   changed_when: false
-  when: ceph_dev
+  when:
+    ceph_dev and
+    ansible_pkg_mgr == "yum"
+
+- name: add ceph development repository
+  dnf:
+    name: http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm
+  changed_when: false
+  when:
+    ceph_dev and
+    ansible_pkg_mgr == "dnf"
 
-- name: add inktank ceph enterprise repository
   template:
     src: redhat_ice_repo.j2
     dest: /etc/yum.repos.d/ice.repo
index 36765e2ef756c6432096567fe459759ab63791ec..71a03bd05c8d27d33d8fc023968a70438adaf47c 100644 (file)
   yum:
     name: python-pip
     state: present
-  when: ansible_os_family == 'RedHat'
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "yum"
+
+- name: install pip on redhat
+  dnf:
+    name: python-pip
+    state: present
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "dnf"
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
index 211e64ee37a8278fe30c74f61bb03143ff7199c2..c4fb42d022959afa578dd93e1625054230a994e1 100644 (file)
   yum:
     name: python-pip
     state: present
-  when: ansible_os_family == 'RedHat'
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "yum"
+
+- name: install pip on redhat
+  dnf:
+    name: python-pip
+    state: present
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "dnf"
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
index 00b995087558c87b270504915fe83be46240b153..6797f6954abfcfd4bacec748097b6571c3838ac6 100644 (file)
   yum:
     name: python-pip
     state: present
-  when: ansible_os_family == 'RedHat'
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "yum"
+
+- name: install pip on redhat
+  dnf:
+    name: python-pip
+    state: present
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "dnf"
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
index d300ba57a9dee35829e6f371b544de408fc0a324..dd8b011ba24f180a509452531334e8f80f9ead2b 100644 (file)
@@ -9,7 +9,17 @@
   yum:
     name: python-pip
     state: present
-  when: ansible_os_family == 'RedHat'
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "yum"
+
+- name: install pip on redhat
+  dnf:
+    name: python-pip
+    state: present
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "dnf"
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
index ce84f6d7255c5a4865368a128487fcb8ecc39308..2b322050e95ac5815ffb3752b094e7aa432a54d0 100644 (file)
   yum:
     name: python-pip
     state: present
-  when: ansible_os_family == 'RedHat'
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "yum"
+
+- name: install pip on redhat
+  dnf:
+    name: python-pip
+    state: present
+  when:
+    ansible_os_family == 'RedHat' and
+    ansible_pkg_mgr == "dnf"
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py