Skip to content

Commit cd858c7

Browse files
committed
adding more updates 4
1 parent ba03412 commit cd858c7

File tree

5 files changed

+34
-170
lines changed

5 files changed

+34
-170
lines changed

content/patterns/ansible-edge-gitops/ansible-automation-platform.adoc

Lines changed: 12 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ Follow these steps to log in to the Ansible Automation Platform using the OpenSh
2727
.AAP secret
2828
image::/images/ansible-edge-gitops/ocp-console-secrets-aap-admin-password-v1.png[ansible-edge-observability-operators,title="AAP secret"]
2929

30-
.. Select the `controller-admin-password`.
30+
.. Select the `aap-admin-password`.
3131

3232
.. In the *Data* field click *Reveal values* to display the password.
3333
+
3434
.AAP secret detail
3535
image::/images/ansible-edge-gitops/ocp-console-aap-admin-password-detail-v1.png[ansible-edge-observability-operators,title="AAP secret details"]
3636

37-
. Under *Networking* > *Routes*, click the URL for the `controller` route to open the Ansible Automation Platform interface.
37+
. Under *Networking* > *Routes*, click the URL for the `aap` route to open the Ansible Automation Platform interface.
3838

39-
.. Log in using the `admin` user and the password you retrieved from the `controller-admin-password` secret.
39+
.. Log in using the `admin` user and the password you retrieved from the `aap-admin-password` secret. A screen similar to the following appears:
40+
+
41+
.AAP login
42+
image::/images/ansible-edge-gitops/aap-login-v1.png[ansible-edge-observability-operators,title="AAP login"]
4043

4144
[id="logging-in-using-secret-retrieved-using-script-ansible_get_credentials"]
4245
=== Logging in using a secret retrieved with ansible_get_credentials.sh
@@ -91,155 +94,16 @@ localhost : ok=7 changed=0 unreachable=0 failed=0 s
9194

9295
== Pattern AAP Configuration Details
9396

94-
In this section, we describe the details of the AAP configuration we apply as part of installing the pattern. All of the configuration
95-
discussed in this section is applied by the
97+
In this section, we describe the details of the AAP configuration we apply as part of installing the pattern. All of the configuration discussed in this section is applied by the
9698
https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/scripts/ansible_load_controller.sh[ansible_load_controller.sh]
9799
script.
98100

99-
=== Loading a Manifest
100-
101-
After validating that AAP is ready to be configured, the first thing the script does is to install the manifest you specify in the
102-
`values-secret.yaml` file in the `files.manifest+` setting. The value of this setting is expected to be a fully-pathed file that represents a
103-
Red Hat Satellite manifest file with a valid entitlement for AAP. The
104-
_only_ thing this manifest is used for is entitling AAP.
105-
106-
Instructions for creating a suitable manifest file can be found https://www.redhat.com/en/blog/how-create-and-use-red-hat-satellite-manifest[here].
107-
108-
While it is absolutely possible to entitle AAP via a username/password on first login, the automated mechanisms for entitling only support
109-
manifests, that is the technique the pattern uses.
110-
111-
=== Organizations
112-
113-
The pattern installs an Organization called `HMI Demo` is installed. This makes it a bit easier to separate what the pattern is doing versus
114-
the default configuration of AAP. The other resources created in AAP as part of the load process are associated with this Organization.
115-
116-
=== Credential Types (and their Credentials)
117-
118-
==== Kubeconfig (Kubeconfig)
119-
120-
The Kubeconfig credential is for holding the OpenShift cluster admin kubeconfig file. This is used to query the `edge-gitops-vms+` namespace
121-
for running VM instances. Since the kubeconfig is necessary for installing the pattern and must be available when the load script is
122-
running, the load script pulls it into an AAP secret and stores it for later use (and calls it `Kubeconfig`).
123-
124-
The template for creating the Credential Type was taken from https://blog.networktocode.com/post/kubernetes-collection-ansible/[here].
125-
126-
==== RHSMcredential (rhsm_credential)
127-
128-
This credential is required to register the RHEL VMs and configure them for Kiosk mode. The registration process allows them to install packages
129-
from the Red Hat Content Delivery Network.
130-
131-
==== Machine (kiosk-private-key)
132-
133-
This is a standard AAP Machine type credential. `kiosk-private-key` is created with the username and private key from your
134-
`values-secret.yaml+` file in the `kiosk-ssh.username` and `kiosk-ssh.privatekey` fields.
135-
136-
==== KioskExtraParams (kiosk_container_extra_params)
137-
138-
This CredentialType is considered "`secret`" because it includes the admin login password for the Ignition application. This passed to the
139-
provisioning playbook(s) as extra_vars.
140-
141-
=== Inventory
142-
143-
The pattern installs an Inventory (HMI Demo), but no inventory sources. This is due to the way that OpenShift Virtualization provides access to
144-
virtual machines. The IP address associated with the SSH service that a given VM is running is associated with the Service object on the VM.
145-
This is not the way the Kubernetes inventory plugin expects to work. So to make inventory dynamic, we are instead using a play to discover VMs
146-
and add them to inventory "`on the fly`". What is unusual about DNS inside a Kubernetes cluster is that resources outside the namespace must
147-
use the cluster FQDN - which is `resource-name.resource-namespace.svc`.
148-
149-
It is also possible to define a static inventory - an example of how this would like is preserved in the pattern repository as
150-
https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/inventory/hosts[hosts].
151-
152-
A standard dynamic inventory script is available https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/inventory/openshift_cluster.yml[here].
153-
This will retrieve the object names, but it will not (currently) map the FQDN properly. Because of this limitation, we moved to using the
154-
inventory pre-play method.
155-
156-
=== Templates (key playbooks in the pattern)
157-
158-
==== https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/dynamic_kiosk_provision.yml[Dynamic Provision Kiosk Playbook]
159-
160-
This combines all three key workflows in this pattern:
161-
162-
* Dynamic inventory (inventory preplay)
163-
* Kiosk Mode
164-
* Podman Playbook
165-
166-
It is safe to run multiple times on the same system. It is run on a schedule, every 10 minutes, to demonstrate this.
167-
168-
==== https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/kiosk_playbook.yml[Kiosk Mode Playbook]
169-
170-
This playbook runs the link:/patterns/ansible-edge-gitops/ansible-automation-platform/#roles-included-in-the-pattern[kiosk_mode
171-
role].
172-
173-
==== https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/podman_playbook.yml[Podman Playbook]
174-
175-
This playbook runs the link:/patterns/ansible-edge-gitops/ansible-automation-platform/#roles-included-in-the-pattern[container_lifecycle
176-
role] with overrides suitable for the Ignition application container.
177-
178-
==== https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/ping.yml[Ping Playbook]
179-
180-
This playbook is for testing basic connectivity - making sure that you can reach the nodes you wish to manage, and that the credentials you
181-
have given will work on them. It will not change anything on the VMs - just gather facts from them (which requires elevating to root).
182-
183-
=== Schedules
184-
185-
==== Update Project AEG GitOps
186-
187-
This job runs every 5 minutes to update the GitOps repository associated with the project. This is necessary when any of the Ansible code (for
188-
example, the playbooks or roles associated with the pattern) changes, so that the new code is available to the AAP instance.
189-
190-
==== Dynamic Provision Kiosk Playbook
191-
192-
This job runs every 10 minutes to provision and configure any kiosks it finds to run the Ignition application in a podman container, and
193-
configure firefox in kiosk mode to display that application. The playbook is designed to be idempotent, so it is safe to run multiple
194-
times on the same targets; it will not make user-visible changes to those targets unless it must.
195-
196-
This playbook combines the link:/patterns/ansible-edge-gitops/ansible-automation-platform/#extra-playbooks-in-the-pattern[inventory_preplay]
197-
and the link:/patterns/ansible-edge-gitops/ansible-automation-platform/#extra-playbooks-in-the-pattern[Provision
198-
Kiosk Playbook].
199-
200-
=== Execution Environment
201-
202-
The pattern includes an execution environment definition that can be found https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/ansible/execution_environment[here].
203-
204-
The execution environment includes some additional collections beyond what is provided in the Default execution environment, including:
205-
206-
* https://linux-system-roles.github.io/[fedora.linux_system_roles]
207-
* https://galaxy.ansible.com/containers/podman[containers.podman]
208-
* https://docs.ansible.com/ansible/latest/collections/community/okd/index.html[community.okd]
209-
210-
The execution environment definition is provided if you want to customize or change it; if so, you should also change the Execution
211-
Environment attributes of the Templates (in the https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/scripts/ansible_load_controller.sh[load
212-
script], those attributes are set by the variables `aap_execution_environment` and `aap_execution_environment_image`).
213-
214-
=== Roles included in the pattern
215-
216-
==== https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/ansible/roles/kiosk_mode[kiosk_mode]
217-
218-
This role is responsible does the following:
219-
220-
* RHEL node registration
221-
* Installation of GUI packages
222-
* Installation of Firefox
223-
* Configuration of Firefox kiosk mode
224-
225-
==== https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/ansible/roles/container_lifecycle[container_lifecycle]
226-
227-
This role is responsible for:
228-
229-
* Downloading and running a podman image on the system (and configure it to auto-update)
230-
* Setting the container up to run at boot time
231-
* Passing any other runtime arguments to the container. In this container’s case, that includes specifying an admin password override.
232-
233-
=== Extra Playbooks in the Pattern
101+
The `ansible_load_controller.sh` script automates the configuration of the Ansible Automation Platform (AAP) by executing a series of Ansible playbooks. These playbooks perform tasks such as retrieving credentials, parsing secrets, and configuring the AAP instance.
234102

235-
==== https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/inventory_preplay.yml[inventory_preplay.yml]
103+
Key components of the configuration process:
236104

237-
This playbook is designed to be included in other plays; its purpose is to discover the desired inventory and add those hosts to inventory at
238-
runtime. It uses a kubernetes query via the cluster-admin kube config file.
105+
* Retrieving AAP Credentials: The script runs the `ansible_get_credentials.yml` playbook to obtain necessary credentials for accessing and managing the AAP instance.
239106

240-
==== https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/ansible/provision_kiosk.yml[Provision Kiosk Playbook]
107+
* Parsing Secrets: It then executes the `parse_secrets_from_values_secret.yml` playbook to extract and process sensitive information stored in the `values_secret.yaml` file, which includes passwords, tokens, or other confidential data required for configuration.
241108

242-
This does the work of provisioning the kiosk, which configures kiosk mode, and also installs Ignition and configures it to start at boot. It
243-
runs the link:/patterns/ansible-edge-gitops/ansible-automation-platform/#roles-included-in-the-pattern[kiosk_mode]
244-
and link:/patterns/ansible-edge-gitops/ansible-automation-platform/#roles-included-in-the-pattern[container_lifecycle]
245-
roles.
109+
* Configuring the AAP Instance: Finally, the script runs the `ansible_configure_controller.yml` playbook to set up and configure the AAP controller based on the retrieved credentials and parsed secrets.

content/patterns/ansible-edge-gitops/getting-started.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,27 @@ This is the username and password that you use to log in to link:https://catalog
154154
base64: true
155155
----
156156

157+
.. Edit the `automation-hub-token` section to include the token generated at the *Load token* link at link:https://console.redhat.com/ansible/automation-hub/token[Automation Hub Token] to generate a token. For example:
158+
+
159+
[source,yaml]
160+
----
161+
- name: automation-hub-token
162+
fields:
163+
- name: token
164+
path: '/path/to/automation-hub-token'
165+
----
166+
167+
.. Optionally: Edit the `agof-vault-file` section to use the following (you do not need additional secrets for this pattern):
168+
+
169+
[source,yaml]
170+
----
171+
- name: agof-vault-file
172+
fields:
173+
- name: agof-vault-file
174+
value: '---'
175+
base64: true
176+
----
177+
157178
. Create and switch to a new branch named `my-branch`, by running the following command:
158179
+
159180
[source,terminal]

content/patterns/ansible-edge-gitops/installation-details.adoc

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,41 +101,20 @@ The script has defaults that are overridden when run as part of make install. Th
101101
OpenShift GitOps is central to this pattern as it is responsible for insalling all of the other components. The installation process is driven through the installation of the
102102
https://github.com/validatedpatterns/common/tree/v1/clustergroup[clustergroup] cart. This in turn reads the repo’s https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/values-global.yaml[global values file], which instructs it to read the https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/values-hub.yaml[hub values file]. This is how the pattern knows to apply the Subscriptions and Applications listed further in the pattern.
103103

104-
== ODF (OpenShift Data Foundations)
105-
106-
ODF is the storage framework that is needed to provide resilient storage for OpenShift Virtualization. It is managed via the helm chart https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/charts/hub/openshift-data-foundations[here].
107-
108-
This is basically the same chart that our Medical Diagnosis pattern uses (see link:/patterns/medical-diagnosis/getting-started/[here] for details on the Medical Edge pattern’s use of storage).
109-
110-
[NOTE]
111-
====
112-
This chart will create a Noobaa S3 bucket named nb.epoch_timestamp.cluster-domain which will not be destroyed when the cluster is destroyed.
113-
====
114-
115104
== OpenShift Virtualization (KubeVirt)
116105

117106
OpenShift Virtualization is a framework for running virtual machines as native Kubernetes resources. While it can run without hardware acceleration, the performance of virtual machines will suffer terribly; some testing on a similar workload indicated a 4-6x delay running without hardware acceleration, so at present this pattern requires hardware acceleration. The pattern provides a script https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/scripts/deploy_kubevirt_worker.sh[deploy-kubevirt-worker.sh] which will provision a metal worker to run virtual machines for the pattern.
118107

119108
OpenShift Virtualization currently supports only AWS and on-prem clusters; this is because of the way that baremetal resources are provisioned in GCP and Azure. We hope that OpenShift Virtualization can support GCP and Azure soon.
120109

121-
The installation of the OpenShift Virtualization HyperConverged deployment is controlled by the chart https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/charts/hub/cnv[here].
122-
123-
OpenShift Virtualization was chosen in this pattern to avoid dealing with the differences in galleries and templates of images between the different public cloud providers. The important thing from this pattern’s standpoint is the availability of machine instances to manage (since we are simulating an Edge deployment scenario, which could either be bare metal instances or virtual machines); OpenShift Virtualization was the easiest and most portable way to spin up machine instances. It also provides mechanisms for defining the desired machine set
124-
declaratively.
125-
126-
The creation of virtual machines is controlled by the chart https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/charts/hub/edge-gitops-vms[here].
127-
128110
More details about the way we use OpenShift Virtualization are available link:/ansible-edge-gitops/openshift-virtualization[here].
129111

130112
== Ansible Automation Platform (AAP, formerly known as Ansible Tower)
131113

132-
The use of Ansible Automation Platform is really the centerpiece of this pattern. We have recognized for some time that the notion and design principles of GitOps should apply to things outside of Kubernetes, andwe believe this pattern gives us a way to do that.
114+
The use of Ansible Automation Platform is really the centerpiece of this pattern. We have recognized for some time that the concept and design principles of GitOps should apply to things outside of Kubernetes, and we believe this pattern gives us a way to do that.
133115

134116
All of the Ansible interactions are defined in a Git Repository; the Ansible jobs that configure the VMs are designed to be idempotent (and are scheduled to run every 10 minutes on those VMs).
135117

136-
The installation of AAP itself is governed by the chart https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/charts/hub/ansible-automation-platform[here].
137-
The post-installation configuration of AAP is done via the https://github.com/validatedpatterns/ansible-edge-gitops/blob/main/scripts/ansible_load_controller.sh[ansible-load-controller.sh] script.
138-
139118
It is very much the intention of this pattern to make it easy to replace the specific Edge management use case with another one. Some ideas on how to do that can be found link:/ansible-edge-gitops/ideas-for-customization/[here].
140119

141120
Specifics of the Ansible content for this pattern can be seen https://github.com/validatedpatterns/ansible-edge-gitops/tree/main/ansible[here].
142 KB
Loading
103 KB
Loading

0 commit comments

Comments
 (0)