fix variables

This commit is contained in:
2025-03-23 01:32:22 -05:00
parent 4b0dd8f56a
commit 84fe9bdd7b
5 changed files with 26 additions and 17 deletions

View File

@@ -16,8 +16,8 @@
- name: Add host reservation to dnsmasq - name: Add host reservation to dnsmasq
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/dnsmasq.d/hosts.conf path: /etc/dnsmasq.d/hosts.conf
regexp: "^dhcp-host={{ mac_address }}" regexp: "^dhcp-host={{ hostvars['ocp-hub'].mac_address }}"
line: "dhcp-host={{ mac_address }},{{ ip_address }} #{{ hostname }}" line: "dhcp-host={{ hostvars['ocp-hub'].mac_address }},{{ hostvars['ocp-hub'].ip_address }} #{{ hostvars['ocp-hub'].hostname }}"
state: present state: present
become: true become: true

View File

@@ -16,11 +16,15 @@
- ansible.builtin.include_tasks: - ansible.builtin.include_tasks:
file: 02-dhcp/ip-reservations.yml file: 02-dhcp/ip-reservations.yml
- name: Terraform matchbox groups file - name: OpenShift Installer install-config.yaml
ansible.builtin.template: ansible.builtin.template:
src: templates/openshift-installer/install-config.yaml.j2 src: templates/openshift-installer/install-config.yaml.j2
dest: 03-openshift-image/install-config.yaml dest: 03-openshift-image/install-config.yaml
# include_vars: group_vars/hub
- name: OpenShift Installer agent-config.yaml
ansible.builtin.template:
src: templates/openshift-installer/agent-config.yaml.j2
dest: 03-openshift-image/agent-config.yaml
- ansible.builtin.include_tasks: - ansible.builtin.include_tasks:
file: 03-openshift-image/create-openshift-image.yml file: 03-openshift-image/create-openshift-image.yml

View File

@@ -12,8 +12,8 @@ matchbox_rpc_endpoint: "matchbox.int.mk-labs.cloud:8081"
openshift_installer_pull_secret: "{{ vault_pull_secret }}" openshift_installer_pull_secret: "{{ vault_pull_secret }}"
openshift_installer_ssh_key: "{{ vault_ssh_key }}" openshift_installer_ssh_key: "{{ vault_ssh_key }}"
# Variables for 10-sno-hub-cluster # # Variables for 10-sno-hub-cluster
hub_cluster_mac_address: "98:b7:85:1e:c6:f1" # hub_cluster_mac_address: "98:b7:85:1e:c6:f1"
hub_cluster_ip_address: "10.1.71.10" # hub_cluster_ip_address: "10.1.71.10"
hub_cluster_hostname: "ocp-hub" # hub_cluster_hostname: "ocp-hub"
hub_cluster_name: "hub" # hub_cluster_name: "hub"

5
host_vars/ocp-hub/vars Normal file
View File

@@ -0,0 +1,5 @@
---
mac_address: "98:b7:85:1e:c6:f1"
ip_address: "10.1.71.10"
hostname: "ocp-hub"
primary_interface: "enp1s0f0"

View File

@@ -1,22 +1,22 @@
apiVersion: v1alpha1 apiVersion: v1alpha1
kind: AgentConfig kind: AgentConfig
metadata: metadata:
name: hub name: {{ group_vars['hub-cluster'].cluster_name }}
rendezvousIP: 10.1.71.10 rendezvousIP: {{ hostvars['ocp-hub'].ip_address }}
bootArtifactsBaseURL: https://matchbox.int.mk-labs.cloud:8080/assets/hub/ bootArtifactsBaseURL: https://matchbox.int.mk-labs.cloud:8080/assets/hub/
hosts: hosts:
- hostname: hub - hostname: {{ hostvars['ocp-hub'].hostname }}
role: master role: master
interfaces: interfaces:
- name: enp1s0f0 - name: {{ hostvars['ocp-hub'].primary_interface }}
macAddress: 98:B7:85:1E:C6:F1 macAddress: {{ hostvars['ocp-hub'].mac_address }}
networkConfig: networkConfig:
interfaces: interfaces:
- name: enp1s0f0 - name: {{ hostvars['ocp-hub'].primary_interface }}
type: ethernet type: ethernet
state: up state: up
identifier: mac-address identifier: mac-address
mac-address: 98:B7:85:1E:C6:F1 mac-address: {{ hostvars['ocp-hub'].mac_address }}
ipv4: ipv4:
enabled: true enabled: true
dhcp: true dhcp: true
@@ -29,5 +29,5 @@ hosts:
config: config:
- destination: 0.0.0.0/0 - destination: 0.0.0.0/0
next-hop-address: 10.1.71.1 next-hop-address: 10.1.71.1
next-hop-interface: enp1s0f0 next-hop-interface: {{ hostvars['ocp-hub'].primary_interface }}
table-id: 254 table-id: 254