blob: 7d0105950409bb8662cd6bc261ab0d8c97e82ba9 [file] [log] [blame]
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02001{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_APT01 with context %}
2{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
3{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
4{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
5{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
6{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CMP01 with context %}
7{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CMP02 with context %}
8{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
9{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_PRX01 with context %}
10{% from 'virtual-offline-pike-ovs/underlay.yaml' import LAB_CONFIG_NAME with context %}
11{% from 'virtual-offline-pike-ovs/underlay.yaml' import DOMAIN_NAME with context %}
12
13{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.local.test/salt-models/mcp-virtual-lab') %}
14# Other salt model repository parameters see in shared-salt.yaml
15
16
17{% import 'shared-salt.yaml' as SHARED with context %}
18{% from 'shared-salt.yaml' import IPV4_NET_CONTROL_PREFIX with context %}
19
20#- description: 'Generate nginx cert'
21# cmd: |
22# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
23# -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.gerrit.com" \
24# -keyout ssl-nginx.key -out ssl-nginx.crt;
25# node_name: {{ HOSTNAME_APT01 }}
26# retry: {count: 1, delay: 5}
27# skip_fail: false
28
29- description: Check nginx APT node is ready
30 cmd: systemctl status nginx;
31 node_name: {{ HOSTNAME_APT01 }}
32 retry: {count: 1, delay: 10}
33 skip_fail: false
34
35- description: Check dnsmasq on APT node is ready
36 cmd: systemctl status dnsmasq;
37 node_name: {{ HOSTNAME_APT01 }}
38 retry: {count: 1, delay: 10}
39 skip_fail: false
40
41{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
42{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL01) }}
43{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL02) }}
44{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL03) }}
45{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP01) }}
46{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP02) }}
47{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_GTW01) }}
48{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_PRX01) }}
49
50{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
51
52{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
53
54- description: 'Workaround of local_repo_url - set to offline image repository structure'
55 cmd: |
56 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/local_repo_url: .*/local_repo_url: mirror.mcp.mirantis.local.test/g' {} +
57 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/aptly_server_address: .*/aptly_server_address: {{ os_env('HOST_APT') }}/g' {} +
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 10}
60 skip_fail: false
61
Dennis Dmitrieva5978eb2018-02-21 10:12:33 +020062{{ 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"') }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020063
64{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
65
66{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
67
68{{ SHARED.MACRO_GENERATE_INVENTORY() }}
69
70{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
71
72- description: Hack gtw node
73 cmd: salt 'gtw*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 1, delay: 10}
76 skip_fail: false
77
78- description: Hack cmp01 node
79 cmd: salt 'cmp01*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 1, delay: 10}
82 skip_fail: false
83
84- description: Hack cmp02 node
85 cmd: salt 'cmp02*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 10}
88 skip_fail: false