Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Automation Hub automation #66

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,34 @@ podman save localhost/community -o community.img

Better to upload it to some registry, now I manually loaded it into AAP.


### Installing Private Automation Hub

Installation of Private Automation Hub is (currently) automated with four playbooks, including prerequisites.

**1. Prerequisite: Create VM**

```
ansible-playbook -i localhost -c local -e @../private-lab/secrets.yml -e name=rh-automation-hub-01 ensure-vm-state.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i had to change name to short_name in order to get the workflows working. sorry...

```

**2. Prerequisite: Prepare OS (RHEL 8)**

```
ansible-playbook -i hosts -u root -l rh-automation-hub-01.cool.lab -e subs_username=<rhuser> -e subs_pw=<rhpwd> -e subs_pool=<rhpoolid> prepare-rhel8.yml
```

**3. Prerequisite: Configure IDM client**

```
ansible-playbook -i hosts -u root -l rh-automation-hub-01.cool.lab -e short_name=rh-automation-hub-01 -e @../private-lab/secrets.yml setup-idmclient.yml
```

**4. Install Automation Hub**

Get a [Red Hat API offline token](https://access.redhat.com/management/api) and run the [playbook](install-automationhub.yml) to install.

```
ansible-playbook -i hosts -u root -l rh-automation-hub-01.cool.lab -e aap_setup_down_offline_token=<token> -e @../private-lab/secrets.yml install-automationhub.yml
```

2 changes: 2 additions & 0 deletions collections/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ collections:
version: 1.6.2
- name: redhat_cop.controller_configuration
version: 2.1.3
- name: redhat_cop.aap_utilities
version: 2.1.0
5 changes: 5 additions & 0 deletions group_vars/all/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ hostgroups:
aap_ldap_username: aap_ldap
aap_controller: rh-ansiblecontroller-01.cool.lab

ah_hostname: rh-automation-hub-01.cool.lab
ah_username: "admin"
ah_password: "{{ aap_admin_password }}"
ah_oauthtoken: ""
ah_validate_certs: false
6 changes: 6 additions & 0 deletions group_vars/automationhub/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
enabled_repos_rhel8:
- rhel-8-for-x86_64-appstream-rpms
- rhel-8-for-x86_64-baseos-rpms
- ansible-automation-platform-2.1-for-rhel-8-x86_64-rpms

4 changes: 4 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rh-ansiblecontroller-01.cool.lab ansible_host=10.128.1.12 short_name=rh-ansiblec
rh-ansibledatabase-01.cool.lab ansible_host=10.128.1.13 short_name=rh-ansibledatabase-01
rh-exnode-01.cool.lab ansible_host=10.128.1.14 short_name=rh-exnode-01
rh-nfs-01.cool.lab ansible_host=10.128.1.186 short_name=rh-nfs-01
rh-automation-hub-01.cool.lab ansible_host=10.128.1.152 short_name=rh-automation-hub-01

# [ipaclients:children]
# ansibleautomationplatform
Expand All @@ -25,6 +26,9 @@ execution_nodes
[automationcontroller]
rh-ansiblecontroller-01.cool.lab ansible_host=10.128.1.12 short_name=rh-ansiblecontroller-01

[automationhub]
rh-automation-hub-01.cool.lab ansible_host=10.128.1.152 short_name=rh-automation-hub-01

[database]
rh-ansibledatabase-01.cool.lab ansible_host=10.128.1.13 short_name=rh-ansibledatabase-01

Expand Down
30 changes: 30 additions & 0 deletions install-automationhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- name: Install Automation Hub
hosts: automationhub
vars:
aap_setup_down_version: "2.1"
aap_setup_down_type: "setup-bundle"

aap_setup_prep_inv_nodes:
automationhub:
rh-automation-hub-01.cool.lab: "ansible_connection=local"

aap_setup_prep_inv_vars:
all:
automationhub_admin_password: "{{ aap_admin_password }}"

automationhub_pg_host: ""
automationhub_pg_port: ""
automationhub_pg_database: "automationhub"
automationhub_pg_username: "automationhub"
automationhub_pg_password: "{{ aap_database_password }}"
automationhub_pg_sslmode: "prefer" # set to 'verify-full' for client-side enforced SSL

registry_username: "{{ subs_username }}"
registry_password: "{{ subs_pw }}"

roles:
- redhat_cop.aap_utilities.aap_setup_download
- redhat_cop.aap_utilities.aap_setup_prepare
- redhat_cop.aap_utilities.aap_setup_install