-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding aap2.5 config * fixed yamllint error * fixed yamllint error
- Loading branch information
Showing
6 changed files
with
194 additions
and
59 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
60 changes: 60 additions & 0 deletions
60
ansible/roles_ocp_workloads/ocp4_workload_ansible_automation_platform/tasks/aap/aap-2.5.yml
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,60 @@ | ||
--- | ||
|
||
- name: Deploy Ansible Automation Platform 2 (AAP2) | ||
block: | ||
- name: Create Ansilbe Automation Platform | ||
kubernetes.core.k8s: | ||
state: present | ||
definition: "{{ lookup('template', 'aap-2.5.j2') }}" | ||
|
||
- name: Retrieve created route | ||
kubernetes.core.k8s_info: | ||
api_version: "route.openshift.io/v1" | ||
kind: Route | ||
name: "{{ ocp4_workload_ansible_automation_platform_app_name }}" | ||
namespace: "{{ ocp4_workload_ansible_automation_platform_project }}" | ||
register: r_route | ||
until: r_route.resources[0].spec.host is defined | ||
retries: 30 | ||
delay: 45 | ||
|
||
- name: Get automation_controller route hostname | ||
ansible.builtin.set_fact: | ||
automation_controller_hostname: "{{ r_route.resources[0].spec.host }}" | ||
|
||
- name: Wait for automation_controller to be running | ||
ansible.builtin.uri: | ||
url: http://{{ automation_controller_hostname }}/api/controller/v2/ping/ | ||
status_code: 200 | ||
register: r_result | ||
until: r_result.json.version is defined | ||
retries: 60 | ||
delay: 45 | ||
|
||
- name: Inject AAP2 Manifest if provided | ||
when: ocp4_workload_ansible_automation_platform_manifest.inject | default(false) | bool | ||
block: | ||
|
||
- name: Fetch Automation Controller manifest file | ||
ansible.builtin.get_url: | ||
url: https://d3s3zqyaz8cp2d.cloudfront.net/aap/manifest.zip | ||
dest: /tmp/aap-manifest.zip | ||
username: "{{ ocp4_workload_ansible_automation_platform_manifest.username | default(omit) }}" | ||
password: "{{ ocp4_workload_ansible_automation_platform_manifest.password | default(omit) }}" | ||
|
||
- name: Inject AAP2 Controller manifest | ||
ansible.controller.license: | ||
manifest: /tmp/aap-manifest.zip | ||
controller_host: "{{ automation_controller_hostname }}" | ||
controller_username: admin | ||
controller_password: "{{ ocp4_workload_ansible_automation_platform_admin_password }}" | ||
validate_certs: true | ||
register: r_aap_license | ||
until: not r_aap_license.failed | ||
retries: 30 | ||
delay: 30 | ||
|
||
- name: Remove AAP manifest | ||
ansible.builtin.file: | ||
path: /tmp/aap-manifest.zip | ||
state: absent |
60 changes: 60 additions & 0 deletions
60
...le/roles_ocp_workloads/ocp4_workload_ansible_automation_platform/tasks/aap/aap-legacy.yml
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,60 @@ | ||
--- | ||
|
||
- name: Deploy Ansible Automation Platform 2 (AAP2) | ||
block: | ||
- name: Create Automation Controller | ||
kubernetes.core.k8s: | ||
state: present | ||
definition: "{{ lookup('template', 'aap-legacy.j2') }}" | ||
|
||
- name: Retrieve created route | ||
kubernetes.core.k8s_info: | ||
api_version: "route.openshift.io/v1" | ||
kind: Route | ||
name: "{{ ocp4_workload_ansible_automation_platform_app_name }}" | ||
namespace: "{{ ocp4_workload_ansible_automation_platform_project }}" | ||
register: r_route | ||
until: r_route.resources[0].spec.host is defined | ||
retries: 30 | ||
delay: 45 | ||
|
||
- name: Get automation_controller route hostname | ||
ansible.builtin.set_fact: | ||
automation_controller_hostname: "{{ r_route.resources[0].spec.host }}" | ||
|
||
- name: Wait for automation_controller to be running | ||
ansible.builtin.uri: | ||
url: http://{{ automation_controller_hostname }}/api/v2/ping/ | ||
status_code: 200 | ||
register: r_result | ||
until: r_result.json.version is defined | ||
retries: 60 | ||
delay: 45 | ||
|
||
- name: Inject AAP2 Manifest if provided | ||
when: ocp4_workload_ansible_automation_platform_manifest.inject | default(false) | bool | ||
block: | ||
|
||
- name: Fetch Automation Controller manifest file | ||
ansible.builtin.get_url: | ||
url: https://d3s3zqyaz8cp2d.cloudfront.net/aap/manifest.zip | ||
dest: /tmp/aap-manifest.zip | ||
username: "{{ ocp4_workload_ansible_automation_platform_manifest.username | default(omit) }}" | ||
password: "{{ ocp4_workload_ansible_automation_platform_manifest.password | default(omit) }}" | ||
|
||
- name: Inject AAP2 Controller manifest | ||
awx.awx.license: | ||
manifest: /tmp/aap-manifest.zip | ||
controller_host: "{{ automation_controller_hostname }}" | ||
controller_username: admin | ||
controller_password: "{{ ocp4_workload_ansible_automation_platform_admin_password }}" | ||
validate_certs: true | ||
register: r_aap_license | ||
until: not r_aap_license.failed | ||
retries: 30 | ||
delay: 30 | ||
|
||
- name: Remove AAP manifest | ||
ansible.builtin.file: | ||
path: /tmp/aap-manifest.zip | ||
state: absent |
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
8 changes: 8 additions & 0 deletions
8
ansible/roles_ocp_workloads/ocp4_workload_ansible_automation_platform/templates/aap-2.5.j2
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,8 @@ | ||
--- | ||
apiVersion: aap.ansible.com/v1alpha1 | ||
kind: AnsibleAutomationPlatform | ||
metadata: | ||
name: {{ ocp4_workload_ansible_automation_platform_app_name }} | ||
namespace: {{ ocp4_workload_ansible_automation_platform_project }} | ||
spec: | ||
replicas: 1 |
File renamed without changes.