Updated mac addresses and disabled boot interfaces

This commit is contained in:
2025-07-26 14:51:44 -05:00
parent 5612932691
commit efecef6832
7 changed files with 85 additions and 53 deletions

View File

@@ -1,8 +1,9 @@
cluster_name: "openshift"
cluster_version: "4.18.21"
openshift_installer_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/openshift-install-linux.tar.gz"
openshift_client_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/openshift-client-linux.tar.gz"
# cluster_group: "internal_cluster"
openshift_installer_file: "openshift-install-linux.tar.gz"
openshift_client_file: "openshift-client-linux.tar.gz"
openshift_installer_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_installer_file }}"
openshift_client_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_client_file }}"
worker_node_count: 1
master_node_count: 3
cluster_network: "10.128.0.0/14"

View File

@@ -3,9 +3,10 @@
# OpenShift node
# Networking
primary_interface: "enp1s0f0"
boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:60:52:2d"
install_mac_address: "00:0a:f7:5d:f3:53"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:20:47:22"
ip_address: 10.1.71.61
node_role: "master"

View File

@@ -3,9 +3,10 @@
# OpenShift node
# Networking
primary_interface: "enp1s0f0"
boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:5f:a2:80"
install_mac_address: "98:b7:85:20:47:3b"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:20:47:3a"
ip_address: 10.1.71.62
node_role: "master"

View File

@@ -3,9 +3,10 @@
# OpenShift node
# Networking
primary_interface: "enp1s0f0"
boot_interface: "enp0s31f6"
boot_mac_address: "d8:9e:f3:4c:02:a9"
install_mac_address: "98:b7:85:20:47:23"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:1f:89:cf"
ip_address: 10.1.71.63
node_role: "master"

View File

@@ -3,8 +3,9 @@
# OpenShift node
# Networking
primary_interface: "enp2s0f0"
boot_interface: "enp87s0"
boot_mac_address: "58:47:ca:76:13:49"
primary_interface: "enp2s0f0"
install_mac_address: "58:47:ca:76:13:47"
ip_address: 10.1.71.65
node_role: "worker"

View File

@@ -54,8 +54,14 @@
vars:
cluster_group: "internal_cluster"
download_dir: "/var/cache/openshift-install"
tasks:
- name: Remove previous directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: absent
- name: Create directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
@@ -77,59 +83,75 @@
- name: Create directory for OpenShift Installer files
become: true
ansible.builtin.file:
path: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}"
state: directory
mode: '0755'
owner: root
group: root
- name: Download OpenShift Installer file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_installer_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Check if OpenShift installer file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_installer_file }}"
register: openshift_installer_file
- name: Download OpenShift Client file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_client_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Download and install OpenShift installer package
when: not openshift_installer_file.stat.exists
block:
- name: Download OpenShift Installer file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_installer_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive installer file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Unarchive installer file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Unarchive client file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-client-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy install binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Copy install binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift client file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_client_file }}"
register: openshift_client_file
- name: Copy client binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/oc
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Download and install OpenShift client package
when: not openshift_client_file.stat.exists
block:
- name: Download OpenShift Client file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_client_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive client file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-client-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy client binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/oc
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift image exists
ansible.builtin.stat:

View File

@@ -21,6 +21,11 @@ hosts:
ipv4:
enabled: true
dhcp: true
- name: {{ hostvars[host].boot_interface }}
type: ethernet
state: down
identifier: mac-address
mac-address: {{ hostvars[host].boot_mac_address }}
dns-resolver:
config:
server: