Add the ability to write out the command being exected to a script for the roles that aren't single action list/show/remove/etc as they would not be something to rerun and are really for ansible-only control. Change-Id: I11ad3c12de21fe0522d13f966783cb413b661646
40 lines
2.0 KiB
YAML
40 lines
2.0 KiB
YAML
---
|
|
# tasks file for tripleo_container_image_push
|
|
- name: Setup container image push facts
|
|
set_fact:
|
|
_push_cmd: >-
|
|
{{ openstack_bin }} tripleo container image push
|
|
{{ tripleo_container_image_push_local | ternary('--local', '') }}
|
|
{{ tripleo_container_image_push_username | ternary('--username "$TRIPLEO_IMAGE_PUSH_USERNAME"', '') }}
|
|
{{ tripleo_container_image_push_password | ternary('--password "$TRIPLEO_IMAGE_PUSH_PASSWORD"', '') }}
|
|
{{ tripleo_container_image_push_registry_url | ternary('--registry-url $TRIPLEO_IMAGE_PUSH_REGISTRY_URL', '') }}
|
|
{{ tripleo_container_image_push_append_tag | ternary('--append-tag $TRIPLEO_IMAGE_PUSH_APPEND_TAG', '') }}
|
|
{{ tripleo_container_image_push_dry_run | ternary('--dry-run', '') }}
|
|
{{ tripleo_container_image_push_multi_arch | ternary('--multi-arch', '') }}
|
|
{{ tripleo_container_image_push_cleanup | ternary('--cleanup', '') }}
|
|
{{ tripleo_container_image_push_image }}
|
|
_push_env:
|
|
TRIPLEO_IMAGE_PUSH_APPEND_TAG: "{{ tripleo_container_image_push_append_tag | default('') }}"
|
|
TRIPLEO_IMAGE_PUSH_USERNAME: "{{ tripleo_container_image_push_username | default('') | quote }}"
|
|
TRIPLEO_IMAGE_PUSH_PASSWORD: "{{ tripleo_container_image_push_password | default('') | quote }}"
|
|
TRIPLEO_IMAGE_PUSH_REGISTRY_URL: "{{ tripleo_container_image_push_registry_url | default('') }}"
|
|
|
|
- name: Show debug information
|
|
when: tripleo_container_image_push_debug|bool
|
|
block:
|
|
- name: Show the container image push command
|
|
debug:
|
|
var: _push_cmd
|
|
- name: Show the container image push environment
|
|
debug:
|
|
var: _push_env
|
|
|
|
- name: Container image push
|
|
shell: "{{ _push_cmd }}" # noqa 305
|
|
environment: "{{ _push_env }}"
|
|
async: "{{ tripleo_container_image_push_timeout }}"
|
|
poll: 1
|
|
become: "{{ tripleo_container_image_push_become }}"
|
|
register: tripleo_container_image_push_result
|
|
changed_when: not tripleo_container_image_push_dry_run|bool
|