Skip to content

Commit

Permalink
Added support for EDA Controller (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tompage1994 authored Aug 3, 2023
1 parent d92b00c commit ed1fcb9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
9 changes: 9 additions & 0 deletions roles/aap_setup_install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ aap_setup_prep_inv_nodes:
- ansible-ctrl.example.com
automationhub:
- ansible-hub.example.com
automationedacontroller:
- ansible-eda.example.com
database:
- database.example # if using an already existing DB, remove this and ensure that the following variables are filled with the valid details for your Controller and PAH
# databases: pg_host, pg_port, pg_database, ph_username, pg_password, automationhub_pg_host, automationhub_pg_port, automationhub_pg_database,
Expand Down Expand Up @@ -105,6 +107,13 @@ aap_setup_prep_inv_vars:
automationhub_ssl_validate_certs: False
automationedacontroller_admin_password: 'password' # Admin password for EDA UI
automationedacontroller_pg_host: 'controller.aap24.local'
automationedacontroller_pg_port: '5432'
automationedacontroller_pg_database: 'automationedacontroller'
automationedacontroller_pg_username: 'automationedacontroller'
automationedacontroller_pg_password: 'password'
sso_console_admin_password: ''
aap_setup_prep_inv_secrets:
Expand Down
3 changes: 3 additions & 0 deletions roles/aap_setup_install/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ ah_hostname: "{{ (aap_setup_prep_inv_nodes['automationhub'].keys() | list)[0] }}
# ah_oauthtoken: ""
# ah_validate_certs: false

eda_hostname: "{{ (aap_setup_prep_inv_nodes['automationedacontroller'].keys() | list)[0] }}"
# eda_validate_certs: false

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

Expand Down
33 changes: 32 additions & 1 deletion roles/aap_setup_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
method: GET
user: admin
password: "{{ aap_setup_prep_inv_secrets.all.automationhub_admin_password | default(aap_setup_prep_inv_vars.all.automationhub_admin_password) }}"
validate_certs: "{{ controller_validate_certs | default('false') }}"
validate_certs: "{{ ah_validate_certs | default('false') }}"
force_basic_auth: true
register: __aap_setup_inst_ah_check
ignore_errors: true
Expand All @@ -36,13 +36,30 @@
- "'automationhub' in aap_setup_prep_inv_nodes"
- 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) }}"
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"
- 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)
or ('automationhub' in aap_setup_prep_inv_nodes
and __aap_setup_inst_ah_check.status != 200)
or ('automationedacontroller' in aap_setup_prep_inv_nodes
and __aap_setup_inst_eda_check.status != 200)
block:
- name: Copy extra vars files to workspace
ansible.builtin.copy:
Expand Down Expand Up @@ -90,4 +107,18 @@
retries: 90
delay: 10
when: "'automationhub' in aap_setup_prep_inv_nodes"

- name: Wait for automation hub 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) }}"
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"
...
9 changes: 9 additions & 0 deletions roles/aap_setup_prepare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ aap_setup_prep_inv_nodes:
- ansible-ctrl.example.com
automationhub:
- ansible-hub.example.com
automationedacontroller:
- ansible-eda.example.com
database:
- database.example # if using an already existing DB, remove this and ensure that the following variables are filled with the valid details for your Controller and PAH
# databases: pg_host, pg_port, pg_database, ph_username, pg_password, automationhub_pg_host, automationhub_pg_port, automationhub_pg_database,
Expand Down Expand Up @@ -111,6 +113,13 @@ aap_setup_prep_inv_vars:
automationhub_ssl_validate_certs: False
automationedacontroller_admin_password: 'password' # Admin password for EDA UI
automationedacontroller_pg_host: 'controller.aap24.local'
automationedacontroller_pg_port: '5432'
automationedacontroller_pg_database: 'automationedacontroller'
automationedacontroller_pg_username: 'automationedacontroller'
automationedacontroller_pg_password: 'password'
sso_console_admin_password: ''
aap_setup_prep_inv_secrets:
Expand Down

0 comments on commit ed1fcb9

Please sign in to comment.