Skip to content

Commit

Permalink
#820 Ensure Ansible fails of apply global pull secret fails
Browse files Browse the repository at this point in the history
  • Loading branch information
fketelaars committed Oct 30, 2024
1 parent fc70d36 commit 9283f27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
- name: Generate add-icr-cred-to-global-pull-secret command to set global pull secret for entitled registry
set_fact:
_add_icr_cred_globl_pull_secret_command: "{{ lookup('template','add-icr-cred-to-global-pull-secret.j2') }} "
_add_icr_cred_global_pull_secret_command: "{{ lookup('template','add-icr-cred-to-global-pull-secret.j2') }} "

- include_role:
name: log-deployer-activity
vars:
_p_activity_description: "Set global pull secret for entitled registry"
_p_activity_command: "{{ _add_icr_cred_globl_pull_secret_command }}"
_p_activity_command: "{{ _add_icr_cred_global_pull_secret_command }}"

- name: Set global pull secret for entitled registry, output is in {{ status_dir }}/log/add-icr-cred-to-global-pull-secret.log
shell: |
{{ _add_icr_cred_globl_pull_secret_command }} | tee -a {{ status_dir }}/log/add-icr-cred-to-global-pull-secret.log
set -o pipefail
{{ _add_icr_cred_global_pull_secret_command }} | tee -a {{ status_dir }}/log/add-icr-cred-to-global-pull-secret.log
when: not cpd_dry_run
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@

- name: Generate add-cred-to-global-pull-secret command to set global pull secret for private registry {{ _p_registry_url }}
set_fact:
_add_cred_globl_pull_secret_command: "{{ lookup('template','add-cred-to-global-pull-secret.j2') }} "
_add_cred_global_pull_secret_command: "{{ lookup('template','add-cred-to-global-pull-secret.j2') }} "

- include_role:
name: log-deployer-activity
vars:
_p_activity_description: "Set global pull secret for private registry {{ _p_registry_url }}"
_p_activity_command: "{{ _add_cred_globl_pull_secret_command }}"
_p_activity_command: "{{ _aadd_cred_globl_pull_secret_command }}"

- name: Set global pull secret for private registry {{ _p_registry_url }}, output is in {{ status_dir }}/log/add-cred-to-global-pull-secret.log
shell: |
{{ _add_cred_globl_pull_secret_command }} | tee -a {{ status_dir }}/log/add-cred-to-global-pull-secret.log
set -o pipefail
{{ _aadd_cred_globl_pull_secret_command }} | tee -a {{ status_dir }}/log/add-cred-to-global-pull-secret.log
when: not cpd_dry_run

0 comments on commit 9283f27

Please sign in to comment.