generated from RedHatQuickCourses/course-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Amrinder Singh
committed
Nov 27, 2024
1 parent
0df862b
commit bbac6c0
Showing
19 changed files
with
217 additions
and
74 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
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 |
---|---|---|
@@ -1,27 +1,25 @@ | ||
= An Example Quick Course | ||
== Migration of AWX to AAP 2.5 | ||
:navtitle: Home | ||
|
||
== Introduction | ||
|
||
Course Title: Course title FIXME | ||
|
||
Description: | ||
Course description FIXME | ||
|
||
Duration: FIXME hours | ||
Introducing the Ansible Automation platform Application Migration: Free to Enterprise course, which aims to close the gap between enterprise-grade solutions from the open-source automation. With an emphasis on scalability, security, and advanced capabilities, this extensive course will walk you through the process of moving automation workflows from free tools to reliable corporate platforms. This training gives you the knowledge and abilities to guarantee a smooth transition, whether you're updating your automation ecosystem or bringing it into compliance with organizational requirements. | ||
|
||
Duration: 40 Minutes | ||
|
||
== Objectives | ||
|
||
On completing this course, you should be able to: | ||
|
||
* Observable, measurable objective... | ||
* Observable, measurable objective... | ||
* Observable, measurable objective... | ||
- Learners can implement the steps provided to guide application migration. | ||
- Learners can define and discuss the necessity for AWX to AAP 2.5 migration. | ||
- Learners can define the benefits of utilizing AAP 2.5 to migrate applications. | ||
- Learners can diagnose and rectify known issues in AWX application migrations. | ||
|
||
|
||
== Prerequisites | ||
|
||
This course assumes that you have the following prior experience: | ||
|
||
* Course or experience... | ||
* Course or experience... | ||
* Course or experience... | ||
* Knowledge on Ansible Automation Platform. | ||
* Foundational Knowledge of Openshift and Linux. |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
* xref:index.adoc[] | ||
** xref:section1.adoc[] | ||
** xref:section2.adoc[] | ||
** xref:section3.adoc[] | ||
** xref:section3.adoc[] | ||
** xref:section4.adoc[] | ||
** xref:section5.adoc[] | ||
** xref:section6.adoc[] |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
= Chapter 1 | ||
= Migration of AWX to AAP 2.5 | ||
|
||
In this section, we cover... FIXME | ||
We will cover the following points: | ||
|
||
|
||
- Add or remove section entries in the `antora.yaml` file as needed. | ||
- Ensure you create or delete the corresponding directory for the chapter accordingly. | ||
- Why did we create this migration course from free to enterprise software? | ||
- What’s the benefit of using Ansible Automation Platform over AWX? | ||
- Deployment of AWX | ||
- Deployment of the Ansible Automation Platform 2.5 operator | ||
- Migration of AWX to AAP 2.5 |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
= Section 1 | ||
= Why did we create this migration course from free to enterprise software? | ||
|
||
There are several advantages to switching from a free to an enterprise subscription, including increased scalability, security, and efficiency. Advanced features that are crucial for expanding enterprises, such as specialized customer assistance, and integration capabilities, are often included in enterprise plans. | ||
|
||
Additionally, these plans provide analytics, compliance capabilities, and customizations based on industry standards, allowing companies to make data-driven decisions and streamline operations. Enterprise solutions are also performance-optimized, enabling increasing user needs and guaranteeing dependable uptime. Without the restrictions that frequently come with free editions, this enables businesses to concentrate on innovation and expansion using Automation what benefits are there to use Ansible Automation platform (AAP) over Ansible Web Executable (AWX) | ||
|
||
* Create multiple copies of this section as needed. | ||
* Remove any unnecessary sections or chapter pages. | ||
* Customize the section as appropriate. | ||
* Ensure that each page contains a manageable amount of content. |
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
= Section 2 | ||
= What’s the benefit of using Ansible Automation Platform over AWX? | ||
|
||
* Create multiple copies of this section as needed. | ||
* Remove any unnecessary sections or chapter pages. | ||
* Customize the section as appropriate. | ||
* Ensure that each page contains a manageable amount of content. | ||
|
||
[cols=3*] | ||
|=== | ||
| | AWX | Red Hat Ansible Automation Platform | ||
| Security | Not available | Trusted chain-of-custody for certified and private content. https://www.redhat.com/en/technologies/management/ansible/gain-security-with-red-hat-ansible-automation-platform[Security hardened] with support, performance testing, bug fixes, and other standardized practices—for a more consistent and less vulnerable enterprise environment | ||
|Certified content and partner ecosystem | Not available | 140+ https://catalog.redhat.com/platform/red-hat-ansible[certified content collections] across 60+ partners. Benefit from pre-built, fully supported, and certified automation content from Red Hat and our partners. | ||
|Life cycle support|Not available|At least 18 months of https://access.redhat.com/support/policy/updates/ansible-automation-platform[enterprise support] per release. Critical bugfix and security vulnerability backporting for all components. | ||
|Legal protections|Not available| Intellectual property protections via the https://www.redhat.com/en/about/open-source-assurance[Open Source Assurance Agreement]. | ||
|Analytics|Not available|Automation analytics and Red Hat Insights for Ansible Automation Platform offer in-depth analytics and reporting for planning and tracking performance and adoption. | ||
|Upgrades and migrations|Not available|Supported migration to major releases as well as upgrades to minor releases. | ||
|Training and consulting|Not available|Expert resources to help you build and run a successful automation practice, backed by robust training offerings and support. Hands-on migration assistance from AWX to Ansible Automation Platform is also available. | ||
|Cloud deployment options|Not available|Managed and self-managed applications available to deploy on your cloud of choice, including https://www.redhat.com/en/technologies/management/ansible/azure[Microsoft Azure], https://www.redhat.com/en/technologies/management/ansible/aws[AWS], and https://www.redhat.com/en/technologies/management/ansible/google-cloud[Google Cloud]. Counts toward committed spend agreements. Supported by Red Hat with integrated billing. https://www.redhat.com/en/technologies/management/ansible/pricing[View deployment options and pricing information]. | ||
|Event-Driven Ansible|Separate upstream project that requires manual integration into your environment| https://www.redhat.com/en/technologies/management/ansible/features#event-driven-ansible[Event-Driven Ansible] is an integrated and tested product component of Ansible Automation Platform that reduces manual tasks, delivers more efficient IT operations, and frees your teams to focus on innovation. | ||
|Ansible automation hub |Separate upstream project that requires manual integration into your environment| https://www.redhat.com/en/technologies/management/ansible/features#ansible-automation-hub[Ansible automation hub] is an integrated and tested product component of Ansible Automation Platform. | ||
|Red Hat Ansible Lightspeed with IBM watsonx Code Assistant|Integrated generative AI tooling|https://www.redhat.com/en/technologies/management/ansible/ansible-lightspeed[Ansible Lightspeed with watsonx Code Assistant] is a generative AI service that produces code recommendations built on Ansible best practices. It is included with an Ansible Automation Platform subscription, but requires purchase of IBM watsonx Code Assistant to activate all features. | ||
|=== |
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 |
---|---|---|
@@ -1,6 +1,82 @@ | ||
= Section 3 | ||
= Deployment of AWX | ||
|
||
video::aap_deploy.mp4[align="center"] | ||
|
||
Refer to the above Video and then Follow the below step to do the deployment: | ||
|
||
. First create a clone of the awx-operator github repo: | ||
|
||
# git clone https://github.com/ansible/awx-operator.git | ||
# cd awx-operator | ||
# git tag | ||
# git checkout tags/<tag> | ||
# For instance: | ||
# git checkout tags/<latest> | ||
|
||
|
||
. There is a make target you can run: | ||
|
||
make deploy | ||
|
||
|
||
. Create a file called `kustomization.yaml` with the following content: | ||
|
||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
# Find the latest tag here: https://github.com/ansible/awx-operator/releases | ||
- github.com/ansible/awx-operator/config/default?ref=<tag> | ||
# Set the image tags to match the git version from above | ||
images: | ||
- name: quay.io/ansible/awx-operator | ||
newTag: <tag> | ||
# Specify a custom namespace in which to install AWX | ||
namespace: awx | ||
|
||
|
||
. Install the manifests by running this: | ||
|
||
$ oc apply -k . | ||
namespace/awx created | ||
customresourcedefinition.apiextensions.k8s.io/awxbackups.awx.ansible.com created | ||
customresourcedefinition.apiextensions.k8s.io/awxrestores.awx.ansible.com created | ||
customresourcedefinition.apiextensions.k8s.io/awxs.awx.ansible.com created | ||
serviceaccount/awx-operator-controller-manager created | ||
role.rbac.authorization.k8s.io/awx-operator-awx-manager-role created | ||
role.rbac.authorization.k8s.io/awx-operator-leader-election-role created | ||
clusterrole.rbac.authorization.k8s.io/awx-operator-metrics-reader created | ||
clusterrole.rbac.authorization.k8s.io/awx-operator-proxy-role created | ||
rolebinding.rbac.authorization.k8s.io/awx-operator-awx-manager-rolebinding created | ||
rolebinding.rbac.authorization.k8s.io/awx-operator-leader-election-rolebinding created | ||
clusterrolebinding.rbac.authorization.k8s.io/awx-operator-proxy-rolebinding created | ||
configmap/awx-operator-awx-manager-config created | ||
service/awx-operator-controller-manager-metrics-service created | ||
deployment.apps/awx-operator-controller-manager created | ||
|
||
|
||
. Edit the `awx-demo.yml` file with the following content: | ||
|
||
apiVersion: awx.ansible.com/v1beta1 | ||
kind: AWX | ||
metadata: | ||
name: awx-demo | ||
spec: | ||
service_type: clusterip | ||
ingress_type: Route | ||
|
||
|
||
. Make sure to add this new file to the list of resources in your `kustomization.yaml` file: | ||
|
||
resources: | ||
- github.com/ansible/awx-operator/config/default?ref=<tag> | ||
# Add this extra line: | ||
- awx-demo.yml | ||
|
||
|
||
. Apply the changes to create the AWX instance in your cluster | ||
|
||
$ oc apply -k . | ||
|
||
|
||
NOTE: Create Resources on the AWX which can be confirmed after migration Following Video Tutorial will help in doing that. | ||
|
||
* Create multiple copies of this section as needed. | ||
* Remove any unnecessary sections or chapter pages. | ||
* Customize the section as appropriate. | ||
* Ensure that each page contains a manageable amount of content. |
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,11 @@ | ||
= Deployment of the Ansible Automation Platform 2.5 operator | ||
|
||
. Log in to Red Hat OpenShift Container Platform. | ||
. Navigate to Operators OperatorHub. | ||
. Search for Ansible Automation Platform and click Install. | ||
. Select an stable-2.5 | ||
. Select namespace as awx | ||
. Click Install | ||
|
||
|
||
NOTE: It is recommended to have the AWX and AAP 2.5 in the same Namespace or else the communication issues occur between the pods while performing the database migration. |
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,78 @@ | ||
= Migration of AWX to AAP 2.5 | ||
|
||
. Run the following command to only make the resources available like postgres on the openshift deployed system: | ||
|
||
oc apply -f - << EOF | ||
kind: AnsibleAutomationPlatform | ||
apiVersion: aap.ansible.com/v1alpha1 | ||
metadata: | ||
name: aap | ||
namespace: awx | ||
spec: | ||
replicas: 0 | ||
EOF | ||
|
||
. To set the current namespace as awx. | ||
|
||
$ oc config set-context --current --namespace=awx | ||
|
||
. Export the below variables so that we will be used to create the commands to run the migration: | ||
|
||
export AWX_NAMESPACE=awx | ||
export AWX_NAME=awx-demo | ||
export AWX_DB_NAME=$(oc get secret -n $AWX_NAMESPACE $AWX_NAME-postgres-configuration -o jsonpath={.data.database} | base64 -d) | ||
export AWX_DB_HOST=$(oc get secret -n $AWX_NAMESPACE $AWX_NAME-postgres-configuration -o jsonpath={.data.host} | base64 -d) | ||
export AWX_DB_PASSWORD=$(oc get secret -n $AWX_NAMESPACE $AWX_NAME-postgres-configuration -o jsonpath={.data.password} | base64 -d) | ||
export AWX_DB_PORT=$(oc get secret -n $AWX_NAMESPACE $AWX_NAME-postgres-configuration -o jsonpath={.data.port} | base64 -d) | ||
export AWX_DB_USERNAME=$(oc get secret -n $AWX_NAMESPACE $AWX_NAME-postgres-configuration -o jsonpath={.data.username} | base64 -d) | ||
|
||
export AUTOMATION_CONTROLLER_NAME=aap | ||
export AUTOMATION_CONTROLLER_NAMESPACE=awx | ||
export AUTOMATION_CONTROLLER_DB_NAME=$(oc get secret -n $AUTOMATION_CONTROLLER_NAMESPACE $AUTOMATION_CONTROLLER_NAME-controller-postgres-configuration -o jsonpath={.data.database} | base64 -d) | ||
export AUTOMATION_CONTROLLER_DB_PASSWORD=$(oc get secret -n $AUTOMATION_CONTROLLER_NAMESPACE $AUTOMATION_CONTROLLER_NAME-controller-postgres-configuration -o jsonpath={.data.password} | base64 -d) | ||
export AUTOMATION_CONTROLLER_DB_PORT=$(oc get secret -n $AUTOMATION_CONTROLLER_NAMESPACE $AUTOMATION_CONTROLLER_NAME-controller-postgres-configuration -o jsonpath={.data.port} | base64 -d) | ||
export AUTOMATION_CONTROLLER_DB_USERNAME=$(oc get secret -n $AUTOMATION_CONTROLLER_NAMESPACE $AUTOMATION_CONTROLLER_NAME-controller-postgres-configuration -o jsonpath={.data.username} | base64 -d) | ||
export AUTOMATION_CONTROLLER_DB_HOST=$(oc get secret -n $AUTOMATION_CONTROLLER_NAMESPACE $AUTOMATION_CONTROLLER_NAME-controller-postgres-configuration -o jsonpath={.data.host} | base64 -d) | ||
|
||
. Run the following command to enter the AWX postgres database container: | ||
|
||
oc exec -it $AWX_NAME-postgres-15-0 -- bash | ||
|
||
. Run the following command inside the Container to migrate the data: | ||
|
||
PGPASSWORD=$AWX_DB_PASSWORD pg_dump -h $AWX_DB_HOST -U $AWX_DB_USERNAME -d $AWX_DB_NAME -p $AWX_DB_PORT -F custom --exclude-table-data 'main_jobevent*' --exclude-table-data 'main_job' | PGPASSWORD=$AUTOMATION_CONTROLLER_DB_PASSWORD pg_restore --clean --if-exists --no-owner -h $AUTOMATION_CONTROLLER_DB_HOST -U $AUTOMATION_CONTROLLER_DB_USERNAME -d $AUTOMATION_CONTROLLER_DB_NAME -p $AUTOMATION_CONTROLLER_DB_PORT" | ||
|
||
Command breakdown: | ||
Part 1: PGPASSWORD=$AWX_DB_PASSWORD pg_dump ... | ||
• PGPASSWORD=$AWX_DB_PASSWORD: Temporarily sets the PGPASSWORD environment variable to the password for the AWX database ($AWX_DB_PASSWORD). This allows the pg_dump command to authenticate without prompting for a password. | ||
• pg_dump: A PostgreSQL utility used to back up a database. | ||
• -h $AWX_DB_HOST: Specifies the hostname of the AWX database server. $AWX_DB_HOST should be replaced with the actual hostname. | ||
• -U $AWX_DB_USERNAME: Specifies the username to connect to the AWX database. $AWX_DB_USERNAME should be replaced with the actual database username. | ||
• -d $AWX_DB_NAME: Specifies the name of the AWX database to be dumped. $AWX_DB_NAME should be replaced with the actual database name. | ||
• -p $AWX_DB_PORT: Specifies the port on which the AWX database server is listening. $AWX_DB_PORT should be replaced with the actual port number. | ||
• -F custom: Specifies the output format of the dump. The custom format is a PostgreSQL-specific format that allows for more flexibility during restoration. | ||
• --exclude-table-data: This option is useful when you need the definition of a particular table even though you do not need the data in it | ||
• |: The pipe (|) redirects the output of the pg_dump command to the input of the pg_restore command. Essentially, it allows the dump to be directly restored into another database. | ||
|
||
|
||
Part 2: PGPASSWORD=$AWX_DB_PASSWORD pg_restore ... | ||
• PGPASSWORD=$AUTOMATION_CONTROLLER_DB_PASSWORD: Again, sets the PGPASSWORD environment variable, but this time for the pg_restore command to authenticate with the target database. | ||
• pg_restore: A PostgreSQL utility used to restore a database from a backup. | ||
• --clean: Drops database objects before recreating them. This ensures that the target database is clean and only contains the objects from the backup. | ||
• --if-exists: Used with --clean, it ensures that objects are only dropped if they exist. This prevents errors if some objects are not present in the target database. | ||
• --no-owner: If this flag isn’t set, then postgres will attribute anything it does to the owner of the original database, when importing and exporting, this could cause issues, so often we will say | ||
• -h $AUTOMATION_CONTROLLER_DB_HOST: Specifies the hostname of the target Automation Controller database server. $AUTOMATION_CONTROLLER_DB_HOST should be replaced with the actual hostname. | ||
• -U $AUTOMATION_CONTROLLER_DB_USERNAME: Specifies the username to connect to the target database.. | ||
• -d $AUTOMATION_CONTROLLER_DB_NAME: Specifies the name of the target database (in this case, automationcontroller) into which the backup will be restored. | ||
• -p $AUTOMATION_CONTROLLER_DB_PORT: Specifies the port on which the target database server is listening. $AUTOMATION_CONTROLLER_DB_PORT should be replaced with the actual port number. | ||
|
||
. To migrate the Organization / Teams and user run the below command on the terminal of aap-gateway-controller pod. | ||
|
||
# aap-gateway-manage migrate_service_data --username admin --merge-organizations true --api-slug controller -v 3 | ||
|
||
Verify the data is migrated. | ||
|
||
|
||
NOTE: | ||
The above is suggested to be used for local users only. You need to reset the Password for all the users that will get migrated using the above command. | ||
All Authentication Mechanism needs to be created manually on the Gateway due to centralized Authentication approach for all the softwares of Ansible Automation platform 2.5. |
Empty file.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.