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_name: "openshift"
cluster_version: "4.18.21" 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_installer_file: "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" openshift_client_file: "openshift-client-linux.tar.gz"
# cluster_group: "internal_cluster" 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 worker_node_count: 1
master_node_count: 3 master_node_count: 3
cluster_network: "10.128.0.0/14" cluster_network: "10.128.0.0/14"

View File

@@ -3,9 +3,10 @@
# OpenShift node # OpenShift node
# Networking # Networking
primary_interface: "enp1s0f0" boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:60:52:2d" 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 ip_address: 10.1.71.61
node_role: "master" node_role: "master"

View File

@@ -3,9 +3,10 @@
# OpenShift node # OpenShift node
# Networking # Networking
primary_interface: "enp1s0f0" boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:5f:a2:80" 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 ip_address: 10.1.71.62
node_role: "master" node_role: "master"

View File

@@ -3,9 +3,10 @@
# OpenShift node # OpenShift node
# Networking # Networking
primary_interface: "enp1s0f0" boot_interface: "enp0s31f6"
boot_mac_address: "d8:9e:f3:4c:02:a9" 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 ip_address: 10.1.71.63
node_role: "master" node_role: "master"

View File

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

View File

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

View File

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