Create OpenShift assets and move into place

This commit is contained in:
2025-03-22 23:29:34 -05:00
parent 8c00a98ae2
commit 2df2d32696
10 changed files with 125 additions and 72 deletions

View File

@@ -1,15 +1,3 @@
# DNS Provider Configuration
This directory contains the configuration for the DNS provider using FreeIPA.
## Environment Variables
To securely provide the password for the FreeIPA provider, set the following environment variable before running Terraform:
```bash
export TF_VAR_freeipa_password="your_password_here"
```
Replace `your_password_here` with the actual password.
Ensure that this environment variable is set in your shell session or in a secure environment management tool before executing Terraform commands.
This directory contains the configuration to updateFreeIPA DNS for the Hub Cluster.

View File

@@ -1,24 +1,7 @@
# Configure the OpenShift Agent Installer and Matchbox
## Create OpenShift Installation Files
## Reference Document
<https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/epub/installing_an_on-premise_cluster_with_the_agent-based_installer/prepare-pxe-assets-agent#prepare-pxe-assets-agent>
### Downloading the Agent-based Installer
### Create/Modify config files
```bash
cd 10-sno-hub-cluster/02-matchbox
```
- agent-config.yaml
- install-config.yaml
### Run image creation
```bash
openshift-install agent create pxe-files
```
Recap of install in .openshift_install.log
Recap of image creation is in 10-sno-hub-cluster/02-matchbox/.openshift_install.log

View File

@@ -0,0 +1,7 @@
---
- name: OpenShift image creation
ansible.builtin.command:
cmd: /usr/local/bin/openshift-install agent create pxe-files
chdir: 03-matchbox
register: command_result
ignore_errors: yes

View File

@@ -0,0 +1,15 @@
---
- name: Create a directory if it does not exist
ansible.builtin.file:
path: "{{ matchbox_assets }}/{{ hub_cluster_name }}"
state: directory
mode: '0755'
become: true
- name: Copy file with owner and permissions
ansible.builtin.copy:
src: 03-matchbox/boot-artifacts/
dest: "{{ matchbox_assets }}/{{ hub_cluster_name }}/"
owner: matchbox
group: matchbox
become: true

View File

@@ -1,18 +1 @@
# Prepare matchbox to install hub cluster
## Modify config file for OpenShift Automated Installer
- 03-matchbox/install-config
- 03-matchbox/agent-config
## Install Ansible pre-requisites
```bash
ansible-galaxy collection install -r
```
## Run installation playbook
```bash
ansible-playbook install.yml
```
# Moved to other documentation

View File

@@ -4,10 +4,6 @@
connection: local
gather_facts: true
vars_prompt:
- name: freeipa_password
prompt: FreeIPA password for admin user
tasks:
- name: Deploy DNS entries for cluster via Terraform
community.general.terraform:
@@ -19,3 +15,15 @@
- ansible.builtin.include_tasks:
file: 02-dhcp/ip-reservations.yml
- ansible.builtin.include_tasks:
file: 03-matchbox/create-openshift-image.yml
- ansible.builtin.include_tasks:
file: 03-matchbox/move-pxe-assets.yml
- name: Configure Matchbox via Terraform
community.general.terraform:
project_path: 03-matchbox/
state: present
force_init: true

View File

@@ -40,22 +40,7 @@ For the sake of this documentation we'll assume the following:
## Getting Started
### Create your vault file for secrets
### Store your vault password somewhere save
```bash
vi ~/.vault_pass.txt
chmod 644 ~/.vault_pass.txt
```
### Add envireonment variable with location of vault password
Add "export ANSIBLE_VAULT_PASSWORD_FILE=~/.vault_pass.txt" to your shell profile.
```bash
ansible-playbook -i inventory.yaml 10-sno-hub-cluster/install.yml
```
[Step-by-Step Walkthrough](step-by-step.md)
### Hub Cluster
@@ -92,7 +77,7 @@ With everything in its right place, you can now start to declaratively create cl
### Internal Cluster
Two additional bare metal nodes, to be added to Advanced Cluster Management (ACM) running on the SNO Hub. These will be used to create another two HCP clusters.
Two additional bare metal nodes, to be added to Advanced Cluster Management (ACM) running on the SNO Hub. These will be used to create another HCP cluster.
These servers have a BMC interface with Redfish - if not, then you'll need to manually manage the boot and installation of those servers.
This makes it to where you just need 3 bare metal nodes. You could run one HCP Bare Metal cluster with both of the other nodes, but then you have a shared storage requirement that can't be satisfied by ODF since that needs at least 3 nodes.
@@ -101,5 +86,8 @@ This makes it to where you just need 3 bare metal nodes. You could run one HCP B
You'll also either need you just need at least 2 bare metal nodes.
---
## Credits
Credit to Ken Moini as I used his [repo](https://github.com/kenmoini/ztp-for-you-and-me) as the baseline for this project.
- Ken Moini - As I used his [repo](https://github.com/kenmoini/ztp-for-you-and-me) as the baseline for this project.
- Ryan Etten
- Andrew Potozniak

View File

@@ -3,7 +3,12 @@
freeipa_user: "admin"
freeipa_password: "{{ vault_freeipa_password }}"
# Variables for Matchbox
matchbox_assets: "/var/lib/matchbox/assets"
# Variables for 10-sno-hub-cluster
mac_address: "98:b7:85:1e:c6:f1"
ip_address: "10.1.71.10"
hostname: "ocp-hub"
hub_cluster_name: "hub"

76
step-by-step.md Normal file
View File

@@ -0,0 +1,76 @@
# Almost automated step by step walkthrough of full lab deployment
This ~~is~~ *will be* the complete walkthrough of the deployment of my homelab.
- On a PC/laptop, clone this git repo
- Create your vault file for secrets (and store somewhere safe)
```bash
vi ~/.vault_pass.txt
chmod 644 ~/.vault_pass.txt
```
- Add "export ANSIBLE_VAULT_PASSWORD_FILE=~/.vault_pass.txt" to your shell profile.
- Create vault file
```bash
cd homelab/group_vars/all
ansible-vault create vault
```
- Modify ansible variables for your environment
## [Network](00-network/README.md) *Manual*
## [Storage](01-storage/README.md) *Manual*
## [Proxmox](02-proxmox/README.md) *Manual*
## [Unbound DNS](03-unbound-dns/README.md) *Manual*
---
## Build infra01
- Copy .vault_pass.txt from laptop and set env variable
- Clone git repo
- Install ansible required packages
```bash
cd homelab
ansible-galaxy collection install -r
```
## [FreeIPA](04-free-ipa/README.md) *Manual*
## [Templates](05-templates/README.md) *Manual*
## [Matchbox](06-matchbox/README.md) *Manual*
- Downloading the Agent-based Installer
---
## [Hub Cluster](10-sno-hub-cluster/README.md) *In Progress*
### Prepare matchbox to install hub cluster
- Modify config file for OpenShift Automated Installer
(In the future these will be template files and all the customization will be done through Ansible)
- 03-matchbox/install-config
- 03-matchbox/agent-config
```bash
cd homelab
ansible-playbook -i inventory.yml 10-sno-hub-cluster/install.yml
```
## Internal Cluster *TBD*
(Deployed in conjunction with ACM)
## External Cluster *TBD*
(Deployed in conjunction with ACM)