]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
add-osd: unset noup flag after last osd is deployed
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 7 Apr 2020 09:16:25 +0000 (11:16 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 7 Apr 2020 15:19:53 +0000 (11:19 -0400)
this commit fixes a bug when using `add-osd.yml` playbook.
`noup` flag is set early but it never got unset before the "wait for pgs
clean" check, so the playbook always fails because OSDs aren't never
seen UP.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1816023
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-handler/handlers/main.yml
roles/ceph-osd/tasks/main.yml

index 17c44b682ad715082fe60c1e5f3f188e16c9cfa6..3e2fd037f9e356b9957db9e10d405c14524be41a 100644 (file)
@@ -5,6 +5,11 @@
   when:
     - ansible_os_family == 'Debian'
 
+- name: unset noup flag
+  command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  changed_when: False
+
 # We only want to restart on hosts that have called the handler.
 # This var is set when he handler is called, and unset after the
 # restart to ensure only the correct hosts are restarted.
index d202a2d647450f3726392673827d7ad9c0f758fe..961ae006f5aa8dab95c6ed62699e26f302a02562 100644 (file)
 - name: include_tasks common.yml
   include_tasks: common.yml
 
+- name: set noup flag
+  command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set noup"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  run_once: True
+  changed_when: False
+  when: not rolling_update | default(False) | bool
+
 - name: include ceph_disk_cli_options_facts.yml
   include_tasks: ceph_disk_cli_options_facts.yml
 
 - name: include_tasks start_osds.yml
   include_tasks: start_osds.yml
 
+- name: unset noup flag
+  command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  changed_when: False
+  when:
+    - not rolling_update | default(False) | bool
+    - inventory_hostname == ansible_play_hosts_all | last
+
 - name: wait for all osd to be up
   command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} -s -f json"
   register: wait_for_all_osds_up
   until:
     - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_osds"] | int > 0
     - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_up_osds"]
+  when:
+    - inventory_hostname == ansible_play_hosts_all | last
 
 - name: include crush_rules.yml
   include_tasks: crush_rules.yml