From a56157f64b7455dbae4118f669e476c1cbd929a5 Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Thu, 26 Mar 2020 21:10:16 +0530 Subject: [PATCH] Don't rotate passwords when updating plan If the passwods exist we should not update those when updating plan. Change-Id: Iaa7b3d3e24f05bdb66a0aba42ff3be897500735c Closes-Bug: #1869010 --- .../ansible_plugins/modules/tripleo_passwords_rotate.py | 8 +++++++- tripleo_ansible/playbooks/cli-update-deployment-plan.yaml | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/ansible_plugins/modules/tripleo_passwords_rotate.py b/tripleo_ansible/ansible_plugins/modules/tripleo_passwords_rotate.py index 9b79dd916..7dcfb4d96 100644 --- a/tripleo_ansible/ansible_plugins/modules/tripleo_passwords_rotate.py +++ b/tripleo_ansible/ansible_plugins/modules/tripleo_passwords_rotate.py @@ -59,6 +59,10 @@ options: description: - Overcloud plan container name default: overcloud + rotate_passwords: + description: flag for rotate passwords or not + default: true + type: bool password_list: description: - Password list to be rotated @@ -73,6 +77,7 @@ EXAMPLES = ''' - name: Rotate passwords and update plan tripleo_password_rotate: container: overcloud + rotate_passwords: true password_list: [] ''' @@ -119,6 +124,7 @@ def run_module(): try: container = module.params.get('container') + rotate_passwords = module.params.get('rotate_passwords') password_list = module.params.get('password_list') _, conn = openstack_cloud_from_module(module) session = conn.session @@ -134,7 +140,7 @@ def run_module(): mistral = get_workflow_client(mistral_url, session) rotated_passwords = plan_utils.generate_passwords( swift, heat, mistral, container, - rotate_passwords=True, + rotate_passwords=rotate_passwords, rotate_pw_list=password_list) result['success'] = True result['passwords'] = rotated_passwords diff --git a/tripleo_ansible/playbooks/cli-update-deployment-plan.yaml b/tripleo_ansible/playbooks/cli-update-deployment-plan.yaml index 2728b3675..bb1e9f953 100644 --- a/tripleo_ansible/playbooks/cli-update-deployment-plan.yaml +++ b/tripleo_ansible/playbooks/cli-update-deployment-plan.yaml @@ -59,9 +59,10 @@ when: source_url is not none - - name: Generate passwords and update plan + - name: Generate passwords if does not exist and update plan tripleo_passwords_rotate: container: "{{ container }}" + rotate_passwords: false when: generate_passwords|bool - name: Prepare Container images and update plan