From 0ba5cfa943f7b1572a5b27ecbc40c45cc533f633 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 3 Jul 2020 09:28:21 +0200 Subject: [PATCH] FFU support for ceph_nfs This change introduces the steps needed to dump the set of playbook used to perform the ceph-nfs update. Depends-On: I89c848bdae1b997b38a5164302acdcca94619471 Change-Id: I45e72bb598ef2157531919173e94ab36eb98ad16 (cherry picked from commit 4354d8ed00e23a5f132ed957ed05e975df03e610) --- deployment/ceph-ansible/ceph-nfs.yaml | 46 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/deployment/ceph-ansible/ceph-nfs.yaml b/deployment/ceph-ansible/ceph-nfs.yaml index 7c5df1fe12..9dccbbbb65 100644 --- a/deployment/ceph-ansible/ceph-nfs.yaml +++ b/deployment/ceph-ansible/ceph-nfs.yaml @@ -66,8 +66,50 @@ outputs: description: Role data for the Ceph NFS Ganesha service. value: service_name: ceph_nfs - upgrade_tasks: [] - step_config: 'include ::tripleo::profile::pacemaker::ceph_nfs' + upgrade_tasks: + - name: Create hiera data to upgrade ceph_nfs in a stepwise manner. + when: + - step|int == 1 + - cluster_recreate|bool + block: + - name: set ceph_nfs upgrade node facts in a single-node environment + set_fact: + ceph_nfs_short_node_names_upgraded: "{{ ceph_nfs_short_node_names }}" + cacheable: no + when: groups['ceph_nfs'] | length <= 1 + - name: set ceph_nfs upgrade node facts from the limit option + set_fact: + ceph_nfs_short_node_names_upgraded: "{{ ceph_nfs_short_node_names_upgraded|default([]) + [item.split('.')[0]] }}" + cacheable: no + when: + - groups['ceph_nfs'] | length > 1 + - item.split('.')[0] in ansible_limit.split(':') + loop: "{{ ceph_nfs_short_node_names | default([]) }}" + - fail: + msg: > + You can't upgrade ceph_nfs without staged + upgrade. You need to use the limit option in order + to do so. + when: >- + ceph_nfs_short_node_names_upgraded is not defined or + ceph_nfs_short_node_names_upgraded | length == 0 + - debug: + msg: "Prepare ceph_nfs upgrade for {{ ceph_nfs_short_node_names_upgraded }}" + - name: add the ceph_nfs short name to hiera data for the upgrade. + include_role: + name: tripleo_upgrade_hiera + tasks_from: set.yml + vars: + tripleo_upgrade_key: ceph_nfs_short_node_names_override + tripleo_upgrade_value: "{{ceph_nfs_short_node_names_upgraded}}" + - name: remove the extra hiera data needed for the upgrade. + include_role: + name: tripleo_upgrade_hiera + tasks_from: remove.yml + vars: + tripleo_upgrade_key: ceph_nfs_short_node_names_override + when: ceph_nfs_short_node_names_upgraded | length == ceph_nfs_short_node_names | length + step_config: 'include tripleo::profile::pacemaker::ceph_nfs' puppet_config: config_image: '' config_volume: ''