blob: 0a31788c75c5cb3c9e5810fa0c2411cc6448169b [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
ibumarskov5921bb22018-06-25 16:49:37 +04007{% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %}
Tatyana Leontovich14e201d2018-07-05 13:28:54 +03008{% set SALT_VERSION = os_env('SALT_VERSION', '2017.7') %}
ibumarskov88f01542018-05-31 12:47:06 +04009{% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/cluster/overrides.yml') %}
ibumarskov712a6872018-04-25 09:22:15 +040010
11{% import 'shared-salt.yaml' as SHARED with context %}
12
13{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
14
15{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
16
17{{ 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"') }}
18
19{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
20
21{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
22
23{%- if OVERRIDES != '' %}
24{%- for param in OVERRIDES.splitlines() %}
ibumarskov5921bb22018-06-25 16:49:37 +040025{%- set key, value = param.replace(' ','').split(':') %}
ibumarskov712a6872018-04-25 09:22:15 +040026- description: Override cluster parameters
27 cmd: |
ibumarskov5921bb22018-06-25 16:49:37 +040028 salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name='{{OVERRIDES_FILENAME}}'
ibumarskov712a6872018-04-25 09:22:15 +040029 node_name: {{ HOSTNAME_CFG01 }}
30 retry: {count: 1, delay: 1}
31 skip_fail: false
32{%- endfor %}
ibumarskov88f01542018-05-31 12:47:06 +040033
34- description: Refresh pillar
35 cmd: salt '*' saltutil.refresh_pillar
36 node_name: {{ HOSTNAME_CFG01 }}
37 retry: {count: 1, delay: 1}
38 skip_fail: false
ibumarskov712a6872018-04-25 09:22:15 +040039{%- endif %}
40
41{{ SHARED.MACRO_GENERATE_INVENTORY() }}
42
43{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
44
45- description: WR run linux state to fix hosts
46 cmd: salt "cfg*" state.sls linux
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 10}
49 skip_fail: true
50
51- description: Install linux-image-extra package on controllers
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' cmd.run 'apt -y install linux-image-extra-$(uname -r)'
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 10}
55 skip_fail: false
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030056
57{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
58
59{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}