]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Rolling update changes for containerized deployments 1077/head
authorIvan Font <ifont@redhat.com>
Wed, 16 Nov 2016 08:35:09 +0000 (00:35 -0800)
committerIvan Font <ifont@redhat.com>
Thu, 17 Nov 2016 19:25:25 +0000 (11:25 -0800)
Separate out systemd restart tasks for containerized and
non-containerized deployments

Signed-off-by: Ivan Font <ifont@redhat.com>
infrastructure-playbooks/rolling_update.yml

index a5b31432c6433a8ed0c287be46c991392f37f8af..46c11ea7294303438443b32a8a89d292c40e2e0a 100644 (file)
@@ -28,6 +28,7 @@
          invoking the playbook"
     when: ireallymeanit != 'yes'
 
+
 - name: gather facts and check the init system
   vars:
     mon_group_name:       mons
@@ -62,6 +63,7 @@
       command: grep -sq systemd /proc/1/comm
       register: is_systemd
 
+
 - name: upgrade ceph mon cluster
 
   vars:
@@ -80,7 +82,7 @@
     - name: set mon_host_count
       set_fact: mon_host_count={{ groups.mons | length }}
 
-    - debug: msg="WARNING - upgrading a Ceph cluster with only one monitor node ({{ inventory_hostname }})"
+    - debug: msg="WARNING - upgrading a ceph cluster with only one monitor node ({{ inventory_hostname }})"
       when: mon_host_count | int == 1
 
     - name: stop ceph mons with upstart
         name: ceph-mon@{{ ansible_hostname }}
         state: stopped
         enabled: yes
-      when: is_systemd
+      when:
+        - is_systemd
+        - not mon_containerized_deployment
 
   roles:
     - ceph-mon
         name: ceph-mon@{{ ansible_hostname }}
         state: started
         enabled: yes
-      when: is_systemd
+      when:
+        - is_systemd
+        - not mon_containerized_deployment
+
+    - name: restart containerized ceph mons with systemd
+      service:
+        name: ceph-mon@{{ ansible_hostname }}
+        state: restarted
+        enabled: yes
+      when:
+        - is_systemd
+        - mon_containerized_deployment
 
     - name: set mon_host_count
       set_fact: mon_host_count={{ groups.mons | length }}
         - noscrub
         - nodeep-scrub
       delegate_to: "{{ groups.mons[0] }}"
+      when: not mon_containerized_deployment
+
+    - name: set containerized osd flags
+      command: |
+          docker exec {{ hostvars[groups.mons[0]]['ansible_hostname'] }} ceph osd set {{ item }} --cluster {{ cluster }}
+      with_items:
+        - noout
+        - noscrub
+        - nodeep-scrub
+      delegate_to: "{{ groups.mons[0] }}"
+      when: mon_containerized_deployment
 
     - name: get osd numbers
       shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi"
         name: ceph-mds@{{ ansible_hostname }}
         state: stopped
         enabled: yes
-      when: is_systemd
+      when:
+        - is_systemd
+        - not mds_containerized_deployment
 
   roles:
     - ceph-mds
         name: ceph-mds@{{ ansible_hostname }}
         state: started
         enabled: yes
-      when: is_systemd
+      when:
+        - is_systemd
+        - not mds_containerized_deployment
+
+    - name: restart ceph mdss with systemd
+      service:
+        name: ceph-mds@{{ ansible_hostname }}
+        state: restarted
+        enabled: yes
+      when:
+        - is_systemd
+        - mds_containerized_deployment
 
 
 - name: upgrade ceph rgws cluster