From 4aad247b201b133d823f0a73e4d167f160dd4e00 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 14 Apr 2022 18:05:55 +0200 Subject: [PATCH] Allow to run cinder role in check mode Always fetch config files as it's treated as safe operation. On top of that handle case when there's no local config specified. Change-Id: I5f5f36da96672679d6801c2a52c58d86657ca612 --- tasks/cinder_install_source.yml | 1 + tasks/cinder_post_install.yml | 1 + tasks/main.yml | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tasks/cinder_install_source.yml b/tasks/cinder_install_source.yml index 49940c11..75775176 100644 --- a/tasks/cinder_install_source.yml +++ b/tasks/cinder_install_source.yml @@ -42,6 +42,7 @@ src: "{{ cinder_bin | dirname }}/etc/os-brick/rootwrap.d/os-brick.filters" dest: /etc/cinder/rootwrap.d/os-brick.filters state: link + ignore_errors: "{{ ansible_check_mode }}" - name: Copy cinder rootwrap filters command: >- diff --git a/tasks/cinder_post_install.yml b/tasks/cinder_post_install.yml index 1c72fbbd..c2a84d9b 100644 --- a/tasks/cinder_post_install.yml +++ b/tasks/cinder_post_install.yml @@ -103,6 +103,7 @@ changed_when: false with_items: "{{ cinder_core_files }}" run_once: true + check_mode: false - name: Copy common config openstack.config_template.config_template: diff --git a/tasks/main.yml b/tasks/main.yml index 94adcd99..03e86a2d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -109,11 +109,17 @@ tags: - cinder-config -- import_tasks: cinder_cleanup_old_facts.yml +- include_tasks: cinder_cleanup_old_facts.yml + args: + apply: + tags: + - cinder-config when: + - "'openstack_ansible' in ansible_local" + - "'cinder' in ansible_local['openstack_ansible']" - "'need_db_sync' in ansible_local['openstack_ansible']['cinder']" tags: - - cinder-config + - always - import_tasks: cinder_post_install.yml tags: