blob: 86540053a08886ec89bbbf6919445084a309c690 [file] [log] [blame]
Oleh Hryhorov207137d2021-04-13 12:03:39 +03001resource_registry:
2 "MCP2::CentralSite": ../fragments/multirack/CentralSite.yaml
3 "MCP2::Rack": ../fragments/multirack/Rack.yaml
4 "MCP2::RackRouterRoutes": ../fragments/multirack/RackRouterRoutes.yaml
5
6parameters:
7 image: bionic-server-cloudimg-amd64-20190612
8 public_net_id: public
9 main_worker_size: 5
10 rack01_cmp_size: 2
11 rack02_cmp_size: 2
12 cluster_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCp0evjOaK8c8SKYK4r2+0BN7g+8YSvQ2n8nFgOURCyvkJqOHi1qPGZmuN0CclYVdVuZiXbWw3VxRbSW3EH736VzgY1U0JmoTiSamzLHaWsXvEIW8VCi7boli539QJP0ikJiBaNAgZILyCrVPN+A6mfqtacs1KXdZ0zlMq1BPtFciR1JTCRcVs5vP2Wwz5QtY2jMIh3aiwkePjMTQPcfmh1TkOlxYu5IbQyZ3G1ahA0mNKI9a0dtF282av/F6pwB/N1R1nEZ/9VtcN2I1mf1NW/tTHEEcTzXYo1R/8K9vlqAN8QvvGLZtZduGviNVNoNWvoxaXxDt8CPv2B2NCdQFZp
13 tunnel_interface: 'ens3'
14 main_worker_metadata: {"labels": {"openstack-control-plane":"enabled","openvswitch":"enabled","openstack-gateway": "enabled","role":"ceph-osd-node","local-volume-provisioner": "enabled"}}
15 rack01_cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled"}}
16 rack02_cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled"}}
17 # hardware_metadata which is used for Ceph requires flavor with
18 # ephemeral storage because it is used for Ceph bluestore.
19 main_worker_flavor: 'system.compact.openstack.control.ephemeral'
20 rack01_cmp_flavor: 'system.compact.openstack.control.ephemeral'
21 docker_ucp_image: docker-dev-kaas-local.docker.mirantis.net/lcm/docker/ucp:3.3.3
22 docker_ee_url: https://storebits.docker.com/ubuntu
23 docker_ee_release: stable-19.03
24 private_floating_interface: 'ens4'
Oleh Hryhorovf4677af2021-04-26 18:00:15 +030025 default_interface: 'ens3'
Oleh Hryhorov207137d2021-04-13 12:03:39 +030026 rack_private_floating_interface: 'veth-phy'
Oleh Hryhorovf4677af2021-04-26 18:00:15 +030027 lmas_size: 0
28 lmas_metadata: {"labels": {"role": "stacklight", "stacklight": "enabled", "local-volume-provisioner": "enabled"}}
29 lmas_flavor: system.compact.stacklight.server
Oleh Hryhorov207137d2021-04-13 12:03:39 +030030 main_worker_hardware_metadata: |
31 '00:00:00:00:00:00':
32 write_files:
33 - path: /usr/share/metadata/ceph.yaml
34 content: |
35 storageDevices:
36 - name: vdb
37 role: hdd
38 sizeGb: 20
39 ramGb: 8
40 cores: 2
41 # The roles will be assigned based on node labels.
42 # roles:
43 # - mon
44 # - mgr
45 ips:
46 - 192.168.122.101
47 crushPath: {}
48
49 rack_functions_override: |
50
51 function network_config {
52 PUBLIC_NODE_IP_ADDRESS=${PUBLIC_INTERFACE_IP:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+' | egrep -v "127.0.|172.17")}
53 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)}
54
55 local public_interface=${1:-${PUBLIC_INTERFACE}}
56 local cloud_netplan_cfg="/etc/netplan/50-cloud-init.yaml"
57 local match_ip_line
58
59 DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils
60
61 cat << EOF > /etc/systemd/network/10-veth-phy-br.netdev
62 [NetDev]
63 Name=veth-phy
64 Kind=veth
65 [Peer]
66 Name=veth-br
67 EOF
68
69 sed -i 's/.*ethernets:.*/&\n veth-phy: {}/' ${cloud_netplan_cfg}
70 sed -i 's/.*ethernets:.*/&\n veth-br: {}/' ${cloud_netplan_cfg}
71
72 public_address_match_ip_line=$(grep -nm1 "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ${cloud_netplan_cfg} | cut -d: -f1)
73 sed -i "$((${public_address_match_ip_line}-1)),$((${public_address_match_ip_line}))d" ${cloud_netplan_cfg}
74
75 cat << EOF >> ${cloud_netplan_cfg}
76 bridges:
77 br-public:
78 dhcp4: false
79 EOF
80
81 # Remove Tunnel interface from netplan
82 if [[ $TUNNEL_INTERFACE_NETPLAN_MANAGE == false ]]; then
83 sed -i "/ ${TUNNEL_INTERFACE}/,/ set-name: ${TUNNEL_INTERFACE}/d" ${cloud_netplan_cfg}
84 fi
85
86 netplan --debug apply
87
88 # NOTE(vsaienko): give some time to apply changes
89 sleep 15
90
91 # Remove Tunnel interface from netplan
92 if [[ $TUNNEL_INTERFACE_NETPLAN_MANAGE == false ]]; then
93 ip addr flush ${TUNNEL_INTERFACE}
94 ip link set ${TUNNEL_INTERFACE} up
95 fi
96
97 }