Introduce ContainerImagePrepareDebug parameter

Set to false by default for backward compatibility, we can set it to
True and it'll add --debug when running the tripleo container image
prepare command, useful to have more verbosity.

Change-Id: I7d0b4035de748bf2453321d3ab09d09fd45abf8d
This commit is contained in:
Emilien Macchi 2019-02-13 10:47:01 -05:00
parent 9689f6ed06
commit cb4ed31eaf
3 changed files with 23 additions and 1 deletions

View File

@ -57,6 +57,10 @@ parameters:
description: Optional. Mirror to use for registry docker.io
default: ''
type: string
ContainerImagePrepareDebug:
default: false
description: Whether or not we want to activate --debug in tripleo container image prepare.
type: boolean
{% for role in roles %}
# Parameters generated for {{role.name}} Role
@ -84,6 +88,7 @@ outputs:
block:
- set_fact:
log_file: {get_param: ContainerImagePrepareLogFile}
container_image_prepare_debug: {get_param: ContainerImagePrepareDebug}
- name: Create temp file for prepare parameter
tempfile:
state: file
@ -114,7 +119,13 @@ outputs:
dest: "{{ '{{' }} role_data.path {{ '}}' }}"
content: {{ roles }}
- 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 {{ '}}' }}
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{{ '{' }}% endif %{{ '}' }}
no_log: True
- name: Delete param file
file:

View File

@ -0,0 +1,5 @@
# A Heat environment file which can be used to enable container image prepare
# debugging
parameter_defaults:
ContainerImagePrepareDebug: true

View File

@ -0,0 +1,6 @@
---
features:
- |
ContainerImagePrepareDebug is a parameter that allows to run the tripleo
container image prepare command with --debug. It is set to 'False' by default
for backward compatibility.