From 04d8002614939958b0ee964f902f2804e0cd0627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 14 Jan 2019 16:31:45 +0100 Subject: [PATCH] switch: do not fail on missing key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some people use the switch playbook to perform upgrade so they end up in the same situation than https://bugzilla.redhat.com/show_bug.cgi?id=1650572 This is applying the same fix as 729744c6a8c69f5fdf66b67fb28063297996e30a. We don't want to fail on key that are not present since they will get created after the mons are updated. They will be created by the task "create potentially missing keys (rbd and rbd-mirror)". Signed-off-by: Sébastien Han --- group_vars/all.yml.sample | 4 ++++ group_vars/rhcs.yml.sample | 4 ++++ ...h-from-non-containerized-to-containerized-ceph-daemons.yml | 4 ++++ roles/ceph-defaults/defaults/main.yml | 4 ++++ roles/ceph-mon/tasks/docker/fetch_configs.yml | 2 +- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index caa5a842c..361432808 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -565,6 +565,10 @@ dummy: # do not ever change this here #rolling_update: false +# this is only here for usage with the switch-from-non-containerized-to-containerized-ceph-daemons.yml playbook +# do not ever change this here +#switch_to_container: false + ##################### # Docker pull retry # ##################### diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index a2c6c1755..314576ca7 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -565,6 +565,10 @@ ceph_docker_registry: "registry.access.redhat.com/rhceph/" # do not ever change this here #rolling_update: false +# this is only here for usage with the switch-from-non-containerized-to-containerized-ceph-daemons.yml playbook +# do not ever change this here +#switch_to_container: false + ##################### # Docker pull retry # ##################### diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 126739624..2dcff570d 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -62,6 +62,10 @@ become: true pre_tasks: + - name: set_fact switch_to_container to indicate that we run a special playbook + set_fact: + switch_to_container: True + - name: select a running monitor set_fact: mon_host={{ item }} with_items: "{{ groups[mon_group_name] }}" diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index c39bf33c6..9910aed7d 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -557,6 +557,10 @@ kv_port: 2379 # do not ever change this here rolling_update: false +# this is only here for usage with the switch-from-non-containerized-to-containerized-ceph-daemons.yml playbook +# do not ever change this here +switch_to_container: false + ##################### # Docker pull retry # ##################### diff --git a/roles/ceph-mon/tasks/docker/fetch_configs.yml b/roles/ceph-mon/tasks/docker/fetch_configs.yml index a1433e5e3..27b80c2ab 100644 --- a/roles/ceph-mon/tasks/docker/fetch_configs.yml +++ b/roles/ceph-mon/tasks/docker/fetch_configs.yml @@ -4,7 +4,7 @@ src: "{{ item.0 }}" dest: "{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}" flat: yes - fail_on_missing: "{{ 'no' if rolling_update else 'yes' }}" + fail_on_missing: "{{ 'no' if rolling_update or switch_to_container else 'yes' }}" with_together: - "{{ ceph_config_keys }}" - "{{ statconfig.results }}"