blob: 5500d6345c20290e8e3c33c6ceb0f1ab65bd077d [file] [log] [blame]
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03001{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_APT01 with context %}
2{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %}
3{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %}
4{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %}
5{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %}
6{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CMP01 with context %}
7{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CMP02 with context %}
8{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_GTW01 with context %}
9{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_PRX01 with context %}
10{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_VS with context %}
11{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import LAB_CONFIG_NAME with context %}
12{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import DOMAIN_NAME with context %}
13
14{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.local.test/salt-models/mcp-virtual-lab') %}
15# Other salt model repository parameters see in shared-salt.yaml
16
17
18{% import 'shared-salt.yaml' as SHARED with context %}
19{% from 'shared-salt.yaml' import IPV4_NET_CONTROL_PREFIX with context %}
20{% import 'virtual-offline-pike-ovs-dpdk/vswitch-config.yaml' as VSWITCH with context %}
21{% set VSWITCH_IP = SHARED.IPV4_NET_CONTROL_PREFIX+'.178' %}
22
23
24
25#- description: 'Generate nginx cert'
26# cmd: |
27# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
28# -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.gerrit.com" \
29# -keyout ssl-nginx.key -out ssl-nginx.crt;
30# node_name: {{ HOSTNAME_APT01 }}
31# retry: {count: 1, delay: 5}
32# skip_fail: false
33
34- description: Check nginx APT node is ready
35 cmd: systemctl status nginx;
36 node_name: {{ HOSTNAME_APT01 }}
37 retry: {count: 1, delay: 10}
38 skip_fail: false
39
40- description: Check dnsmasq on APT node is ready
41 cmd: systemctl status dnsmasq;
42 node_name: {{ HOSTNAME_APT01 }}
43 retry: {count: 1, delay: 10}
44 skip_fail: false
45
46{{ VSWITCH.MACRO_CONFIGURE_VSWITCH(HOSTNAME_VS, VSWITCH_IP) }}
47
48{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
49{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL01) }}
50{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL02) }}
51{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL03) }}
52{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP01) }}
53{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP02) }}
54{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_GTW01) }}
55{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_PRX01) }}
56
57{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
58
59{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
60
61- description: 'Workaround of local_repo_url - set to offline image repository structure'
62 cmd: |
63 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/local_repo_url: .*/local_repo_url: mirror.mcp.mirantis.local.test/g' {} +
64 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/aptly_server_address: .*/aptly_server_address: {{ os_env('HOST_APT') }}/g' {} +
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 10}
67 skip_fail: false
68
69{{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='"linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon" "prometheus" "telegraf" "elasticsearch" "powerdns" "fluentd" "backupninja" "watchdog"') }}
70
71{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
72
73{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
74
75{{ SHARED.MACRO_GENERATE_INVENTORY() }}
76
77{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
78
79{{ VSWITCH.MACRO_CHECK_BGPVPN_ENABLED_BY_DEFAULT() }}
80
81{{ VSWITCH.MACRO_ENABLE_L2GW(SHARED.CLUSTER_NAME, VSWITCH_IP) }}
82- description: Hack gtw node
83 cmd: salt 'gtw*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
84 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, delay: 10}
86 skip_fail: false
87
88- description: Hack cmp01 node
89 cmd: salt 'cmp01*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 10}
92 skip_fail: false
93
94- description: Hack cmp02 node
95 cmd: salt 'cmp02*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 10}
98 skip_fail: false