Skip to content

Commit

Permalink
Add block and task to revoke Openshift token in aap_ocp_install role (#…
Browse files Browse the repository at this point in the history
…194)

* Add block and task to revoke Openshift token

* Add new line at the end of file
  • Loading branch information
rev3r4nt authored Sep 12, 2023
1 parent bdc76b0 commit 7890a0b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 27 deletions.
11 changes: 11 additions & 0 deletions roles/aap_ocp_install/tasks/finalization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: "If login succeeded revoke OpenShift API token"
when: __aap_ocp_install_auth_results['openshift_auth']['api_key'] is defined
# Disabling check for FQCN on module names as using either community.okd or redhat.openshift collection is able to be used
openshift_auth: # noqa fqcn[action]
host: "{{ aap_ocp_install_connection['host'] | mandatory }}"
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}"
state: absent
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}"
changed_when: false
...
69 changes: 42 additions & 27 deletions roles/aap_ocp_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,57 @@
tags:
- always

- name: Include OpenShift initialization tasks
ansible.builtin.include_tasks:
file: initialization.yml
apply:
- name: "Openshift deployment tasks"
block:

- name: Include OpenShift initialization tasks
ansible.builtin.include_tasks:
file: initialization.yml
apply:
tags:
- always
tags:
- always
tags:
- always

- name: Include Ansible Automation Platform operator install tasks
ansible.builtin.include_tasks:
file: install-operator.yml
apply:
- name: Include Ansible Automation Platform operator install tasks
ansible.builtin.include_tasks:
file: install-operator.yml
apply:
tags:
- operator
when: aap_ocp_install_operator is defined
tags:
- operator
when: aap_ocp_install_operator is defined
tags:
- operator

- name: Include Ansible Automation Platform controller install tasks
ansible.builtin.include_tasks:
file: install-controller.yml
apply:
- name: Include Ansible Automation Platform controller install tasks
ansible.builtin.include_tasks:
file: install-controller.yml
apply:
tags:
- controller
when: aap_ocp_install_controller is defined
tags:
- controller
when: aap_ocp_install_controller is defined
tags:
- controller

- name: Include Ansible Automation Platform hub install tasks
ansible.builtin.include_tasks:
file: install-hub.yml
apply:
- name: Include Ansible Automation Platform hub install tasks
ansible.builtin.include_tasks:
file: install-hub.yml
apply:
tags:
- hub
when: aap_ocp_install_hub is defined
tags:
- hub
when: aap_ocp_install_hub is defined
tags:
- hub

always:

- name: Include OpenShift finalization tasks
ansible.builtin.include_tasks:
file: finalization.yml
apply:
tags:
- always
tags:
- always

...

0 comments on commit 7890a0b

Please sign in to comment.