Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 1 | resource_registry: |
| 2 | "MCP2::NetworkAcc": ../fragments/NetworkAccVM.yaml |
| 3 | "MCP2::NetworkPrvFl": ../fragments/NetworkPrvFl.yaml |
| 4 | "MCP2::SrvInstances": ../fragments/SrvInstancesVM.yaml |
| 5 | |
sgudz | b94b4c6 | 2020-02-05 13:21:25 +0200 | [diff] [blame] | 6 | parameters: |
sgudz | b94b4c6 | 2020-02-05 13:21:25 +0200 | [diff] [blame] | 7 | image: bionic-server-cloudimg-amd64-20190612 |
sgudz | fe58e8a | 2020-02-11 13:31:40 +0200 | [diff] [blame] | 8 | ucp_flavor: system.compact.openstack.control |
| 9 | masters_flavor: system.compact.openstack.control |
| 10 | workers_flavor: system.compact.openstack.control |
| 11 | cmps_flavor: system.virtual.openstack.compute |
| 12 | gtws_flavor: system.compact.openstack.gateway |
| 13 | lmas_flavor: system.compact.stacklight.server |
| 14 | osds_flavor: system.virtual.ceph.osd |
sgudz | b94b4c6 | 2020-02-05 13:21:25 +0200 | [diff] [blame] | 15 | public_net_id: public |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 16 | host_interface: 'ens3' |
sgudz | b94b4c6 | 2020-02-05 13:21:25 +0200 | [diff] [blame] | 17 | masters_size: 2 |
| 18 | worker_size: 3 |
| 19 | cmp_size: 2 |
| 20 | gtw_size: 3 |
| 21 | lma_size: 3 |
| 22 | osd_size: 3 |
| 23 | ucp_boot_timeout: 1200 |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 24 | cluster_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCp0evjOaK8c8SKYK4r2+0BN7g+8YSvQ2n8nFgOURCyvkJqOHi1qPGZmuN0CclYVdVuZiXbWw3VxRbSW3EH736VzgY1U0JmoTiSamzLHaWsXvEIW8VCi7boli539QJP0ikJiBaNAgZILyCrVPN+A6mfqtacs1KXdZ0zlMq1BPtFciR1JTCRcVs5vP2Wwz5QtY2jMIh3aiwkePjMTQPcfmh1TkOlxYu5IbQyZ3G1ahA0mNKI9a0dtF282av/F6pwB/N1R1nEZ/9VtcN2I1mf1NW/tTHEEcTzXYo1R/8K9vlqAN8QvvGLZtZduGviNVNoNWvoxaXxDt8CPv2B2NCdQFZp |
| 25 | private_floating_network_cidr: '10.11.12.0/24' |
| 26 | private_floating_interface: 'ens4' |
sgudz | b94b4c6 | 2020-02-05 13:21:25 +0200 | [diff] [blame] | 27 | worker_metadata: {"labels": {"openstack-control-plane":"enabled","openvswitch":"enabled"}} |
| 28 | cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled",}} |
| 29 | gtw_metadata: {"labels": {"openvswitch":"enabled", "gateway": "enabled"}} |
| 30 | lma_metadata: {"labels": {"role": "stacklight", "stacklight": "enabled"}} |
| 31 | osd_metadata: {"labels": {"role": "ceph-osd-node"}} |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 32 | functions_override: | |
| 33 | function network_config { |
| 34 | PUBLIC_NODE_IP_ADDRESS=${PUBLIC_INTERFACE_IP:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+' | egrep -v "127.0.|172.17")} |
| 35 | PUBLIC_NODE_IP_NETMASK=${PUBLIC_INTERFACE_NETMASK:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+\/[\d]+' | egrep -v "127.0.|172.17" | cut -d'/' -f2)} |
| 36 | |
| 37 | local public_interface=${1:-${PUBLIC_INTERFACE}} |
| 38 | local cloud_netplan_cfg="/etc/netplan/50-cloud-init.yaml" |
| 39 | local match_ip_line |
| 40 | |
| 41 | DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils atop |
| 42 | |
| 43 | cat << EOF > /etc/systemd/network/10-veth-phy-br.netdev |
| 44 | [NetDev] |
| 45 | Name=veth-phy |
| 46 | Kind=veth |
| 47 | [Peer] |
| 48 | Name=veth-br |
| 49 | EOF |
| 50 | |
| 51 | sed -i 's/.*ethernets:.*/&\n veth-phy: {}/' ${cloud_netplan_cfg} |
| 52 | sed -i 's/.*ethernets:.*/&\n veth-br: {}/' ${cloud_netplan_cfg} |
| 53 | |
| 54 | match_ip_line=$(grep -nm1 "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ${cloud_netplan_cfg} | cut -d: -f1) |
| 55 | |
| 56 | sed -i "$((${match_ip_line}-1)),$((${match_ip_line}))d" ${cloud_netplan_cfg} |
| 57 | |
| 58 | cat << EOF >> ${cloud_netplan_cfg} |
| 59 | bridges: |
| 60 | br-public: |
| 61 | dhcp4: false |
| 62 | interfaces: |
| 63 | - ${PUBLIC_INTERFACE} |
| 64 | - veth-br |
| 65 | addresses: |
| 66 | - ${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK} |
| 67 | EOF |
| 68 | netplan --debug apply |
| 69 | } |