blob: 3b3d55727256e97cf6645da87d116d901ecc31e6 [file] [log] [blame]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02001resource_registry:
2 "MCP2::NetworkAcc": ../fragments/NetworkAccVM.yaml
3 "MCP2::NetworkPrvFl": ../fragments/NetworkPrvFl.yaml
4 "MCP2::SrvInstances": ../fragments/SrvInstancesVM.yaml
5
sgudzb94b4c62020-02-05 13:21:25 +02006parameters:
sgudzb94b4c62020-02-05 13:21:25 +02007 image: bionic-server-cloudimg-amd64-20190612
sgudzb94b4c62020-02-05 13:21:25 +02008 public_net_id: public
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02009 host_interface: 'ens3'
sgudzb94b4c62020-02-05 13:21:25 +020010 masters_size: 2
11 worker_size: 3
12 cmp_size: 2
13 gtw_size: 3
14 lma_size: 3
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020015 osd_size: 0
sgudzb94b4c62020-02-05 13:21:25 +020016 ucp_boot_timeout: 1200
Vasyl Saienkoa906b062020-02-14 08:58:05 +000017 cluster_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCp0evjOaK8c8SKYK4r2+0BN7g+8YSvQ2n8nFgOURCyvkJqOHi1qPGZmuN0CclYVdVuZiXbWw3VxRbSW3EH736VzgY1U0JmoTiSamzLHaWsXvEIW8VCi7boli539QJP0ikJiBaNAgZILyCrVPN+A6mfqtacs1KXdZ0zlMq1BPtFciR1JTCRcVs5vP2Wwz5QtY2jMIh3aiwkePjMTQPcfmh1TkOlxYu5IbQyZ3G1ahA0mNKI9a0dtF282av/F6pwB/N1R1nEZ/9VtcN2I1mf1NW/tTHEEcTzXYo1R/8K9vlqAN8QvvGLZtZduGviNVNoNWvoxaXxDt8CPv2B2NCdQFZp
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020018 private_floating_network_cidr: '10.11.12.0/24'
19 private_floating_interface: 'ens4'
sgudzb94b4c62020-02-05 13:21:25 +020020 worker_metadata: {"labels": {"openstack-control-plane":"enabled","openvswitch":"enabled","role":"ceph-osd-node"}}
21 cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled", "role":"ceph-osd-node"}}
22 gtw_metadata: {"labels": {"openvswitch":"enabled", "gateway": "enabled"}}
23 lma_metadata: {"labels": {"role": "stacklight", "stacklight": "enabled"}}
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020024 functions_override: |
25 function network_config {
26 PUBLIC_NODE_IP_ADDRESS=${PUBLIC_INTERFACE_IP:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+' | egrep -v "127.0.|172.17")}
27 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)}
28
29 local public_interface=${1:-${PUBLIC_INTERFACE}}
30 local cloud_netplan_cfg="/etc/netplan/50-cloud-init.yaml"
31 local match_ip_line
32
33 DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils atop
34
35 cat << EOF > /etc/systemd/network/10-veth-phy-br.netdev
36 [NetDev]
37 Name=veth-phy
38 Kind=veth
39 [Peer]
40 Name=veth-br
41 EOF
42
43 sed -i 's/.*ethernets:.*/&\n veth-phy: {}/' ${cloud_netplan_cfg}
44 sed -i 's/.*ethernets:.*/&\n veth-br: {}/' ${cloud_netplan_cfg}
45
46 match_ip_line=$(grep -nm1 "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ${cloud_netplan_cfg} | cut -d: -f1)
47
48 sed -i "$((${match_ip_line}-1)),$((${match_ip_line}))d" ${cloud_netplan_cfg}
49
50 cat << EOF >> ${cloud_netplan_cfg}
51 bridges:
52 br-public:
53 dhcp4: false
54 interfaces:
55 - ${PUBLIC_INTERFACE}
56 - veth-br
57 addresses:
58 - ${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}
59 EOF
60 netplan --debug apply
61 }