]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
upgrade: a support for mgrs 1974/head
authorSébastien Han <seb@redhat.com>
Tue, 3 Oct 2017 10:25:12 +0000 (12:25 +0200)
committerSébastien Han <seb@redhat.com>
Tue, 3 Oct 2017 14:57:31 +0000 (16:57 +0200)
Also we now play ceph-config to have everything being generated for new
daemons bootstrap during upgrade.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1497959
Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/rolling_update.yml
roles/ceph-client/tasks/pre_requisite.yml

index 234a3f00f3f92574d7ce8012250ffe9fb5e61f8c..c08dd98c5767e4873fcdd331246065383d12c6b5 100644 (file)
@@ -94,6 +94,7 @@
 
   roles:
     - ceph-defaults
+    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
     - ceph-mon
 
   roles:
     - ceph-defaults
+    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
     - ceph-osd
 
   roles:
     - ceph-defaults
+    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
     - ceph-mds
 
   roles:
     - ceph-defaults
+    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
     - ceph-rgw
 
   roles:
     - ceph-defaults
-    - ceph-common
+    - ceph-config
+    - { role: ceph-common, when: not containerized_deployment }
+    - { role: ceph-docker-common, when: containerized_deployment }
     - ceph-client
+
+
+- name: upgrade ceph mgr node
+
+  vars:
+    upgrade_ceph_packages: True
+
+  hosts:
+    - "{{ mgr_group_name|default('mgrs') }}"
+
+  serial: 1
+  become: True
+
+  pre_tasks:
+    # this task has a failed_when: false to handle the scenario where no mgr existed before the upgrade
+    - name: stop ceph mgrs
+      service:
+        name: ceph-mgr@{{ ansible_hostname }}
+        state: stopped
+        enabled: yes
+      failed_when: false
+      when:
+        - not containerized_deployment
+
+  roles:
+    - ceph-defaults
+    - ceph-config
+    - { role: ceph-common, when: not containerized_deployment }
+    - { role: ceph-docker-common, when: containerized_deployment }
+    - { role: ceph-mgr, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" }
+
+  post_tasks:
+    - name: start ceph mgrs
+      service:
+        name: ceph-mgr@{{ ansible_hostname }}
+        state: started
+        enabled: yes
+      when:
+        - not containerized_deployment
+
+    - name: restart containerized ceph mgrs
+      service:
+        name: ceph-mgr@{{ ansible_hostname }}
+        state: restarted
+        enabled: yes
+      when:
+        - containerized_deployment
+
+
+- name: show ceph status
+
+  hosts:
+    - "{{ mon_group_name|default('mons') }}"
+
+  become: True
+
+  roles:
+    - ceph-defaults
+
+  tasks:
+    - name: set_fact docker_exec_cmd_status
+      set_fact:
+        docker_exec_cmd_status: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
+      when:
+        - containerized_deployment
+
+    - name: show ceph status
+      command: "{{ docker_exec_cmd_status|default('') }} ceph --cluster {{ cluster }} -s"
+      delegate_to: "{{ groups[mon_group_name][0] }}"
index 94c0d2735ed91d8d34cc02a6363e3f11c2923f7e..8df7fc04868c5315ee6c7162ee6c0d74bfb5b18e 100644 (file)
@@ -7,9 +7,9 @@
     - /var/lib/ceph
   changed_when: false
   when:
+    - containerized_deployment
     - sestatus is defined
     - sestatus.stdout != 'Disabled'
-    - containerized_deployment
 
 - name: copy ceph admin keyring
   copy: