]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: create a new install task for rh storage on redhat
authorAlfredo Deza <adeza@redhat.com>
Tue, 24 May 2016 14:07:34 +0000 (10:07 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 25 May 2016 13:24:58 +0000 (09:24 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
Resolves: rhbz#1339096

roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml [new file with mode: 0644]
roles/ceph-common/tasks/installs/redhat_ceph_repository.yml

index f4f55c8cc9e9d4445813deb14bd0a913732514ed..e35bf9b4df5af20591144f78aafe2e99644699f7 100644 (file)
@@ -40,7 +40,7 @@
 # a separate ceph-mon package or ceph-osd package
 # Note: Red Hat Ceph Storage is different, DOES separate them even in hammer
 
-- set_fact: > 
+- set_fact: >
     ceph_stable_rel_pkg="{{ ceph_stable_releases | union([ 'infernalis' ]) }}"
 
 - name: install distro or red hat storage ceph mon
@@ -48,7 +48,7 @@
     name: "ceph-mon"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_stable_rh_storage or
+    (ceph_origin == "distro" or
      (ceph_stable and ceph_stable_release not in ceph_stable_rel_pkg)) and
     mon_group_name in group_names and
     ansible_pkg_mgr == "yum"
     name: "ceph-mon"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_stable_rh_storage or
+    (ceph_origin == "distro" or
      (ceph_stable and ceph_stable_release not in ceph_stable_rel_pkg)) and
     mon_group_name in group_names and
-    ansible_pkg_mgr == "dnf"
+    ansible_pkg_mgr == "yum"
 
 - name: install distro or red hat storage ceph osd
   yum:
     name: "ceph-osd"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_stable_rh_storage or
+    (ceph_origin == "distro" or
      (ceph_stable and ceph_stable_release not in ceph_stable_rel_pkg)) and
     osd_group_name in group_names and
     ansible_pkg_mgr == "yum"
@@ -78,7 +78,7 @@
     name: "ceph-osd"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_stable_rh_storage or
+    (ceph_origin == "distro" or
      (ceph_stable and ceph_stable_release not in ceph_stable_rel_pkg)) and
     osd_group_name in group_names and
     ansible_pkg_mgr == "dnf"
@@ -88,7 +88,7 @@
     name: "ceph-mds"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_stable_rh_storage or ceph_dev or
+    (ceph_origin == "distro" or ceph_dev or
      (ceph_stable and ceph_stable_release not in ceph_stable_releases)) and
     mds_group_name in group_names and
     ansible_pkg_mgr == "yum"
@@ -98,7 +98,7 @@
     name: "ceph-mds"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   when:
-    (ceph_origin == "distro" or ceph_stable_rh_storage or ceph_dev or
+    (ceph_origin == "distro" or ceph_dev or
      (ceph_stable and ceph_stable_release not in ceph_stable_releases)) and
     mds_group_name in group_names and
     ansible_pkg_mgr == "dnf"
diff --git a/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml b/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml
new file mode 100644 (file)
index 0000000..0bf5ad9
--- /dev/null
@@ -0,0 +1,67 @@
+---
+- name: install red hat storage repository key
+  rpm_key:
+    key: "{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release"
+    state: present
+  when:
+    - ceph_stable_rh_storage_iso_install
+
+- name: add red hat storage repository
+  template:
+    src: ../../templates/redhat_storage_repo.j2
+    dest: /etc/yum.repos.d/rh_storage.repo
+    owner: root
+    group: root
+    mode: 0644
+  when:
+    - ceph_stable_rh_storage_iso_install
+
+- name: install dependencies
+  yum:
+    name: "{{ item }}"
+    state: present
+  with_items: redhat_package_dependencies
+  when:
+    - ansible_pkg_mgr == "yum"
+
+- name: install red hat storage ceph mon
+  yum:
+    name: "ceph-mon"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - mon_group_name in group_names
+
+- name: install red hat storage ceph osd
+  yum:
+    name: "ceph-osd"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - osd_group_name in group_names
+
+- name: install red hat storage ceph mds
+  yum:
+    name: "ceph-mds"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - mds_group_name in group_names
+
+- name: install red hat storage ceph base
+  yum:
+    name: "ceph-base"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - client_group_name in group_names
+
+- name: install ceph-test
+  yum:
+    name: ceph-test
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - ceph_test
+
+- name: install rados gateway
+  yum:
+    name: ceph-radosgw
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - rgw_group_name in group_names
index bc4e906bd27ad5b532fbc425468b5266021de239..3dcde8904fdc8fb16dff5d6ea4851db1643b07c3 100644 (file)
@@ -22,8 +22,8 @@
     key: "{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release"
     state: present
   when:
-    ceph_stable_rh_storage and
-    ceph_stable_rh_storage_iso_install
+    - ceph_stable_rh_storage
+    ceph_stable_rh_storage_iso_install
 
 - name: add ceph stable repository
   yum:
     group: root
     mode: 0644
   when: ceph_stable_ice
-
-- name: add red hat storage repository
-  template:
-    src: ../../templates/redhat_storage_repo.j2
-    dest: /etc/yum.repos.d/rh_storage.repo
-    owner: root
-    group: root
-    mode: 0644
-  when:
-    ceph_stable_rh_storage and
-    ceph_stable_rh_storage_iso_install