]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-facts: only get fsid when monitor are present v4.0.31
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 10 Sep 2020 14:12:13 +0000 (10:12 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 10 Sep 2020 21:42:28 +0000 (17:42 -0400)
When running the rolling_update playbook with an inventory without
monitor nodes defined (like external scenario) then we can't retrieve
the cluster fsid from the running monitor.
In this scenario we have to pass this information manually (group_vars
or host_vars).

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1877426
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit f63022dfec701dadc28359b1a4978f8a7ab00e03)

infrastructure-playbooks/rolling_update.yml
roles/ceph-facts/tasks/facts.yml
tox-external_clients.ini

index 4dc9ee6c12a2ba526b68ea191ffa5142bfd9209d..b401fbecf9118f19b68c058bfd1ffb0e306efb8d 100644 (file)
       command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release nautilus"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: containerized_deployment | bool
+      when:
+        - containerized_deployment | bool
+        - groups.get(mon_group_name, []) | length > 0
 
     - name: non container | disallow pre-nautilus OSDs and enable all new nautilus-only functionality
       command: "ceph --cluster {{ cluster }} osd require-osd-release nautilus"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: not containerized_deployment | bool
+      when:
+        - not containerized_deployment | bool
+        - groups.get(mon_group_name, []) | length > 0
 
     - name: container | enable msgr2 protocol
       command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} mon enable-msgr2"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: containerized_deployment | bool
+      when:
+        - containerized_deployment | bool
+        - groups.get(mon_group_name, []) | length > 0
 
     - name: non container | enable msgr2 protocol
       command: "ceph --cluster {{ cluster }} mon enable-msgr2"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: not containerized_deployment | bool
+      when:
+        - not containerized_deployment | bool
+        - groups.get(mon_group_name, []) | length > 0
 
     - import_role:
         name: ceph-handler
index be40bc477556ce668c3803d9f06ece801957eff0..19fa21d8b9bf4f24a7fcd6403e9ca59137e463dd 100644 (file)
   register: rolling_update_fsid
   delegate_to: "{{ mon_host | default(groups[mon_group_name][0]) }}"
   until: rolling_update_fsid is succeeded
-  when: rolling_update | bool
+  when:
+    - rolling_update | bool
+    - groups.get(mon_group_name, []) | length > 0
 
 - name: set_fact fsid
   set_fact:
     fsid: "{{ (rolling_update_fsid.stdout | from_json).fsid }}"
-  when: rolling_update | bool
+  when:
+    - rolling_update | bool
+    - groups.get(mon_group_name, []) | length > 0
 
 - name: set_fact ceph_current_status (convert to json)
   set_fact:
index 3dd70b626d5e85915d1713d1ab7b4918d2f58042..68511c923bca4770995dc33bc8146a66176453e2 100644 (file)
@@ -63,4 +63,18 @@ commands=
 
   bash -c "CEPH_STABLE_RELEASE=nautilus py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/inventory/external_clients-hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests/test_install.py::TestCephConf"
 
+  ansible-playbook -vv -i {changedir}/inventory/external_clients-hosts {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\
+      ireallymeanit=yes \
+      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
+      fsid=40358a87-ab6e-4bdc-83db-1d909147861c \
+      external_cluster_mon_ips=192.168.31.10,192.168.31.11,192.168.31.12 \
+      generate_fsid=false \
+      ceph_stable_release=nautilus \
+      ceph_docker_registry_auth=True \
+      ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
+      ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
+  "
+
+  bash -c "CEPH_STABLE_RELEASE=nautilus py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/inventory/external_clients-hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests/test_install.py::TestCephConf"
+
   vagrant destroy --force