From 378c292104a21eeed1fdba8bffa0856bae99e939 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 27 May 2020 11:40:47 +0200 Subject: [PATCH] Properly control debug logs for standalone 'openstack tripleo deploy' should be invoked with --debug in order to display events from ansible would be hidden with no_log otherwise: no_log: "{{ not ((ansible_verbosity | int) >= 2) | bool }}" And ansible_verbosity in tripleoclient only gets >=2 whenever the openstack cliff's app.options.debug=True or app_args.verbose_level > 1. Add tripleo_deploy_debug_arg to control that. It is defaults to False. Depends-On: https://review.opendev.org/730883 Change-Id: I1464d895d579d83955e968413741aac80b9af0f0 Signed-off-by: Bogdan Dobrelya --- roles/tripleo_deploy/README.md | 1 + roles/tripleo_deploy/defaults/main.yml | 1 + .../tripleo_deploy/molecule/default/converge.yml | 16 ++++++++++++++++ roles/tripleo_deploy/tasks/main.yml | 1 + 4 files changed, 19 insertions(+) diff --git a/roles/tripleo_deploy/README.md b/roles/tripleo_deploy/README.md index c4dcdc2..8ef4440 100644 --- a/roles/tripleo_deploy/README.md +++ b/roles/tripleo_deploy/README.md @@ -15,6 +15,7 @@ Role Variables * `tripleo_deploy_cleanup`: (Boolean) Cleanup temporary files after execution. Default: false * `tripleo_deploy_control_virtual_ip`: (String) Control plain VIP address. * `tripleo_deploy_debug`: (Boolean) Flag to print out the command that is run. Default: false +* `tripleo_deploy_debug_arg`: (Boolean) Flag for ansible to use -vv. Default: false * `tripleo_deploy_generate_scripts`: (Boolean) Write out a shell script that can be used to reproduce the command being executed. By default uses the value of `tripleo_generate_scripts` or False if `tripleo_generate_scripts` is not defined. * `tripleo_deploy_generate_scripts_only`: (Boolean) Do not run the actual command - to be used in conjonction with `tripleo_deploy_generate_scripts`. By default uses the value of `tripleo_generate_scripts_only` or False if `tripleo_generate_scripts_only` is not defined. * `tripleo_deploy_deployment_python_interpreter`: (String) Path to a python interpreter for the deployment actions. diff --git a/roles/tripleo_deploy/defaults/main.yml b/roles/tripleo_deploy/defaults/main.yml index d00cc97..1cf5290 100644 --- a/roles/tripleo_deploy/defaults/main.yml +++ b/roles/tripleo_deploy/defaults/main.yml @@ -5,6 +5,7 @@ tripleo_deploy_become: true tripleo_deploy_cleanup: false tripleo_deploy_control_virtual_ip: tripleo_deploy_debug: false +tripleo_deploy_debug_arg: false tripleo_deploy_deployment_python_interpreter: tripleo_deploy_deployment_user: "{{ ansible_env.USER }}" tripleo_deploy_environment_files: [] diff --git a/roles/tripleo_deploy/molecule/default/converge.yml b/roles/tripleo_deploy/molecule/default/converge.yml index ce80ad5..517bb44 100644 --- a/roles/tripleo_deploy/molecule/default/converge.yml +++ b/roles/tripleo_deploy/molecule/default/converge.yml @@ -385,3 +385,19 @@ assert: that: - tripleo_deploy_output == "tripleo deploy --local-ip 192.168.24.2/24 --force-stack-update" + + - name: Check parameter "tripleo_deploy_debug_arg" + include_role: + name: "tripleo_deploy" + vars: + tripleo_deploy_templates: + tripleo_deploy_stack: + tripleo_deploy_standalone: false + tripleo_deploy_standalone_role: + tripleo_deploy_timeout_arg: + tripleo_deploy_debug_arg: true + + - name: Assert "tripleo_deploy_debug_arg" + assert: + that: + - tripleo_deploy_output == "tripleo deploy --debug --local-ip 192.168.24.2/24" diff --git a/roles/tripleo_deploy/tasks/main.yml b/roles/tripleo_deploy/tasks/main.yml index faed3af..f9bb784 100644 --- a/roles/tripleo_deploy/tasks/main.yml +++ b/roles/tripleo_deploy/tasks/main.yml @@ -9,6 +9,7 @@ set_fact: _deploy_cmd: >- {{ openstack_bin }} tripleo deploy + {{ tripleo_deploy_debug_arg | ternary('--debug', '') }} {{ tripleo_deploy_templates | ternary('--templates $DEPLOY_TEMPLATES', '') }} {{ tripleo_deploy_standalone | ternary('--standalone', '') }} {{ tripleo_deploy_upgrade | ternary('--upgrade', '') }}