blob: e71451b0f5dc41e08ce8d5904a08a758ef441fb8 [file] [log] [blame]
ibumarskov76aa5c72018-06-13 10:15:37 +04001{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CMP01 with context %}
3{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CMP02 with context %}
4{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
5{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import LAB_CONFIG_NAME with context %}
6{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import DOMAIN_NAME with context %}
7
Dennis Dmitriev0f272312018-10-01 13:29:40 +03008{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.com/salt-models/mcp-virtual-lab') %}
ibumarskov76aa5c72018-06-13 10:15:37 +04009# Other salt model repository parameters see in shared-salt.yaml
ibumarskov5921bb22018-06-25 16:49:37 +040010{% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %}
11{% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/environment/cookied-mcp-mitaka-ovs/overrides.yml') %}
ibumarskov76aa5c72018-06-13 10:15:37 +040012
13{% import 'shared-salt.yaml' as SHARED with context %}
14
15{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
16
17{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
18
ibumarskovb38af302018-07-26 10:42:27 +040019{{ 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" "glusterfs" "jenkins" "maas" "backupninja" "fluentd" "auditd" "logrotate"') }}
ibumarskov76aa5c72018-06-13 10:15:37 +040020
21{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
22
23{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
24
ibumarskov5921bb22018-06-25 16:49:37 +040025{%- if OVERRIDES != '' %}
26{%- for param in OVERRIDES.splitlines() %}
Vladimir Khlyunev5899e142018-10-29 14:37:34 +040027{%- set key, value = param.replace(' ','').split(':', 1) %}
ibumarskov5921bb22018-06-25 16:49:37 +040028- description: Override cluster parameters
29 cmd: |
30 salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name='{{OVERRIDES_FILENAME}}'
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 1}
33 skip_fail: false
34{%- endfor %}
35
36- description: Refresh pillar
37 cmd: salt '*' saltutil.refresh_pillar
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 1}
40 skip_fail: false
41{%- endif %}
42
ibumarskov76aa5c72018-06-13 10:15:37 +040043{{ SHARED.MACRO_GENERATE_INVENTORY() }}
44
ibumarskov76aa5c72018-06-13 10:15:37 +040045{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
46
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030047{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
48
49{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
ibumarskov7bdc7ed2018-08-24 12:06:38 +040050
51# WORKAROUND PROD-21071
52- description: Set correct pin for openstack repository
53 cmd: |
54 salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run "sed -i -e 's/Pin: release l=mitaka/Pin: release l=xenial\/openstack\/mitaka testing/g' /etc/apt/preferences.d/mirantis_openstack"
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false