Skip to content
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

Bug 1877854: OpenStack: Support multiple subnets #4093

Merged
merged 1 commit into from Sep 22, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions upi/openstack/bootstrap.yaml
Expand Up @@ -38,5 +38,6 @@
- name: 'Create the bootstrap floating IP'
os_floating_ip:
state: present
nat_destination: "{{ os_network }}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the server might have multiple nics, "nat_destination" forces the floating ip to attach to the os_network

network: "{{ os_external_network }}"
server: "{{ os_bootstrap_server_name }}"
1 change: 1 addition & 0 deletions upi/openstack/common.yaml
Expand Up @@ -8,6 +8,7 @@
- name: 'Compute resource names'
set_fact:
cluster_id_tag: "openshiftClusterID={{ infraID }}"
primary_cluster_network_tag: "{{ infraID }}-primaryClusterNetwork"
os_infra_id: "{{ infraID }}"
os_network: "{{ infraID }}-network"
os_subnet: "{{ infraID }}-nodes"
Expand Down
10 changes: 5 additions & 5 deletions upi/openstack/network.yaml
Expand Up @@ -11,23 +11,23 @@
gather_facts: no

tasks:
- name: 'Create the cluster network'
- name: 'Create the primary cluster network'
os_network:
name: "{{ os_network }}"

- name: 'Set the cluster network tag'
- name: 'Set tags on the primary cluster network'
command:
cmd: "openstack network set --tag {{ cluster_id_tag }} {{ os_network }}"
cmd: "openstack network set --tag {{ primary_cluster_network_tag }} --tag {{ cluster_id_tag }} {{ os_network }}"

- name: 'Create a subnet'
- name: 'Create the primary cluster subnet'
os_subnet:
name: "{{ os_subnet }}"
network_name: "{{ os_network }}"
cidr: "{{ os_subnet_range }}"
allocation_pool_start: "{{ os_subnet_range | next_nth_usable(10) }}"
allocation_pool_end: "{{ os_subnet_range | ipaddr('last_usable') }}"

- name: 'Set the cluster subnet tag'
- name: 'Set tags on primary cluster subnet'
command:
cmd: "openstack subnet set --tag {{ cluster_id_tag }} {{ os_subnet }}"

Expand Down