Skip to content

Commit d56a76b

Browse files
vvaldezVinny Valdez
andauthored
Add validation task for API key (#302)
* Add validation task for API key * Fix linting error * Add changelog fragment * Fix lint error * Update broken link in README --------- Co-authored-by: Vinny Valdez <vvaldez@redhatcom>
1 parent b1b3e27 commit d56a76b

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Red Hat Communities of Practice Ansible Automation Platform Utilities Collection
22

33
[![pre-commit tests](https://github.com/redhat-cop/aap_utilities/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/redhat-cop/aap_utilities/actions/workflows/pre-commit.yml)
4-
[![Galaxy Release](https://github.com/redhat-cop/aap_utilities/actions/workflows/release.yml/badge.svg)](https://github.com/redhat-cop/aap_utilities/actions/workflows/release.yml)
4+
[![Galaxy Release](https://github.com/redhat-cop/aap_utilities/actions/workflows/release_auto.yml/badge.svg)%5D(https://github.com/redhat-cop/aap_utilities/actions/workflows/release_auto.yml)
55

66
This ansible collection includes a number of roles which can be useful for installing Ansible Automation Platform.
77
Using this collection, you'll be able to automate following tasks:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- Adds task to validate connection to OpenShift before proceeding

roles/aap_ocp_install/tasks/initialization.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}"
1818
when: aap_ocp_install_connection['api_key'] is defined
1919

20+
- name: Include validate-connection tasks
21+
ansible.builtin.include_tasks:
22+
file: validate-connection.yml
23+
apply:
24+
tags:
25+
- always
26+
tags:
27+
- always
28+
2029
- name: Create namespace
2130
when: aap_ocp_install_create_namespace | default(true) | bool
2231
kubernetes.core.k8s:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Validate OpenShift API key
3+
ansible.builtin.uri:
4+
url: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}/version"
5+
method: GET
6+
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}"
7+
headers:
8+
Authorization: Bearer {{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}
9+
10+
...

0 commit comments

Comments
 (0)