-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public VLAN deployment for SNO clusters #576
base: main
Are you sure you want to change the base?
Changes from all commits
9b44de4
c8ccbb7
7d12bf6
a970ada
a384d80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
[all:vars] | ||
allocation_node_count={{ ocpinventory.json.nodes | length }} | ||
supermicro_nodes={{ has_supermicro | bool }} | ||
{% if public_vlan %} | ||
cluster_name={{ cluster_name }} | ||
controlplane_network={{ controlplane_network }} | ||
{% if lab == "scalelab" %} | ||
base_dns_name=rdu2.scalelab.redhat.com | ||
{% elif lab == "performancelab" %} | ||
base_dns_name=rdu3.labs.perfscale.redhat.com | ||
{% else %} | ||
base_dns_name={{ base_dns_name }} | ||
{% endif %} | ||
{% endif %} | ||
|
||
[bastion] | ||
{{ bastion_machine }} ansible_ssh_user=root bmc_address=mgmt-{{ bastion_machine }} | ||
|
@@ -31,11 +42,11 @@ bmc_password={{ bmc_password }} | |
{%- if use_bastion_registry -%} | ||
{%- set ip=controlplane_network | ansible.utils.nthhost(loop.index0 + 5) -%} | ||
{%- elif public_vlan | bool -%} | ||
{%- set ip=controlplane_pub_network_cidr | ansible.utils.nthhost(loop.index0 + 1) -%} | ||
{%- set ip=controlplane_network | ansible.utils.nthhost(loop.index0 + 3) -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating this expression to pick the 3rd IP of the subnet, which is the one that has the API DNS entry, for example:
|
||
{%- else -%} | ||
{%- set ip=(sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first).json.ip -%} | ||
{%- endif -%} | ||
{% if not loop.first %}# {% endif %}{{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }} bmc_address={{ sno.pm_addr }} boot_iso={{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }}.iso ip={{ ip }} vendor={{ hw_vendor[(sno.pm_addr.split('.')[0]).split('-')[-1]] }} lab_mac={{ (sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first) | json_query(mac_query) | join(', ') }} mac_address={{ sno.mac[controlplane_network_interface_idx] }} install_disk={{ sno_install_disk }} | ||
{% if not loop.first %}# {% endif %}{{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }} bmc_address={{ sno.pm_addr }} boot_iso={{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }}.iso ip={{ ip }} vendor={{ hw_vendor[(sno.pm_addr.split('.')[0]).split('-')[-1]] }} lab_mac={{ (sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first) | json_query(mac_query) | join(', ') }} mac_address={{ sno.mac[controlplane_network_interface_idx|int] }} install_disk={{ sno_install_disk }} | ||
{% endfor %} | ||
|
||
[sno:vars] | ||
|
@@ -47,7 +58,7 @@ network_interface={{ controlplane_network_interface }} | |
gateway={{ controlplane_network_gateway }} | ||
{% endif %} | ||
{% if public_vlan %} | ||
network_prefix={{ controlplane_pub_network_cidr | ipaddr('prefix') }} | ||
network_prefix={{ controlplane_network_prefix }} | ||
{% elif use_bastion_registry %} | ||
network_prefix={{ controlplane_network | ipaddr('prefix') }} | ||
{% endif %} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,7 @@ | |
- network_yaml: "{{ lookup('template', 'nmstate.yml.j2') }}" | ||
mac_interface_map: "{{ lookup('template', 'mac_interface_map.json.j2') }}" | ||
when: | ||
- lab in rh_labs | ||
- use_bastion_registry | ||
- lab in rh_labs and (use_bastion_registry or public_vlan) | ||
|
||
- name: (Cloud lab) Assemble SNO static network config | ||
set_fact: | ||
|
@@ -17,6 +16,9 @@ | |
mac_interface_map: "{{ lookup('template', 'ibmcloud_mac_interface_map.json.j2') }}" | ||
when: lab in cloud_labs | ||
|
||
- debug: | ||
var: cluster_network_cidr | ||
- debug: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like an extra empty debug tasks made it here. |
||
- name: Create SNO cluster | ||
uri: | ||
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters" | ||
|
@@ -25,7 +27,7 @@ | |
status_code: [201] | ||
return_content: true | ||
body: { | ||
"name": "{{ hostvars[item].inventory_hostname }}", | ||
"name": "{{ cluster_name }}", | ||
"openshift_version": "{{ openshift_version }}", | ||
"high_availability_mode": "None", | ||
"base_dns_domain": "{{ base_dns_name }}", | ||
|
@@ -78,7 +80,7 @@ | |
} | ||
when: use_bastion_registry | ||
|
||
- name: Patch infra-env for cloud labs with static network config | ||
- name: Patch infra-env for labs with static network config | ||
uri: | ||
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}" | ||
method: PATCH | ||
|
@@ -88,7 +90,7 @@ | |
body: { | ||
"static_network_config": "{{ static_network_config }}" | ||
} | ||
when: lab in cloud_labs | ||
when: lab in cloud_labs or public_vlan | ||
|
||
- name: Append cluster ids | ||
set_fact: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,9 +74,6 @@ use_bastion_registry: false | |
# Network configuration for all mno cluster nodes | ||
controlplane_lab_interface: eno1np0 | ||
|
||
# Network configuration for public VLAN based sno cluster_type deployment | ||
controlplane_pub_network_cidr: | ||
controlplane_pub_network_gateway: | ||
Comment on lines
-77
to
-79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, I'd like to remove any other vars we can to reduce confusion from the all.sample.yml. 👍 |
||
jumbo_mtu: false | ||
|
||
################################################################################ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there are only 2 cluster types (mno and sno) do you think we should just have
when: public_vlan
?