blob: 8db43cf2e7b28b66178556bce840eae045ec71e3 [file] [log] [blame]
Dennis Dmitriev75776c52017-12-26 18:22:53 +02001{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_APT01 with context %}
2{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CFG01 with context %}
3{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CTL01 with context %}
4{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CTL02 with context %}
5{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CTL03 with context %}
6{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMP01 with context %}
7{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMP02 with context %}
8{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_GTW01 with context %}
9{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_PRX01 with context %}
10{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMN01 with context %}
11{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMN02 with context %}
12{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMN03 with context %}
13{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_OSD01 with context %}
14{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_OSD02 with context %}
15{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import LAB_CONFIG_NAME with context %}
16{% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import DOMAIN_NAME with context %}
17
18{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.local.test/salt-models/mcp-virtual-lab') %}
19# Other salt model repository parameters see in shared-salt.yaml
20
21
22{% import 'shared-salt.yaml' as SHARED with context %}
23{% from 'shared-salt.yaml' import IPV4_NET_CONTROL_PREFIX with context %}
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{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
47{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL01) }}
48{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL02) }}
49{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL03) }}
50{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP01) }}
51{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP02) }}
52{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMN01) }}
53{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMN02) }}
54{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMN03) }}
55{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_OSD01) }}
56{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_OSD02) }}
57{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_GTW01) }}
58{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_PRX01) }}
59
60{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
61
62{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
63
64- description: 'Workaround of local_repo_url - set to offline image repository structure'
65 cmd: |
66 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/local_repo_url: .*/local_repo_url: mirror.mcp.mirantis.local.test/g' {} +
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 10}
69 skip_fail: false
70
71{{ 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"') }}
72
73{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
74
75{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
76
77{{ SHARED.MACRO_GENERATE_INVENTORY() }}
78
79{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
80
81- description: Hack gtw node
82 cmd: salt 'gtw*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 10}
85 skip_fail: false
86
87- description: Hack cmp01 node
88 cmd: salt 'cmp01*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 10}
91 skip_fail: false
92
93- description: Hack cmp02 node
94 cmd: salt 'cmp02*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 10}
97 skip_fail: false