Skip to content

Commit

Permalink
added support for installing AAP 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagoor Shaik committed Oct 8, 2024
1 parent a6c2117 commit a40216e
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/add_aap25_support.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Added support to install latest AAP 2.5 version
11 changes: 11 additions & 0 deletions roles/aap_setup_install/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
# defaults file for aap_setup_install

# which version of the installer to download
aap_setup_down_version: "2.5"

# where is the setup directory
aap_setup_inst_setup_dir: "{{ aap_setup_prep_setup_dir }}"

Expand Down Expand Up @@ -72,6 +75,14 @@ ah_hostname: "{{ (aap_setup_prep_inv_nodes['automationhub'].keys() | list)[0] }}
eda_hostname: "{{ (aap_setup_prep_inv_nodes[__aap_setup_inst_eda_group_name].keys() | list)[0] }}"
# eda_validate_certs: false

# gateway_hostname: "{{ inventory_hostname }}"
gateway_hostname: "{{ (aap_setup_prep_inv_nodes['automationgateway'].keys() | list)[0] }}"
# gateway_username: "admin"
# gateway_password: ""
# gateway_oauthtoken: ""
# gateway_config_file: ""
# gateway_validate_certs: false

# force the installation of AAP even if it's already running
aap_setup_inst_force: false

Expand Down
110 changes: 100 additions & 10 deletions roles/aap_setup_install/tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
failed_when: false
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '<')
- not aap_setup_inst_force | bool

- name: Check Automation Hub Running
Expand All @@ -27,33 +28,53 @@
failed_when: false
when:
- "'automationhub' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '<')
- not aap_setup_inst_force | bool

- name: Check EDA Controller Running
ansible.builtin.uri:
url: https://{{ eda_hostname }}/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationedacontroller_admin_password | default(aap_setup_prep_inv_vars.all.automationedacontroller_admin_password)
}}"
password: "{{ aap_setup_prep_inv_secrets.all.automationedacontroller_admin_password | default(aap_setup_prep_inv_vars.all.automationedacontroller_admin_password) }}"
validate_certs: "{{ eda_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_eda_check
ignore_errors: true
failed_when: false
when:
- "'automationedacontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '<')
- not aap_setup_inst_force | bool

- name: Check Gateway API Status
ansible.builtin.uri:
url: https://{{ gateway_hostname }}/api/gateway/v1/status/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationgateway_admin_password | default(aap_setup_prep_inv_vars.all.automationgateway_admin_password) }}"
validate_certs: "{{ gateway_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_gateway_check
ignore_errors: true
failed_when: false
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '>=')
- not aap_setup_inst_force | bool

- name: Install AAP
when: >
aap_setup_inst_force
or ('automationcontroller' in aap_setup_prep_inv_nodes
and __aap_setup_inst_ctl_check.status != 200)
and (aap_setup_down_version is version('2.5', '>=') |
ternary(__aap_setup_inst_gateway_check.json.services.controller.status | default('') != 'good', __aap_setup_inst_ctl_check.status | default(401) != 200)))
or ('automationhub' in aap_setup_prep_inv_nodes
and __aap_setup_inst_ah_check.status != 200)
and (aap_setup_down_version is version('2.5', '>=') |
ternary(__aap_setup_inst_gateway_check.json.services.hub.status | default('') != 'good', __aap_setup_inst_ctl_ah.status | default(401) != 200)))
or ('automationedacontroller' in aap_setup_prep_inv_nodes
and __aap_setup_inst_eda_check.status != 200)
and (aap_setup_down_version is version('2.5', '>=') |
ternary(__aap_setup_inst_gateway_check.json.services.eda.status | default('') != 'good', __aap_setup_inst_ctl_eda.status | default(401) != 200)))
block:
- name: Copy extra vars files to workspace
ansible.builtin.copy:
Expand Down Expand Up @@ -85,7 +106,9 @@
until: __aap_setup_inst_result.status == 200
retries: 90
delay: 10
when: "'automationcontroller' in aap_setup_prep_inv_nodes"
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '<')

- name: Wait for automation hub to be running
ansible.builtin.uri: # use the first host from the list if no hostname is defined
Expand All @@ -100,20 +123,87 @@
until: __aap_setup_inst_result_ah.status == 200
retries: 90
delay: 10
when: "'automationhub' in aap_setup_prep_inv_nodes"
when:
- "'automationhub' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '<')

- name: Wait for EDA controller to be running
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: https://{{ eda_hostname }}/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationedacontroller_admin_password | default(aap_setup_prep_inv_vars.all.automationedacontroller_admin_password)
}}"
password: "{{ aap_setup_prep_inv_secrets.all.automationedacontroller_admin_password | default(aap_setup_prep_inv_vars.all.automationedacontroller_admin_password) }}"
validate_certs: "{{ eda_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_result_eda
until: __aap_setup_inst_result_eda.status == 200
retries: 90
delay: 10
when: "'automationedacontroller' in aap_setup_prep_inv_nodes"
when:
- "'automationedacontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '<')

- name: Wait for Automation controller service to be running
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: https://{{ gateway_hostname }}/api/gateway/v1/status/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationgateway_admin_password | default(aap_setup_prep_inv_vars.all.automationgateway_admin_password) }}"
validate_certs: "{{ gateway_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_result_gateway
until: __aap_setup_inst_result_gateway.json.services.gateway.status == "good"
retries: 90
delay: 10
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '>=')

- name: Wait for Automation Hub service to be running
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: https://{{ gateway_hostname }}/api/gateway/v1/status/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationgateway_admin_password | default(aap_setup_prep_inv_vars.all.automationgateway_admin_password) }}"
validate_certs: "{{ gateway_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_result_gateway
until: __aap_setup_inst_result_gateway.json.services.hub.status == "good"
retries: 90
delay: 10
when:
- "'automationhub' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '>=')

- name: Wait for EDA controller service to be running
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: https://{{ gateway_hostname }}/api/gateway/v1/status/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationgateway_admin_password | default(aap_setup_prep_inv_vars.all.automationgateway_admin_password) }}"
validate_certs: "{{ gateway_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_result_gateway
until: __aap_setup_inst_result_gateway.json.services.gateway.status == "good"
retries: 90
delay: 10
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '>=')

- name: Wait for Automation Gateway service to be running
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: https://{{ gateway_hostname }}/api/gateway/v1/status/
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationgateway_admin_password | default(aap_setup_prep_inv_vars.all.automationgateway_admin_password) }}"
validate_certs: "{{ gateway_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_result_gateway
until: __aap_setup_inst_result_gateway.json.services.gateway.status == "good"
retries: 90
delay: 10
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- aap_setup_down_version is version('2.5', '>=')
...

0 comments on commit a40216e

Please sign in to comment.