Files
tripleo-operator-ansible/roles/tripleo_container_image_prepare_default/tasks/main.yml
Cédric Jeanneret 7ae7c668ed Ensure we export result only if we have an stdout
I841743fb6c2c24e4a3d86598f99322022b27804d introduced a sort of "dry-run"
capability to the operators, but it didn't take care of the possible
exposure of the shell stdout in a fact. Thus, if you enabled the
generate_scripts_only feature, your ansible run would fail on the
exposure, since the variable it refers to will not exist.

Change-Id: I07225e6b82199cf15860e55db6995c994da65931
2020-05-15 15:43:20 +02:00

27 lines
1.1 KiB
YAML

---
# tasks file for tripleo_container_image_prepare_default
- name: Setup container image prepare default facts
set_fact:
_prepare_cmd: >-
{{ openstack_bin }} tripleo container image prepare default
{{ tripleo_container_image_prepare_default_output_env_file | ternary('--output-env-file '
~ tripleo_container_image_prepare_default_output_env_file, '') }}
{{ tripleo_container_image_prepare_default_local_push_destination | ternary('--local-push-destination', '') }}
{{ tripleo_container_image_prepare_default_enable_registry_login | ternary('--enable-registry-login', '') }}
- name: Show the container image prepare default command
debug:
var: _prepare_cmd
when: tripleo_container_image_prepare_default_debug|bool
- name: Container image prepare default
shell: "{{ _prepare_cmd }}" # noqa 305
register: tripleo_container_image_prepare_default_result
changed_when: true
- name: Set output variable
when:
- tripleo_container_image_prepare_default_result.stdout is defined
set_fact:
tripleo_container_image_prepare_default_output: "{{ tripleo_container_image_prepare_default_result.stdout }}"