This reverts commit 80106333b0.
This incorrectly breaks the output so the 2>&1 is on a
separate line which eats failures.
Change-Id: I70aa6775ce6795e8302523079a0db7933aa87693
59 lines
2.1 KiB
YAML
59 lines
2.1 KiB
YAML
---
|
|
# tasks file for tripleo_overcloud_credentials
|
|
- name: CHANGEME
|
|
set_fact:
|
|
_creds_cmd: >-
|
|
{{ tripleo_overcloud_credentials_os_cloud | ternary('', "source " ~ tripleo_overcloud_credentials_rc_file ~ "; ") }}
|
|
{{ openstack_bin }} overcloud credentials
|
|
{{ tripleo_overcloud_credentials_directory | ternary('--directory $CREDENTIALS_DIR', '') }}
|
|
{{ tripleo_overcloud_credentials_plan }}
|
|
{{ tripleo_overcloud_credentials_log_output | ternary((">" ~ tripleo_overcloud_credentials_log), '') }}
|
|
{{ tripleo_overcloud_credentials_log_combine | ternary("2>&1", '') }}
|
|
_creds_env:
|
|
CREDENTIALS_DIR: "{{ tripleo_overcloud_credentials_directory }}"
|
|
OS_CLOUD: "{{ tripleo_overcloud_credentials_os_cloud }}"
|
|
|
|
- name: Preserve existing log file if exists
|
|
timestamp_file:
|
|
path: "{{ tripleo_overcloud_credentials_log }}"
|
|
when: tripleo_overcloud_credentials_log_output|bool
|
|
|
|
- name: Show debug information
|
|
when: tripleo_overcloud_credentials_debug|bool
|
|
block:
|
|
- name: Show the command
|
|
debug:
|
|
var: _creds_cmd
|
|
|
|
- name: Show the environment
|
|
debug:
|
|
var: _creds_env
|
|
|
|
- name: Write reproducer script
|
|
tripleo_shell_script:
|
|
dest: "{{ tripleo_overcloud_credentials_home_dir }}/tripleo_overcloud_credentials.sh"
|
|
shell_command: "{{ _creds_cmd }}"
|
|
shell_environment: "{{ _creds_env }}"
|
|
when: tripleo_overcloud_credentials_generate_scripts|bool
|
|
|
|
- name: CHANGEME
|
|
shell: "{{ _creds_cmd }}" # noqa 305
|
|
environment: "{{ _creds_env }}"
|
|
args:
|
|
executable: /bin/bash
|
|
chdir: "{{ tripleo_overcloud_credentials_home_dir }}"
|
|
warn: false
|
|
register: tripleo_overcloud_credentials_result
|
|
async: "{{ tripleo_overcloud_credentials_timeout }}"
|
|
poll: "{{ tripleo_overcloud_credentials_poll }}"
|
|
changed_when: false
|
|
when:
|
|
- not ansible_check_mode|bool
|
|
- not tripleo_overcloud_credentials_generate_scripts_only|bool
|
|
|
|
- name: Set output fact
|
|
when:
|
|
- tripleo_overcloud_credentials_result.stdout is defined
|
|
set_fact:
|
|
tripleo_overcloud_credentials_output: "{{ tripleo_overcloud_credentials_result.stdout }}"
|