-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create the br-lbaas network automatically (#27)
This will create the bridge network, set up the veth pairs, and use the values to configure a subsequent os-octavia run
- Loading branch information
Showing
10 changed files
with
179 additions
and
156 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
--- | ||
# Copyright 2017, Rackspace US, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
- name: Load openstack_user_config.yml and create network entry | ||
set_fact: | ||
octavia_net: "{{ lookup('file', '/etc/openstack_deploy/openstack_user_config.yml')|from_yaml }}" | ||
network: | ||
network: | ||
container_bridge: br-lbaas | ||
container_type: veth | ||
container_interface: eth14 | ||
host_bind_override: eth14 | ||
ip_from_q: lbaas | ||
type: raw | ||
net_name: lbaas | ||
group_binds: | ||
- octavia-worker | ||
- octavia-housekeeping | ||
- octavia-health-manager | ||
|
||
- name: Prepare lbaas cidr, used-ips, and provider networks | ||
set_fact: | ||
cidr_networks: "{{ octavia_net.cidr_networks|combine({'lbaas': br_lbaas_prefix+'.0/22'}) }}" | ||
used_ips: "{{ octavia_net.used_ips + [br_lbaas_prefix+'.1,'+br_lbaas_prefix+'.50', br_lbaas_prefix+'.100'] }}" | ||
provider_networks: '{{ octavia_net.global_overrides.provider_networks + [network] }}' | ||
|
||
- name: Combine cidr_networks | ||
set_fact: | ||
octavia_net: "{{ octavia_net|combine({'cidr_networks':cidr_networks}) }}" | ||
|
||
- name: Combine used_ips | ||
set_fact: | ||
octavia_net: "{{ octavia_net|combine({'used_ips':used_ips}) }}" | ||
|
||
- name: Combine provider_network | ||
set_fact: | ||
global_overrides: "{{ octavia_net.global_overrides|combine({'provider_networks':provider_networks}) }}" | ||
|
||
- name: Combine global_overrides | ||
set_fact: | ||
octavia_net: "{{ octavia_net|combine({'global_overrides':global_overrides}) }}" | ||
|
||
- name: Write massaged network definiton back to openstack_user_config | ||
copy: | ||
dest: /etc/openstack_deploy/openstack_user_config.yml | ||
backup: yes | ||
content: "---\n{{ octavia_net | to_nice_yaml }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
--- | ||
# Copyright 2017, Rackspace US, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
- name: Write bridge definition | ||
copy: | ||
dest: /etc/network/interfaces.d/br-lbaas.cfg | ||
content: | | ||
auto br-lbaas | ||
iface br-lbaas inet static | ||
post-up /usr/local/bin/configure_br-lbaas_veth.sh | ||
bridge_stp off | ||
bridge_waitport 0 | ||
bridge_fd 0 | ||
bridge_ports none | ||
address {{ br_lbaas_prefix }}.100 | ||
netmask 255.255.252.0 | ||
offload-sg off | ||
- name: Create post-up script | ||
template: | ||
src: 'templates/configure_br-lbaas_veth.sh.j2' | ||
dest: '/usr/local/bin/configure_br-lbaas_veth.sh' | ||
mode: '0775' | ||
|
||
- name: Bring up interface | ||
command: "ifup br-lbaas" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
VLAN_ID={{ vlan_id }} | ||
|
||
# This sets up the link | ||
ip link add v-br-vlan type veth peer name v-br-lbaas | ||
ip link add link v-br-lbaas name v-br-lbaas.{{ vlan_id }} type vlan id {{ vlan_id }} | ||
ip link set v-br-vlan up | ||
ip link set v-br-lbaas up | ||
ip link set v-br-lbaas.{{ vlan_id }} up | ||
brctl addif br-lbaas v-br-lbaas.{{ vlan_id }} | ||
brctl addif br-vlan v-br-vlan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters