Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ansible/ibmcloud-mno-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@
vars:
assisted_installer_host: "{{ hostvars[inventory_hostname]['private_address'] }}"
http_store_host: "{{ hostvars[inventory_hostname]['private_address'] }}"
sno_use_lab_dhcp: false
use_bastion_registry: false
pre_tasks:
- name: Validate deploying MNO
fail:
msg: "cluster_type is not 'mno'"
when: cluster_type != "mno"
roles:
- validate-vars
- ocp-release
- ibmcloud-create-ai-cluster
- create-ai-cluster
- generate-discovery-iso
- role: boot-iso
vars:
Expand Down
13 changes: 10 additions & 3 deletions ansible/ibmcloud-sno-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@
vars:
assisted_installer_host: "{{ hostvars[inventory_hostname]['private_address'] }}"
http_store_host: "{{ hostvars[inventory_hostname]['private_address'] }}"
sno_use_lab_dhcp: false
use_bastion_registry: false
pre_tasks:
- name: Validate deploying SNO
fail:
msg: "cluster_type is not 'sno'"
when: cluster_type != "sno"
roles:
- validate-vars
- ocp-release
- ibmcloud-sno-create-ai-cluster
- create-ai-cluster
- role: generate-discovery-iso
vars:
iso_name: "{{ groups['sno'][1] }}"
iso_name: "{{ groups['sno'][0] }}"
- role: boot-iso
vars:
inventory_group: sno
index: "1"
- sno-wait-hosts-discovered
- wait-hosts-discovered
- configure-local-storage
- install-cluster
- sno-post-cluster-install
21 changes: 14 additions & 7 deletions ansible/roles/create-ai-cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@
path: "/etc/hosts"
backup: true
block: |
{{ hostvars[cluster_name]['ip'] }} api.{{ cluster_name }}.{{ base_dns_name }}
{{ hostvars[cluster_name]['ip'] }} api-int.{{ cluster_name }}.{{ base_dns_name }}
{% if (lab in rh_labs or lab == 'byol') %}
{% set etc_hosts_ip = hostvars[cluster_name]['ip'] %}
{% else %}
{% set etc_hosts_ip = hostvars[cluster_name]['private_address'] %}
{% endif %}
{{ etc_hosts_ip }} api.{{ cluster_name }}.{{ base_dns_name }}
{{ etc_hosts_ip }} api-int.{{ cluster_name }}.{{ base_dns_name }}
{% for route in etc_hosts_ingress_routes %}
{{ hostvars[cluster_name]['ip'] }} {{ route }}.apps.{{ cluster_name }}.{{ base_dns_name }}
{{ etc_hosts_ip }} {{ route }}.apps.{{ cluster_name }}.{{ base_dns_name }}
{% endfor %}
insertafter: "EOF"
marker: "# {mark} {{ cluster_name }} OCP CLUSTER MANAGED BLOCK"
Expand Down Expand Up @@ -99,7 +104,7 @@
"pull_secret": "{{ pull_secret | to_json }}",
"ssh_public_key": "{{ lookup('file', ssh_public_key_file) }}",
"vip_dhcp_allocation": "{{ vip_dhcp_allocation }}",
"additional_ntp_source": "{{ bastion_controlplane_ip if use_bastion_registry else labs[lab]['ntp_server'] }}",
"additional_ntp_source": "{{ bastion_controlplane_ip if (lab in cloud_labs) or use_bastion_registry else labs[lab]['ntp_server'] }}",
"api_vips": [{"ip": "{{ controlplane_network_api }}"}],
"ingress_vips": [{"ip": "{{ controlplane_network_ingress }}"}],
"network_type": "OVNKubernetes"
Expand Down Expand Up @@ -167,7 +172,7 @@
return_content: true
body: {
"name": "{{ cluster_name }}",
"additional_ntp_sources": "{{ bastion_controlplane_ip if use_bastion_registry else labs[lab]['ntp_server'] }}",
"additional_ntp_sources": "{{ bastion_controlplane_ip if (lab in cloud_labs) or use_bastion_registry else labs[lab]['ntp_server'] }}",
"ssh_authorized_key": "{{ lookup('file', ssh_public_key_file) }}",
"pull_secret": "{{ pull_secret | to_json }}",
"static_network_config": "{{ static_network_config }}",
Expand All @@ -194,9 +199,11 @@
when: use_bastion_registry | default(false)

# Disable lab interface manifests, skip if SNO has sno_use_lab_dhcp=true
- name: Include custom manifests to disable the lab interface
- name: Include custom manifests to disable the lab interface (RH Labs & BYOL)
include_tasks: 01_manifest_update.yml
when: (cluster_type == "mno") or (cluster_type == "sno" and not sno_use_lab_dhcp)
when:
- lab in rh_labs or lab == "byol"
- (cluster_type == "mno") or (cluster_type == "sno" and not sno_use_lab_dhcp)
loop:
- file_name: 50-controlplane-disable-lab-dhcp-interface.yaml
template_name: 50-controlplane-disable-lab-dhcp-interface.yml.j2
Expand Down
22 changes: 5 additions & 17 deletions ansible/roles/create-ai-cluster/tasks/static_network_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@
item_network_config:
network_yaml: "{{ lookup('template', 'rhlab_nmstate.yml.j2') }}"
mac_interface_map: "{{ lookup('template', 'rhlab_mac_interface_map.json.j2') }}"
when:
- lab in rh_labs or lab == "byol"
when: lab in rh_labs or lab == "byol"

- name: SNO - Cloud Lab Populate static network configuration
- name: Cloud Lab Populate static network configuration
set_fact:
item_network_config:
- network_yaml: "{{ lookup('template', 'ibmcloud_sno_nmstate.yml.j2') }}"
mac_interface_map: "{{ lookup('template', 'ibmcloud_sno_mac_interface_map.json.j2') }}"
when:
- cluster_type == "sno"
- lab in cloud_labs

- name: MNO - Cloud Lab Populate static network configuration
set_fact:
item_network_config:
network_yaml: "{{ lookup('template', 'ibmcloud_mno_nmstate.yml.j2') }}"
mac_interface_map: "{{ lookup('template', 'ibmcloud_mno_mac_interface_map.json.j2') }}"
when:
- cluster_type == "mno"
- lab in cloud_labs
network_yaml: "{{ lookup('template', 'ibmcloud_nmstate.yml.j2') }}"
mac_interface_map: "{{ lookup('template', 'ibmcloud_mac_interface_map.json.j2') }}"
when: lab in cloud_labs

- name: Add {{ item }} ip config
set_fact:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions ansible/roles/ibmcloud-create-ai-cluster/defaults/main/main.yml

This file was deleted.

This file was deleted.

98 changes: 0 additions & 98 deletions ansible/roles/ibmcloud-create-ai-cluster/tasks/main.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ bmc_password={{ ibm_hardware_detail_b_json.remoteManagementAccounts[0].password
[sno]
# Single Node OpenShift Clusters
{% for sno in ibmcloud_detailed_sno_data.results %}
{{ (sno.stdout | from_json).hostname }} ansible_host={{ (sno.stdout | from_json).primaryBackendIpAddress }} private_address={{ (sno.stdout | from_json).primaryBackendIpAddress }} bond0_macs={{ (((sno.stdout | from_json).networkComponents | selectattr('name', 'eq', 'eth')) | selectattr('port', 'eq', bond0_port1) | first).macAddress }},{{ (((sno.stdout | from_json).networkComponents | selectattr('name', 'eq', 'eth')) | selectattr('port', 'eq', bond0_port2) | first).macAddress }} bmc_address={{ (sno.stdout | from_json).networkManagementIpAddress }} bmc_user={{ (sno.stdout | from_json).remoteManagementAccounts[0].username }} bmc_password={{ (sno.stdout | from_json).remoteManagementAccounts[0].password }} vendor={{ vendor_mapping[(sno.stdout | from_json).hostname] | capitalize }} boot_iso={{ (sno.stdout | from_json).hostname }}.iso install_disk={{ sno_install_disk }}
{% if not loop.first %}# {% endif %}{{ (sno.stdout | from_json).hostname }} ansible_host={{ (sno.stdout | from_json).primaryBackendIpAddress }} private_address={{ (sno.stdout | from_json).primaryBackendIpAddress }} bond0_macs={{ (((sno.stdout | from_json).networkComponents | selectattr('name', 'eq', 'eth')) | selectattr('port', 'eq', bond0_port1) | first).macAddress }},{{ (((sno.stdout | from_json).networkComponents | selectattr('name', 'eq', 'eth')) | selectattr('port', 'eq', bond0_port2) | first).macAddress }} bmc_address={{ (sno.stdout | from_json).networkManagementIpAddress }} bmc_user={{ (sno.stdout | from_json).remoteManagementAccounts[0].username }} bmc_password={{ (sno.stdout | from_json).remoteManagementAccounts[0].password }} vendor={{ vendor_mapping[(sno.stdout | from_json).hostname] | capitalize }} boot_iso={{ (sno.stdout | from_json).hostname }}.iso install_disk={{ sno_install_disk }}
{% endfor %}

[sno:vars]
role=master
{% if controlplane_bastion_as_dns %}
dns1={{ ibm_hardware_detail_b_json.primaryBackendIpAddress }}
{% else %}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading