blob: a1b2c9214c8da8eb90ea35388dd69d5858fa4af0 [file] [log] [blame]
ibumarskovf8ef89b2018-02-06 10:51:54 +04001{% from 'virtual-mcp-sl-os/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-sl-os/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'virtual-mcp-sl-os/underlay.yaml' import DOMAIN_NAME with context %}
4
Dennis Dmitriev0f272312018-10-01 13:29:40 +03005{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.com/salt-models/mcp-virtual-lab') %}
ibumarskovf8ef89b2018-02-06 10:51:54 +04006# Other salt model repository parameters see in shared-salt.yaml
ibumarskov712a6872018-04-25 09:22:15 +04007{% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %}
ibumarskov88f01542018-05-31 12:47:06 +04008{% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/cluster/overrides.yml') %}
ibumarskovf8ef89b2018-02-06 10:51:54 +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
Vladimir Jigulinf557c562018-07-30 18:30:09 +040016{{ 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" "logrotate"') }}
ibumarskovf8ef89b2018-02-06 10:51:54 +040017
18{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
19
20{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
21
ibumarskov712a6872018-04-25 09:22:15 +040022{%- if OVERRIDES != '' %}
23{%- for param in OVERRIDES.splitlines() %}
Vladimir Khlyunev5899e142018-10-29 14:37:34 +040024{%- set key, value = param.replace(' ','').split(':', 1) %}
ibumarskov712a6872018-04-25 09:22:15 +040025- description: Override cluster parameters
26 cmd: |
ibumarskov5921bb22018-06-25 16:49:37 +040027 salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name='{{OVERRIDES_FILENAME}}'
ibumarskov712a6872018-04-25 09:22:15 +040028 node_name: {{ HOSTNAME_CFG01 }}
29 retry: {count: 1, delay: 1}
30 skip_fail: false
31{%- endfor %}
ibumarskov88f01542018-05-31 12:47:06 +040032
33- description: Refresh pillar
34 cmd: salt '*' saltutil.refresh_pillar
35 node_name: {{ HOSTNAME_CFG01 }}
36 retry: {count: 1, delay: 1}
37 skip_fail: false
ibumarskov712a6872018-04-25 09:22:15 +040038{%- endif %}
39
ibumarskovf8ef89b2018-02-06 10:51:54 +040040{{ SHARED.MACRO_GENERATE_INVENTORY() }}
41
42{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
43
44- description: WR run linux state to fix hosts
45 cmd: salt "cfg*" state.sls linux
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 10}
48 skip_fail: true
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030049
50{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
51
52{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}