Skip to content

Commit

Permalink
middleware_ocpv documentation change (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
RanabirChakraborty authored Feb 8, 2024
1 parent af3a3c9 commit 63e06e7
Show file tree
Hide file tree
Showing 32 changed files with 168 additions and 166 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===========================================
infra.ocpv_lab Release Notes
infra.middleware_ocpv Release Notes
===========================================

.. contents:: Topics
Expand All @@ -10,4 +10,4 @@ v1.0.0
Release Summary
---------------

This is the first stable release of the ``infra.ocpv_lab`` collection.
This is the first stable release of the ``infra.middleware_ocpv`` collection.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[![CI](https://github.com/redhat-cop/ocpv_lab/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/redhat-cop/ocpv_lab/actions/workflows/ci.yml) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8292/badge)](https://www.bestpractices.dev/en/projects/8292)
[![CI](https://github.com/redhat-cop/middleware_ocpv/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/redhat-cop/middleware_ocpv/actions/workflows/ci.yml) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8292/badge)](https://www.bestpractices.dev/en/projects/8292)

# Ansible Middleware OpenShift Virtualization Lab
# Middleware Ansible Middleware OpenShift Virtualization collection

Using OpenShift Virtualization as an environment for hosting Virtual Machines that are provisioned, configured and maintained using Ansible and tooling from the Ansible Middleware project.

## Use case of ocpv_lab
## Use case of middleware_ocpv collection

The `infra.ocpv_lab` collection demonstrates the use of Ansible automation to manage both the lifecycle of Virtual Machines within an OpenShift Virtualization runtime environment as well as the installation, configuration and management of deployed instances with JBoss Enterprise Application Server (EAP).
The `infra.middleware_ocpv` collection uses Ansible automation to manage both the lifecycle of Virtual Machines within an OpenShift Virtualization runtime environment as well as the installation, configuration and management of deployed instances with JBoss Enterprise Application Server (EAP).

The integration with OpenShift Virtualization illustrates how Virtual Machines within this dynamic and scalable environment can be managed similarly as other hosting environment and as Red Hat Application Services instances are a common type of workload, the use of Ansible automation showcases just how easy it is to deploy and manage an entire fleet of instances.

## Environment Requirements

For this lab, the following resources must be available:
For this collection, the following resources must be available:

* OpenShift Container Platform
* Capable of running OpenShift Virtualization ([Requirements](https://docs.openshift.com/container-platform/4.12/virt/install/preparing-cluster-for-virt.html#virt-hardware-os-requirements_preparing-cluster-for-virt))
* `cluster-admin` access
* Ansible Controller (Part of Ansible Automation Platform) deployed to the same OpenShift environment as OpenShift Virtualization.
* Control Node capable of provisioning the lab environment
* Control Node capable of provisioning the collection environment
* Ansible

## Prerequisites

Certain requirements must be met prior to realizing the full potential of this lab. This involves not only completing steps within a local machine (control host), but also obtaining assets from external systems.
Certain requirements must be met prior to realizing the full potential of this collection. This involves not only completing steps within a local machine (control host), but also obtaining assets from external systems.

### Clone the Repository

Tooling is available within this repository to provision the lab. Clone the repository to your local machine:
Tooling is available within this repository to provision the collection. Clone the repository to your local machine:

```shell
git clone https://github.com/ansible-middleware/ocpv_lab.git
cd ocpv_lab
git clone https://github.com/redhat-cop/middleware_ocpv.git
cd middleware_ocpv
```

### SSH Keypair
Expand All @@ -51,7 +51,7 @@ The token must be added to two (2) locations:

### Red Hat Service Account

A Service Account as the associated Client ID and Client Secret must be provided so that the Runtimes assets can be generated from the Red Hat Customer Portal.
A Service Account as the associated Client ID and Client Secret must be provided so that the middleware assets can be generated from the Red Hat Customer Portal.

Obtain a Client ID and Client Secret by generating a Service Account [here](https://console.redhat.com/application-services/service-accounts).

Expand All @@ -63,7 +63,7 @@ The provisioned Virtual Machine will be subscribed so that it can obtain the req

### Ansible Controller

The provisioning process will configure Ansible Controller to manage the lab. The location of Controller as well as credentials must be specified. Set the `controller_hostname`, `controller_username` and `controller_password` variables in the [vars/provision.yml](vars/provision.yml) file.
The provisioning process will configure Ansible Controller to manage the collection. The location of Controller as well as credentials must be specified. Set the `controller_hostname`, `controller_username` and `controller_password` variables in the [vars/provision.yml](vars/provision.yml) file.

### Python Dependencies

Expand All @@ -81,9 +81,9 @@ Install the required Ansible dependencies by executing the following command fro
ansible-galaxy collection install -r requirements.yml
```

## Provision the lab
## Provision the collection

Provisioning the lab performs the following actions:
Provisioning the collection performs the following actions:

* Configures Ansible Controller
* Custom Credential Types
Expand All @@ -93,21 +93,21 @@ Provisioning the lab performs the following actions:
* Inventory
* Job Templates
* Deploy OCPv
* Deploy lab
* Deploy collection

Ensure that you are logged into the OpenShift environment with a user with `cluster-admin` permissions and execute the following command:

```shell
ansible-playbook playbooks/provision.yml
```

## Executing the lab
## Executing the collection

Once the configuration of Ansible Controller has completed successfully, login to Ansible Controller and navigate to the **Templates** tab underneath _Resources_.

Deploy OpenShift Virtualization by selecting the rocketship next to the _Deploy OCPv_ Job Template to install and configure OpenShift Virtualization.

Once OpenShift Virtualization has been installed, execute the lab. The lab provisioning process will perform the following actions:
Once OpenShift Virtualization has been installed, execute the collection playbook. The collection provisioning process will perform the following actions:

1. Create a new OpenShift namespace called `ansible-middleware-ocpv`.
2. Create a RHEL 9 based Virtual Machine
Expand All @@ -122,12 +122,12 @@ Once the automation has completed successfully, navigate to the `ansible-middlew

Within Administrator perspective, expand the _Networking_ navigation pane on the left-hand side and select **Routes**.

Select the **eap-lab** route which will open the exposed VM and present the JBoss EAP welcome page.
Select the **eap-collection** route which will open the exposed VM and present the JBoss EAP welcome page.

Navigate to the `/info` context to view the deployed application.

Enjoy seeing the power of Ansible Middleware setup, configure and automate the deployment of Red Hat Runtimes within the OpenShift Container Platform!
Enjoy seeing the power of Ansible Middleware setup, configure and automate the deployment of Red Hat middleware within the OpenShift Container Platform!

# License

[Apache License Version 2.0](https://github.com/ansible-middleware/ocpv_lab/blob/main/LICENSE)
[Apache License Version 2.0](https://github.com/redhat-cop/middleware_ocpv/blob/main/LICENSE)
2 changes: 1 addition & 1 deletion collections/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
collections:
- name: redhat.eap
- name: community.general
- name: https://github.com/ansible-middleware/common
- name: https://github.com/redhat-cop/common
version: main
type: git
10 changes: 5 additions & 5 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace: infra
name: ocpv_lab
name: middleware_ocpv
version: "1.0.0"
readme: README.md
authors:
Expand All @@ -15,15 +15,15 @@ tags:
- application
- kubernetes
- openshift
- runtimes
- middleware
- middleware
- a4mw
dependencies:
ansible.posix: '>=1.4.0'
kubernetes.core: '>=2.4.0'
repository: https://github.com/ansible-middleware/ocpv_lab
homepage: https://github.com/ansible-middleware/ocpv_lab
issues: https://github.com/ansible-middleware/ocpv_lab/issues
repository: https://github.com/redhat-cop/middleware_ocpv
homepage: https://github.com/redhat-cop/middleware_ocpv
issues: https://github.com/redhat-cop/middleware_ocpv/issues
build_ignore:
- collections
- .gitignore
Expand Down
6 changes: 3 additions & 3 deletions playbooks/deploy_lab.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
- name: Deploy lab
- name: Deploy collection
hosts: localhost
gather_facts: false
tasks:
- name: Configure OpenShift
ansible.builtin.include_role:
name: deploy_lab
name: deploy_collection
tasks_from: configure-ocp.yml

- name: K8s Discovery
Expand All @@ -17,5 +17,5 @@
tasks:
- name: Configure VM
ansible.builtin.include_role:
name: redhat.eap.deploy_lab
name: redhat.eap.deploy_collection
tasks_from: configure-vm.yml
16 changes: 8 additions & 8 deletions roles/configure_aap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ configure_aap
=========

Configurations to prepare Ansible Automation Platform for use managing the assets related to the Ansible Middleware
OpenShift Virtualization Lab.
OpenShift Virtualization collection.

Role Variables
--------------
Expand All @@ -25,16 +25,16 @@ Role Variables
| `aap_inventory_ocpv_name` | `OCPV name` | `ocpv` |
| `aap_inventory_ocpv_eap_name` | `OCPV EAP name` | `eap` |
| `aap_template_deploy_ocp_playbook` | `path of OCPV install playbook` | `playbooks/install_ocpv.yml` |
| `aap_template_deploy_lab_playbook` | `path of lab deploy playbook` | `playbooks/deploy_lab.yml` |
| `aap_project_ocpv_name` | `OCPV lab name` | `ocpv_lab` |
| `aap_project_ocpv_git_url` | `OCPV dmeo GitHub url` | `https://github.com/ansible-middleware/ocpv_lab.git` |
| `aap_project_ocpv_git_branch` | `OCPV lab branch name` | `main` |
| `aap_template_deploy_collection_playbook` | `path of collection deploy playbook` | `playbooks/deploy_collection.yml` |
| `aap_project_ocpv_name` | `OCPV collection name` | `middleware_ocpv` |
| `aap_project_ocpv_git_url` | `OCPV dmeo GitHub url` | `https://github.com/redhat-cop/middleware_ocpv.git` |
| `aap_project_ocpv_git_branch` | `OCPV collection branch name` | `main` |
| `automationhub_server_url` | `Automation Hub server URL` | `https://cloud.redhat.com/api/automation-hub/ ` |
| `automationhub_auth_server_url` | `Automation Hub authentication server url` | `https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token` |
| `ocpv_ssh_user` | `OCPV ssh username` | `cloud-user` |
| `aap_organization` | `AAP organization name` | `Default` |
| `lab_namespace` | `OCPV lab namespace` | `ansible-middleware-ocpv` |
| `lab_name` | `deployed lab name` | `eap-lab` |
| `collection_namespace` | `OCPV collection namespace` | `ansible-middleware-ocpv` |
| `collection_name` | `deployed collection name` | `eap-collection` |

Dependencies
------------
Expand All @@ -49,7 +49,7 @@ Example Playbook
License
-------

[Apache License Version 2.0](https://github.com/ansible-middleware/ocpv_lab/blob/main/LICENSE)
[Apache License Version 2.0](https://github.com/redhat-cop/middleware_ocpv/blob/main/LICENSE)

Author Information
------------------
Expand Down
10 changes: 5 additions & 5 deletions roles/configure_aap/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ aap_inventory_ocpv_name: ocpv
aap_inventory_ocpv_eap_name: eap

aap_template_deploy_ocp_playbook: playbooks/install_ocpv.yml
aap_template_deploy_lab_playbook: playbooks/deploy_lab.yml
aap_template_deploy_collection_playbook: playbooks/deploy_collection.yml


aap_project_ocpv_name: ocpv_lab
aap_project_ocpv_git_url: https://github.com/ansible-middleware/ocpv_lab.git
aap_project_ocpv_name: middleware_ocpv
aap_project_ocpv_git_url: https://github.com/redhat-cop/middleware_ocpv.git
aap_project_ocpv_git_branch: main

automationhub_server_url: "https://cloud.redhat.com/api/automation-hub/"
Expand All @@ -34,5 +34,5 @@ ocpv_ssh_user: cloud-user

aap_organization: Default

lab_namespace: ansible-middleware-ocpv
lab_name: eap-lab
collection_namespace: ansible-middleware-ocpv
collection_name: eap-collection
2 changes: 1 addition & 1 deletion roles/configure_aap/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
issue_tracker_url: https://github.com/ansible-middleware/ocpv_lab/issues
issue_tracker_url: https://github.com/redhat-cop/middleware_ocpv/issues

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
Expand Down
8 changes: 4 additions & 4 deletions roles/configure_aap/vars/controller-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ controller_hosts:
ansible_python_interpreter: "{ { ansible_playbook_python }}"
k8s_discovered_resources:
- inventory_group_name: "{{ aap_inventory_ocpv_eap_name }}"
namespace: "{{ lab_namespace }}"
namespace: "{{ collection_namespace }}"
label_selectors:
- "kubevirt.io/domain={{ lab_name }}"
- "kubevirt.io/domain={{ collection_name }}"
controller_groups:
- name: "{{ aap_inventory_ocpv_eap_name }}"
inventory: "{{ aap_inventory_ocpv_name }}"
Expand All @@ -141,7 +141,7 @@ controller_templates:
project: "{{ aap_project_ocpv_name }}"
playbook: "{{ aap_template_deploy_ocp_playbook }}"
inventory: "{{ aap_inventory_ocpv_name }}"
- name: Deploy lab
- name: Deploy collection
job_type: run
organization: "{{ aap_organization }}"
credentials:
Expand All @@ -151,7 +151,7 @@ controller_templates:
- "{{ aap_credential_publickey_name }}"
- "{{ aap_credential_redhat_csp_name }}"
project: "{{ aap_project_ocpv_name }}"
playbook: "{{ aap_template_deploy_lab_playbook }}"
playbook: "{{ aap_template_deploy_collection_playbook }}"
inventory: "{{ aap_inventory_ocpv_name }}"
extra_vars:
eap_archive_dir: /tmp/eap_archive/
Expand Down
File renamed without changes.
Loading

0 comments on commit 63e06e7

Please sign in to comment.