tripleo-operator-ansible/roles/tripleo_container_image_show/tasks/main.yml

37 lines
1.4 KiB
YAML

---
# tasks file for tripleo_container_image_show
- name: Setup container image show facts
set_fact:
_show_cmd: >-
{{ openstack_bin }} tripleo container image show
{{ tripleo_container_image_show_username | ternary('--username "$TRIPLEO_IMAGE_SHOW_USERNAME"', '') }}
{{ tripleo_container_image_show_password | ternary('--password "$TRIPLEO_IMAGE_SHOW_PASSWORD"', '') }}
{{ tripleo_container_image_show_format | ternary('-f $TRIPLEO_IMAGE_SHOW_FORMAT', '') }}
{{ tripleo_container_image_show_image }}
_show_env:
TRIPLEO_IMAGE_SHOW_USERNAME: "{{ tripleo_container_image_show_username | default('') | quote }}"
TRIPLEO_IMAGE_SHOW_PASSWORD: "{{ tripleo_container_image_show_password | default('') | quote }}"
TRIPLEO_IMAGE_SHOW_FORMAT: "{{ tripleo_container_image_show_format | default('') }}"
- name: Show debug information
when: tripleo_container_image_show_debug|bool
block:
- name: Show the container image show command
debug:
var: _show_cmd
- name: Show the container image show environment
debug:
var: _show_env
- name: Container image show
shell: "{{ _show_cmd }}" # noqa 305
environment: "{{ _show_env }}"
register: tripleo_container_image_show_result
changed_when: false
- name: Set output fact
when:
- tripleo_container_image_show_result.stdout is defined
set_fact:
tripleo_container_image_show_output: "{{ tripleo_container_image_show_result.stdout }}"