]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Support infernalis for rh storage 442/head
authorSébastien Han <seb@redhat.com>
Fri, 20 Nov 2015 14:09:34 +0000 (15:09 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 15 Dec 2015 21:07:45 +0000 (22:07 +0100)
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-common/handlers/main.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-common/tasks/main.yml
roles/ceph-mds/tasks/pre_requisite.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/start_monitor.yml
roles/ceph-osd/tasks/activate_osds.yml
roles/ceph-osd/tasks/pre_requisite.yml
roles/ceph-rgw/tasks/pre_requisite.yml
roles/ceph-rgw/tasks/start_radosgw.yml

index ef109b0b6d5915569dd7ac78b26e85a127d6a46b..8aa7cc44837fcc42e683d2cbecd89823db534fa4 100644 (file)
@@ -8,12 +8,8 @@
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    mon_group_name in group_names and
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    mon_group_name in group_names and not
+    is_ceph_infernalis
 
 - name: restart ceph mons with systemd
   service:
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    mon_group_name in group_names and not
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    mon_group_name in group_names and
+    is_ceph_infernalis
 
 - name: restart ceph mons on ubuntu
   command: restart ceph-mon-all
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
     osd_group_name in group_names and
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    not is_ceph_infernalis
 
 # This does not just restart OSDs but everything else too. Unfortunately
 # at this time the ansible role does not have an OSD id list to use
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    osd_group_name in group_names and not
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    osd_group_name in group_names and
+    is_ceph_infernalis
 
 - name: restart ceph osds on ubuntu
   command: restart ceph-osd-all
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
     mds_group_name in group_names and
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
-
+    ceph_stable and
+    ceph_stable_release in ceph_stable_releases
 
 - name: restart ceph mdss with systemd
   service:
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    mds_group_name in group_names and not
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    mds_group_name in group_names and
+    ceph_stable and
+    ceph_stable_release not in ceph_stable_releases
 
 - name: restart ceph rgws on ubuntu
   command: restart ceph-all
     socketrgw.rc == 0 and
     ansible_distribution != 'Ubuntu' and
     rgw_group_name in group_names and
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    not is_ceph_infernalis
 
 - name: restart ceph rgws on red hat
   command: /etc/init.d/ceph-radosgw restart
     socketrgw.rc == 0 and
     ansible_os_family == 'RedHat' and
     rgw_group_name in group_names and
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    not is_ceph_infernalis
 
 - name: restart ceph rgws with systemd
   service:
   when:
     socketrgw.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    rgw_group_name in group_names and not
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+    rgw_group_name in group_names and
+    is_ceph_infernalis
 
 - name: restart apache2
   service:
index 2f279d92099bb26b9ddc51fd5dfad7539addc477..4d665933023c59a1492f08fc9349ace04f38bdc8 100644 (file)
    - rbd_client_log_path
    - rbd_client_admin_socket_path
   when: rbd_client_directories
+
+- name: get ceph rhcs version
+  shell: rpm -q --qf "%{version}\n" ceph-common | cut -f1,2 -d '.'
+  changed_when: false
+  failed_when: false
+  register: rh_storage_version
+  when: ceph_stable_rh_storage
index adae3e641c859530ab4d7d87640c558d83a82d89..6b6b4dfeaae405412006861564865a2b603ca10d 100644 (file)
@@ -49,7 +49,7 @@
   failed_when: false
   register: socketrgw
 
-- name: create a local fetch directory if it doesn't exist
+- name: create a local fetch directory if it does not exist
   local_action: file path={{ fetch_directory }} state=directory
   changed_when: false
   sudo: false
     owner: root
     group: root
     mode: 0644
+
+# NOTE (leseb): be careful with the following
+# somehow the YAML syntax using "is_ceph_infernalis: {{"
+# does NOT work, so we keep this syntax styling...
+- set_fact:
+    is_ceph_infernalis={{ (ceph_stable and ceph_stable_release not in ceph_stable_releases) or (ceph_stable_rh_storage and (rh_storage_version.stdout | version_compare('0.94', '>'))) }}
index 3ef77dda4fea0597bb2d093e0c633db0a84ccb29..485afddea88faa1dfc3e0942cc829bc7ec7b6975 100644 (file)
@@ -6,7 +6,7 @@
     owner: ceph
     group: ceph
     mode: 0755
-  when: ceph_stable_release not in ceph_stable_releases
+  when: is_ceph_infernalis
 
 - name: create bootstrap-mds directory (before infernalis release)
   file:
@@ -15,7 +15,7 @@
     owner: root
     group: root
     mode: 0755
-  when: cephx and ceph_stable_release in ceph_stable_releases
+  when: not is_ceph_infernalis
 
 - name: copy mds bootstrap key (for or after infernalis release)
   copy:
@@ -24,8 +24,7 @@
     owner: ceph
     group: ceph
     mode: 0600
-  when:
-    cephx and ceph_stable_release not in ceph_stable_releases
+  when: is_ceph_infernalis
 
 - name: copy mds bootstrap key (before infernalis release)
   copy:
@@ -34,8 +33,7 @@
     owner: root
     group: root
     mode: 0600
-  when:
-    cephx and ceph_stable_release in ceph_stable_releases
+  when: not is_ceph_infernalis
 
 - name: create mds directory (for or after infernalis release)
   file:
@@ -44,8 +42,7 @@
     owner: ceph
     group: ceph
     mode: 0755
-  when:
-    cephx and ceph_stable_release not in ceph_stable_releases
+  when: is_ceph_infernalis
 
 - name: create mds directory (before infernalis release)
   file:
@@ -54,8 +51,7 @@
     owner: root
     group: root
     mode: 0755
-  when:
-    cephx and ceph_stable_release in ceph_stable_releases
+  when: not is_ceph_infernalis
 
 - name: create mds keyring
   command: ceph --cluster ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.{{ ansible_hostname }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring
@@ -72,7 +68,7 @@
     group: ceph
   when:
     cephx and
-    ceph_stable_release not in ceph_stable_releases
+    is_ceph_infernalis
 
 - name: set mds key permissions (before infernalis)
   file:
@@ -81,7 +77,8 @@
     owner: root
     group: root
   when:
-    cephx and ceph_stable_release in ceph_stable_releases
+    cephx and
+    not is_ceph_infernalis
 
 - name: activate metadata server with upstart (for or after infernalis release)
   file:
@@ -96,7 +93,7 @@
   changed_when: false
   when:
     ansible_distribution == "Ubuntu" and
-    ceph_stable_release not in ceph_stable_releases
+    is_ceph_infernalis
 
 - name: activate metadata server with upstart (before infernalis release)
   file:
     - upstart
   changed_when: false
   when:
-    ansible_distribution == "Ubuntu" and ceph_stable_release in ceph_stable_releases
+    ansible_distribution == "Ubuntu" and
+    not is_ceph_infernalis
 
 - name: activate metadata server with sysvinit (for or after infernalis release)
   file:
   changed_when: false
   when:
     ansible_distribution != "Ubuntu" and
-    ceph_stable_release not in ceph_stable_releases
+    is_ceph_infernalis
 
 - name: activate metadata server with sysvinit (before infernalis release)
   file:
     - sysvinit
   changed_when: false
   when:
-    ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
+    ansible_distribution != "Ubuntu" and
+    not is_ceph_infernalis
 
 - name: start and add that the metadata service to the init sequence (ubuntu)
   service:
     enabled: yes
     args: mds.{{ ansible_hostname }}
   changed_when: false
-  when: ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
+  when:
+    ansible_distribution != "Ubuntu" and
+    not is_ceph_infernalis
 
 - name: start and add that the metadata service to the init sequence (for or after infernalis)
   service:
     state: started
     enabled: yes
   changed_when: false
-  when: ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
+  when:
+    ansible_distribution != "Ubuntu" and
+    is_ceph_infernalis
index 1982e4105e5754ab0879917fb72737c70171eba9..d898c9fc1df142fa766b525953fd82055d79450f 100644 (file)
     mode: 0600
     owner: ceph
     group: ceph
-  when: ceph_stable_release not in ceph_stable_releases
+  when: is_ceph_infernalis
+
+- name: set initial monitor key permissions (before infernalis release)
+  file:
+    path: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
+    mode: 0600
+    owner: root
+    group: root
+  when: not is_ceph_infernalis
 
 - name: create monitor directory (for or after infernalis release)
   file:
     owner: ceph
     group: ceph
     mode: 0755
-  when: ceph_stable_release not in ceph_stable_releases
-
-- name: set initial monitor key permissions (before infernalis release)
-  file:
-    path: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
-    mode: 0600
-    owner: root
-    group: root
-  when: ceph_stable_release in ceph_stable_releases
+  when: is_ceph_infernalis
 
 - name: create monitor directory (before infernalis release)
   file:
     owner: root
     group: root
     mode: 0755
-  when: ceph_stable_release in ceph_stable_releases
+  when: not is_ceph_infernalis
 
 - name: ceph monitor mkfs (for or after infernalis release)
   command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
   args:
     creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
-  when: ceph_stable_release not in ceph_stable_releases
+  when: is_ceph_infernalis
 
 - name: ceph monitor mkfs (before infernalis release)
   command: ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
   args:
     creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
-  when: ceph_stable_release in ceph_stable_releases
+  when: not is_ceph_infernalis
index d77e9fca0534df76810af63a6f099d5cc0a127de..f0710bd9042d0c205a6560cfdbf426ee9f7fc905 100644 (file)
@@ -6,13 +6,13 @@
     owner: ceph
     group: ceph
     mode: 0600
+  changed_when: false
   with_items:
     - done
     - upstart
-  when: 
-    ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
-
-  changed_when: false
+  when:
+    ansible_distribution == "Ubuntu" and
+    is_ceph_infernalis
 
 - name: activate monitor with upstart before infernalis release
   file:
     owner: root
     group: root
     mode: 0600
+  changed_when: false
   with_items:
     - done
     - upstart
   when:
     ansible_distribution == "Ubuntu" and
-    ceph_stable_release in ceph_stable_releases
-  changed_when: false
+    not is_ceph_infernalis
 
 - name: start and add that the monitor service to the init sequence (ubuntu)
   service:
@@ -44,7 +44,7 @@
   changed_when: false
   when:
     ansible_distribution != "Ubuntu" and
-    ceph_stable_release in ceph_stable_releases
+    not is_ceph_infernalis
 
 - name: start and add that the monitor service to the init sequence (for or after infernalis)
   service:
@@ -54,7 +54,7 @@
   changed_when: false
   when:
     ansible_distribution != "Ubuntu" and
-    ceph_stable_release not in ceph_stable_releases
+    is_ceph_infernalis
 
 - name: collect admin and bootstrap keys
   command: ceph-create-keys --id {{ ansible_hostname }}
index d3cfe900fd1bb14897050e10a8b5854ba88fab1b..21f2fc3e3a063100f31d73bb09b308c891bd75be 100644 (file)
     state: started
     enabled: yes
   when:
-    ansible_distribution == "Ubuntu" or
-    (ceph_stable_release == 'dumpling' or
-     ceph_stable_release == 'emperor' or
-     ceph_stable_release == 'firefly' or
-     ceph_stable_release == 'giant' or
-     ceph_stable_release == 'hammer')
+    ansible_distribution != "Ubuntu" and
+    not is_ceph_infernalis
 
-- name: start and add that the osd service(s) to the init sequence (on or after infernalis)
+- name: start and add that the osd service(s) to the init sequence (for or after infernalis)
   service:
     name: ceph.target
     state: started
     enabled: yes
   when:
-    ansible_distribution != "Ubuntu" and not
-    (ceph_stable_release == 'dumpling' or
-     ceph_stable_release == 'emperor' or
-     ceph_stable_release == 'firefly' or
-     ceph_stable_release == 'giant' or
-     ceph_stable_release == 'hammer')
-
+    ansible_distribution != "Ubuntu" and
+    is_ceph_infernalis
index 97d3f0367c9f36563a82df43d63e5419fa74d86d..4f1a5f15efd21a175e6e25cf932505d8bf2c7e53 100644 (file)
@@ -18,7 +18,9 @@
     owner: ceph
     group: ceph
     mode: 0755
-  when: cephx and ceph_stable_release not in ceph_stable_releases
+  when:
+    cephx and
+    is_ceph_infernalis
 
 - name: create bootstrap-osd directory (before infernalis release)
   file:
@@ -27,7 +29,9 @@
     owner: root
     group: root
     mode: 0755
-  when: cephx and ceph_stable_release in ceph_stable_releases
+  when:
+   cephx and
+   not is_ceph_infernalis
 
 - name: copy osd bootstrap key (for or after infernalis release)
   copy:
@@ -36,7 +40,9 @@
     owner: ceph
     group: ceph
     mode: 0600
-  when: cephx and ceph_stable_release not in ceph_stable_releases
+  when:
+    cephx and
+    is_ceph_infernalis
 
 - name: copy osd bootstrap key (before infernalis release)
   copy:
@@ -45,4 +51,6 @@
     owner: root
     group: root
     mode: 600
-  when: cephx and ceph_stable_release in ceph_stable_releases
+  when:
+    cephx and
+    not is_ceph_infernalis
index 9a415f255adb51a3e24a70c57b6a2e8246b623aa..fece7fc9ea8f24f63c323e59af52578b4d13859a 100644 (file)
@@ -9,7 +9,7 @@
   with_items:
     - /var/lib/ceph/bootstrap-rgw
     - /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
-  when: ceph_stable_release not in ceph_stable_releases
+  when: is_ceph_infernalis
 
 - name: create rados gateway directories (before infernalis release)
   file:
@@ -21,7 +21,7 @@
   with_items:
     - /var/lib/ceph/bootstrap-rgw
     - /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
-  when: ceph_stable_release in ceph_stable_releases
+  when: not is_ceph_infernalis
 
 - name: copy rados gateway bootstrap key (for or after infernalis release)
   copy:
@@ -30,7 +30,9 @@
     owner: ceph
     group: ceph
     mode: 0600
-  when: cephx and ceph_stable_release not in ceph_stable_releases
+  when:
+    cephx and
+    is_ceph_infernalis
 
 - name: copy rados gateway bootstrap key (before infernalis release)
   copy:
@@ -39,7 +41,9 @@
     owner: root
     group: root
     mode: 0600
-  when: cephx and ceph_stable_release in ceph_stable_releases
+  when:
+    cephx and
+    not is_ceph_infernalis
 
 - name: create rados gateway keyring
   command: ceph --cluster ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/ceph.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
@@ -54,7 +58,9 @@
     mode: 0600
     owner: ceph
     group: ceph
-  when: cephx and ceph_stable_release not in ceph_stable_releases
+  when:
+    cephx and
+    is_ceph_infernalis
 
 - name: set rados gateway key permissions (before infernalis release)
   file:
@@ -62,7 +68,9 @@
     mode: 0600
     owner: root
     group: root
-  when: cephx and ceph_stable_release in ceph_stable_releases
+  when:
+    cephx and
+    not is_ceph_infernalis
 
 - name: activate rados gateway with upstart (for or after infernalis release)
   file:
@@ -76,7 +84,8 @@
     - upstart
   changed_when: false
   when:
-    ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
+    ansible_distribution == "Ubuntu" and
+    is_ceph_infernalis
 
 - name: activate rados gateway with upstart (before infernalis release)
   file:
@@ -90,7 +99,8 @@
     - upstart
   changed_when: false
   when:
-    ansible_distribution == "Ubuntu" and ceph_stable_release in ceph_stable_releases
+    ansible_distribution == "Ubuntu" and
+    not is_ceph_infernalis
 
 - name: activate rados gateway with sysvinit (for or after infernalis release)
   file:
     - sysvinit
   changed_when: false
   when:
-    ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
+    ansible_distribution != "Ubuntu" and
+    is_ceph_infernalis
 
 - name: activate rados gateway with sysvinit (before infernalis release)
   file:
     - sysvinit
   changed_when: false
   when:
-    ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
+    ansible_distribution != "Ubuntu" and
+    not is_ceph_infernalis
 
 - name: generate rados gateway sudoers file
   template:
index ef5dc98d705a1a6aaf7c83734a002d568123108a..572824c8f66171c5e06ccb411a5f834959e8c99b 100644 (file)
     name: ceph-radosgw
     state: started
     enabled: yes
-  when: ansible_os_family == 'RedHat' and
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+  when:
+    ansible_os_family == 'RedHat' and
+    not is_ceph_infernalis
 
 - name: start rgw on red hat (after infernalis)
   service:
     name: ceph-radosgw@{{ ansible_hostname }}
     state: started
     enabled: yes
-  when: ansible_os_family == 'RedHat' and not
-    (ceph_stable_release == 'dumpling' or
-    ceph_stable_release == 'emperor' or
-    ceph_stable_release == 'firefly' or
-    ceph_stable_release == 'giant' or
-    ceph_stable_release == 'hammer')
+  when:
+    ansible_os_family == 'RedHat' and
+    is_ceph_infernalis