-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new platform installation method of AAP 2.5 on OpenSh…
…ift (#261) * Add EDA deployment on OCP * Update documentation for role change * Additional checks for EDA variables, and ability to use custom EDA namespace * Correct linting formatting errors * Add endline on changelog fragment * Modifications to support the new OCP deployment method for AAP 2.5 * Template fixes identified during testing * Make the AAP OCP Deployment backward compatible with pre AAP2.5 * Restore missing files * Ensure Hub settings are correct * Update documentation for OCP Installation AAP 2.5+ * Corrected trailing whitespace and line feed errors * Remove duplication in yml file * Pre-commit fixes (EOF and github-actions-bot changes) * Fix Jinja templating errors * Revert galaxy version definition * - Allow installation of cluster-scoped AAP into a different namespace - Wait until controller/eda/hub APIs are available before marking installation complete * Update documentation to show 2.4- and 2.5+ example playbooks * Changes from PR code review * Ensure new install keys are used for component installation, and the correct hub API is tested * Correct Lightspeed deployment setting in AAP 2.5 OCP install * Amended README to include platform options for namespace and link text --------- Co-authored-by: Derek Waters <[email protected]> Co-authored-by: Brant Evans <[email protected]>
- Loading branch information
1 parent
84df647
commit 042585f
Showing
9 changed files
with
587 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- Added support to allow installation of AAP 2.5 using the new platform operator method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
--- | ||
- name: Create platform namespace | ||
kubernetes.core.k8s: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
state: present | ||
resource_definition: "{{ lookup('ansible.builtin.template', 'namespace.yaml.j2', template_vars=ns_vars) | from_yaml }}" | ||
apply: true | ||
vars: | ||
ns_vars: | ||
ns_name: "{{ aap_ocp_install_platform['namespace'] }}" | ||
when: | ||
- aap_ocp_install_platform['namespace'] is defined | ||
|
||
- name: Create automation platform instance | ||
kubernetes.core.k8s: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
state: present | ||
resource_definition: "{{ lookup('template', 'platform/instance.yaml.j2') | from_yaml }}" | ||
apply: true | ||
|
||
- name: Wait for operator to create the automation platform route | ||
kubernetes.core.k8s_info: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
kind: Route | ||
name: "{{ aap_ocp_install_platform['instance_name'] | mandatory }}" | ||
api_version: route.openshift.io/v1 | ||
namespace: "{{ aap_ocp_install_platform['namespace'] | default(aap_ocp_install_namespace) | mandatory }}" | ||
register: __aap_ocp_install_platform_route_result | ||
until: __aap_ocp_install_platform_route_result['resources'] | ||
retries: 60 # Wait for 15 minutes (60*15/60) | ||
delay: 15 | ||
|
||
- name: Store automation platform route | ||
ansible.builtin.set_fact: | ||
__aap_ocp_install_platform_route: "{{ __aap_ocp_install_platform_route_result['resources'][0]['status']['ingress'][0]['host'] }}" | ||
|
||
- name: Ensure automation platform login is available | ||
ansible.builtin.uri: | ||
url: "https://{{ __aap_ocp_install_platform_route }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
method: GET | ||
status_code: | ||
- 200 | ||
register: _aap_ocp_install_platform_available | ||
until: (_aap_ocp_install_platform_available['status'] == 200) and ('migrations_notran' not in _aap_ocp_install_platform_available['url']) | ||
retries: 120 # Wait for 30 minutes (120*15/60) | ||
delay: 15 | ||
|
||
# Ensure that all of the platform components are also available | ||
- name: Wait for operator to create the automation controller route | ||
kubernetes.core.k8s_info: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
kind: Route | ||
name: "{{ aap_ocp_install_platform['instance_name'] | mandatory }}-controller" | ||
api_version: route.openshift.io/v1 | ||
namespace: "{{ aap_ocp_install_platform['namespace'] | default(aap_ocp_install_namespace) | mandatory }}" | ||
when: | ||
- aap_ocp_install_controller is defined and aap_ocp_install_controller['install'] is defined and aap_ocp_install_controller['install'] | ||
register: __aap_ocp_install_controller_route_result | ||
until: __aap_ocp_install_controller_route_result['resources'] | ||
retries: 60 # Wait for 15 minutes (60*15/60) | ||
delay: 15 | ||
|
||
- name: Store automation controller route | ||
ansible.builtin.set_fact: | ||
__aap_ocp_install_controller_route: "{{ __aap_ocp_install_controller_route_result['resources'][0]['status']['ingress'][0]['host'] }}" | ||
when: | ||
- aap_ocp_install_controller is defined and aap_ocp_install_controller['install'] is defined and aap_ocp_install_controller['install'] | ||
|
||
- name: Ensure automation controller API is available | ||
ansible.builtin.uri: | ||
url: "https://{{ __aap_ocp_install_controller_route }}/api" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
method: GET | ||
status_code: | ||
- 200 | ||
when: | ||
- aap_ocp_install_controller is defined and aap_ocp_install_controller['install'] is defined and aap_ocp_install_controller['install'] | ||
register: _aap_ocp_install_controller_available | ||
until: (_aap_ocp_install_controller_available['status'] == 200) and ('migrations_notran' not in _aap_ocp_install_controller_available['url']) | ||
retries: 120 # Wait for 30 minutes (120*15/60) | ||
delay: 15 | ||
|
||
- name: Wait for operator to create the automation EDA route | ||
kubernetes.core.k8s_info: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
kind: Route | ||
name: "{{ aap_ocp_install_platform['instance_name'] | mandatory }}-eda" | ||
api_version: route.openshift.io/v1 | ||
namespace: "{{ aap_ocp_install_platform['namespace'] | default(aap_ocp_install_namespace) | mandatory }}" | ||
when: | ||
- aap_ocp_install_eda is defined and aap_ocp_install_eda['install'] is defined and aap_ocp_install_eda['install'] | ||
register: __aap_ocp_install_eda_route_result | ||
until: __aap_ocp_install_eda_route_result['resources'] | ||
retries: 60 # Wait for 15 minutes (60*15/60) | ||
delay: 15 | ||
|
||
- name: Store automation eda route | ||
ansible.builtin.set_fact: | ||
__aap_ocp_install_eda_route: "{{ __aap_ocp_install_eda_route_result['resources'][0]['status']['ingress'][0]['host'] }}" | ||
when: | ||
- aap_ocp_install_eda is defined and aap_ocp_install_eda['install'] is defined and aap_ocp_install_eda['install'] | ||
|
||
- name: Ensure automation eda API is available | ||
ansible.builtin.uri: | ||
url: "https://{{ __aap_ocp_install_eda_route }}/api" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
method: GET | ||
status_code: | ||
- 200 | ||
when: | ||
- aap_ocp_install_eda is defined and aap_ocp_install_eda['install'] is defined and aap_ocp_install_eda['install'] | ||
register: _aap_ocp_install_eda_available | ||
until: (_aap_ocp_install_eda_available['status'] == 200) and ('migrations_notran' not in _aap_ocp_install_eda_available['url']) | ||
retries: 120 # Wait for 30 minutes (120*15/60) | ||
delay: 15 | ||
|
||
- name: Wait for operator to create the automation hub route | ||
kubernetes.core.k8s_info: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
kind: Route | ||
name: "{{ aap_ocp_install_platform['instance_name'] | mandatory }}-hub" | ||
api_version: route.openshift.io/v1 | ||
namespace: "{{ aap_ocp_install_platform['namespace'] | default(aap_ocp_install_namespace) | mandatory }}" | ||
when: | ||
- aap_ocp_install_hub is defined and aap_ocp_install_hub['install'] is defined and aap_ocp_install_hub['install'] | ||
register: __aap_ocp_install_hub_route_result | ||
until: __aap_ocp_install_hub_route_result['resources'] | ||
retries: 60 # Wait for 15 minutes (60*15/60) | ||
delay: 15 | ||
|
||
- name: Store automation hub route | ||
ansible.builtin.set_fact: | ||
__aap_ocp_install_hub_route: "{{ __aap_ocp_install_hub_route_result['resources'][0]['status']['ingress'][0]['host'] }}" | ||
when: | ||
- aap_ocp_install_hub is defined and aap_ocp_install_hub['install'] is defined and aap_ocp_install_hub['install'] | ||
|
||
- name: Ensure automation hub API is available | ||
ansible.builtin.uri: | ||
url: "https://{{ __aap_ocp_install_hub_route }}/api/galaxy/pulp/api/v3/" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
method: GET | ||
status_code: | ||
- 200 | ||
when: | ||
- aap_ocp_install_hub is defined and aap_ocp_install_hub['install'] is defined and aap_ocp_install_hub['install'] | ||
register: _aap_ocp_install_hub_available | ||
until: (_aap_ocp_install_hub_available['status'] == 200) and ('migrations_notran' not in _aap_ocp_install_hub_available['url']) | ||
retries: 120 # Wait for 30 minutes (120*15/60) | ||
delay: 15 | ||
|
||
- name: Create automation platform console link | ||
kubernetes.core.k8s: | ||
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" | ||
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" | ||
validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" | ||
state: present | ||
resource_definition: "{{ lookup('template', 'platform/consolelink.yaml.j2') | from_yaml }}" | ||
apply: true | ||
... |
Oops, something went wrong.