blob: d0422927ce57098622beec0d84f0ab1e7dcd6a3a [file] [log] [blame]
ibumarskov712a6872018-04-25 09:22:15 +04001{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-trusty/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'virtual-mcp-trusty/underlay.yaml' import DOMAIN_NAME with context %}
4
5{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
6# Other salt model repository parameters see in shared-salt.yaml
ibumarskov88f01542018-05-31 12:47:06 +04007{% set OVERRIDES = os_env('OVERRIDES', '') %}
8{% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/cluster/overrides.yml') %}
ibumarskov712a6872018-04-25 09:22:15 +04009
10{% import 'shared-salt.yaml' as SHARED with context %}
11
12{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
13
14{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
15
16{{ 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" "fluentd" "docker" "kibana"') }}
17
18{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
19
20{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
21
22{%- if OVERRIDES != '' %}
ibumarskov88f01542018-05-31 12:47:06 +040023- description: Clear {{OVERRIDES_FILENAME}}
24 cmd: touch {{OVERRIDES_FILENAME}}
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 1, delay: 1}
27 skip_fail: false
28
ibumarskov712a6872018-04-25 09:22:15 +040029{%- for param in OVERRIDES.splitlines() %}
ibumarskov712a6872018-04-25 09:22:15 +040030- description: Override cluster parameters
31 cmd: |
ibumarskov88f01542018-05-31 12:47:06 +040032 echo -e "{{ param }}" >> {{OVERRIDES_FILENAME}}
ibumarskov712a6872018-04-25 09:22:15 +040033 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 1}
35 skip_fail: false
36{%- endfor %}
ibumarskov88f01542018-05-31 12:47:06 +040037
38- description: Refresh pillar
39 cmd: salt '*' saltutil.refresh_pillar
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 1}
42 skip_fail: false
ibumarskov712a6872018-04-25 09:22:15 +040043{%- endif %}
44
45{{ SHARED.MACRO_GENERATE_INVENTORY() }}
46
47{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
48
49- description: WR run linux state to fix hosts
50 cmd: salt "cfg*" state.sls linux
51 node_name: {{ HOSTNAME_CFG01 }}
52 retry: {count: 1, delay: 10}
53 skip_fail: true
54
55- description: Install linux-image-extra package on controllers
56 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' cmd.run 'apt -y install linux-image-extra-$(uname -r)'
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 10}
59 skip_fail: false