Honor Debug for container image prepare

We were never using Debug if ContainerImagePrepareDebug was not set.
This change adds the Debug param and updates ContainerImagePrepareDebug
to be '' by default. This makes it honor the Debug setting if
ContainerImagePrepareDebug is not configured.

Change-Id: I09b3b112d7654fed5270c0b1148b57b91b4a3215
Related-Bug: #1850934
(cherry picked from commit f70ba4bfa4)
This commit is contained in:
Alex Schultz 2019-11-01 08:51:41 -06:00
parent 61c40a7800
commit fb494f110d
1 changed files with 14 additions and 4 deletions

View File

@ -57,8 +57,12 @@ parameters:
description: Optional. Mirror to use for registry docker.io
default: ''
type: string
ContainerImagePrepareDebug:
Debug:
default: false
description: Set to True to enable debugging on all services.
type: boolean
ContainerImagePrepareDebug:
default: ''
description: Whether or not we want to activate --debug in tripleo container image prepare.
type: string
constraints:
@ -140,15 +144,21 @@ outputs:
copy:
dest: "{{ '{{' }} role_data.path {{ '}}' }}"
content: {{ roles }}
- name: debuging something
debug:
msg: |
sudo /usr/bin/tripleo-container-image-prepare \
--roles-file {{ '{{' }} role_data.path {{ '}}' }} \
--environment-file {{ '{{' }} prepare_param.path {{ '}}' }} \
--cleanup partial \
--log-file {{ '{{' }} log_file {{ '}}' }} {{ '{' }}% if container_image_prepare_debug|default(false) %{{ '}' }}--debug{{ '{' }}% endif %{{ '}' }}
- name: Run tripleo-container-image-prepare logged to {{ '{{' }} log_file {{ '}}' }}
shell: |
sudo /usr/bin/tripleo-container-image-prepare \
--roles-file {{ '{{' }} role_data.path {{ '}}' }} \
--environment-file {{ '{{' }} prepare_param.path {{ '}}' }} \
--cleanup partial \
--log-file {{ '{{' }} log_file {{ '}}' }}{{ '{' }}% if container_image_prepare_debug|default(false) %{{ '}' }} \
--debug > {{ '{{' }} log_file {{ '}}' }} 2>&1{{ '{' }}% endif %{{ '}' }}
no_log: True
--log-file {{ '{{' }} log_file {{ '}}' }} {{ '{' }}% if container_image_prepare_debug|default(false) %{{ '}' }}--debug{{ '{' }}% endif %{{ '}' }}
- name: Delete param file
file:
dest: "{{ '{{' }} prepare_param.path {{ '}}' }}"