bob-builds-labs

AAP Ansible Automation Platform automated deployment and Configuration

from Version 3.0 of the Lab, we do use RedHat AAP Platform 2.5 some changes might have been taken into condiferations, so make sure to check the video to get started with your RedHat Account

Prework:

From your vCenter, make sure ansible, as well Openshift and PowerProtect vApp are started: image

Deploy ( From Ansible Host )

Log into Ansible Host mRemote. If not done from previous, Clone into 0499 if not done from earlier lab

git clone https://github.com/bob-builds-labs/0499.git ~/workspace/0499

Go to lab3 directory

cd ~/workspace/0499
git pull
cd ~/workspace/0499/lab3
direnv allow .

from the command prompt in ~/workspace, clone the ansible-ppdm repository from GitHub:

sudo apt install python3-aiohttp python3-openshift -y

If OpenShift is freshly started, make sure to approve csr´s as in lab 03.0 This can take up to 15 Minutes and multiple CSR´s apprals for the Cluster to reconcile

oc get csr -o go-template='\n' | xargs oc adm certificate approve

Rember to run this multiple times, until you Openshift Console is working and

oc get nodes

shows all nodes ready

use cli to hop to every next Version :

oc adm upgrade | grep  quay.io | tail -n1 | awk '{print $1}'| xargs -I{} oc adm upgrade --to={}

:stuck_out_tongue_winking_eye: To use the 19.18 Branch (only for those who know :-) )

git checkout 19.18

Deploy AAP to Openshift

oc create -f aap_operatorGroup.yaml
echo "Waiting for AAP Operator Pod to be deployed"

until [[ ! -z $(oc get pod -l "control-plane=controller-manager" -n aap) ]]; do echo "Sleeping 5 seconds";sleep 5; done
echo "Waiting for AAP Operator to be ready"
oc wait --for=condition=ready pod -l "control-plane=controller-manager" -n aap --timeout 600s
oc apply -f aap.yaml -n aap
echo "Waiting for AAP Controller Prod instance pod to be deployed"
until [[ ! -z $(oc get pod -l "app.kubernetes.io/name=aap-task" -n aap) ]]; do echo "Sleeping 5 seconds";sleep 5; done
echo "Waiting for AAP Controller instance to be ready"
oc wait --for=condition=ready pod -l "app.kubernetes.io/name=aap-task" -n aap --timeout 600s

Configure AAP

Lets head over to lab4 environment

cd ../lab4
direnv allow .

Check AAP Platform is Ready to serve

Get the Password from:

echo $CONTROLLER_PASSWORD

Sign into Ansible AAP PLATFORM using above Password, and configure the Subscription using a RedHat Developers Account

Oce done, start populating our AAP from ansible playbook:

ansible-playbook ../playbooks/aap.yaml
echo  "You can now login to ${CONTROLLER_HOST} using ${CONTROLLER_USERNAME} with password ${CONTROLLER_PASSWORD}"

Redeploy

Remove potential previously deployed Instances

cd ~/workspace/0499/lab3
oc delete -f aap.yaml -n aap
oc delete pvc postgres-13-aap-postgres-13-0 -n aap
oc delete pvc postgres-15-aap-postgres-15-0 -n aap
oc delete -f aap_operatorGroup.yaml
oc delete ns aap

oc delete crd ansiblecredentials.tower.ansible.com
oc delete crd ansibleinstancegroups.tower.ansible.com
oc delete crd ansibleinventories.tower.ansible.com
oc delete crd ansiblejobs.tower.ansible.com
oc delete crd ansiblelightspeeds.lightspeed.ansible.com
oc delete crd ansibleprojects.tower.ansible.com
oc delete crd ansibleschedules.tower.ansible.com
oc delete crd ansibleworkflows.tower.ansible.com
oc delete crd automationcontrollerbackups.automationcontroller.ansible.com
oc delete crd automationcontrollerrestores.automationcontroller.ansible.com
oc delete crd automationcontrollers.automationcontroller.ansible.com
oc delete crd automationhubbackups.automationhub.ansible.com
oc delete crd automationhubrestores.automationhub.ansible.com
oc delete crd automationhubs.automationhub.ansible.com
oc delete crd edabackups.eda.ansible.com
oc delete crd edarestores.eda.ansible.com
oc delete crd edas.eda.ansible.com
oc delete crd jobtemplates.tower.ansible.com
oc delete crd workflowtemplates.tower.ansible.com