diff --git a/10-sno-hub-cluster/01-dns/README.md b/10-sno-hub-cluster/01-dns/README.md index 68c67d9..90b034d 100644 --- a/10-sno-hub-cluster/01-dns/README.md +++ b/10-sno-hub-cluster/01-dns/README.md @@ -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. diff --git a/10-sno-hub-cluster/03-matchbox/README.md b/10-sno-hub-cluster/03-matchbox/README.md index 145611a..e8786db 100644 --- a/10-sno-hub-cluster/03-matchbox/README.md +++ b/10-sno-hub-cluster/03-matchbox/README.md @@ -1,24 +1,7 @@ # Configure the OpenShift Agent Installer and Matchbox -## Create OpenShift Installation Files +## Reference Document -### 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 diff --git a/10-sno-hub-cluster/03-matchbox/create-openshift-image.yml b/10-sno-hub-cluster/03-matchbox/create-openshift-image.yml new file mode 100644 index 0000000..bce4fae --- /dev/null +++ b/10-sno-hub-cluster/03-matchbox/create-openshift-image.yml @@ -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 diff --git a/10-sno-hub-cluster/03-matchbox/move-pxe-assets.yml b/10-sno-hub-cluster/03-matchbox/move-pxe-assets.yml new file mode 100644 index 0000000..fe761fd --- /dev/null +++ b/10-sno-hub-cluster/03-matchbox/move-pxe-assets.yml @@ -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 diff --git a/10-sno-hub-cluster/README.md b/10-sno-hub-cluster/README.md index 0c04332..4067368 100644 --- a/10-sno-hub-cluster/README.md +++ b/10-sno-hub-cluster/README.md @@ -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 diff --git a/10-sno-hub-cluster/install.yml b/10-sno-hub-cluster/install.yml index 00c0df2..4e22a79 100644 --- a/10-sno-hub-cluster/install.yml +++ b/10-sno-hub-cluster/install.yml @@ -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 diff --git a/README.md b/README.md index 7d49aab..42c5e17 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/group_vars/all/vars b/group_vars/all/vars index 9ace6b1..6f0f40d 100644 --- a/group_vars/all/vars +++ b/group_vars/all/vars @@ -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" diff --git a/10-sno-hub-cluster/requirements.yml b/requirements.yml similarity index 100% rename from 10-sno-hub-cluster/requirements.yml rename to requirements.yml diff --git a/step-by-step.md b/step-by-step.md new file mode 100644 index 0000000..893654e --- /dev/null +++ b/step-by-step.md @@ -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)