blob: d8f7fb733b8084d70012912dc12b25ed48bd58ea [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
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') %}
ibumarskov712a6872018-04-25 09:22:15 +04006# 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
Vladimir Khlyunev72b2be92018-11-21 15:51:19 +040013# vkhlyunev: sometimes we have to verify fixes to mitaka openstack based on
14# ubuntu trusty OS deployment. Last discovered deploy-able configuration is based on
15# mcp-virtual-lab/salt-formulas/reclass-system parameters/commits/tags listed below
16# SALT_MODELS_COMMIT = 'fa85f84'
17# SALT_MODELS_SYSTEM_TAG = '2018.8.0'
18# REPOSITORY_SUITE = '2018.8.0'
19# OVERRIDES = 'openstack_log_appender: true
20# linux_system_repo_mk_openstack_version: testing'
21
ibumarskov712a6872018-04-25 09:22:15 +040022{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
23
24{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
25
Vladimir Jigulinf557c562018-07-30 18:30:09 +040026{{ 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"') }}
ibumarskov712a6872018-04-25 09:22:15 +040027
28{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
29
30{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
31
32{%- if OVERRIDES != '' %}
33{%- for param in OVERRIDES.splitlines() %}
Vladimir Khlyunev5899e142018-10-29 14:37:34 +040034{%- set key, value = param.replace(' ','').split(':', 1) %}
ibumarskov712a6872018-04-25 09:22:15 +040035- description: Override cluster parameters
36 cmd: |
ibumarskov5921bb22018-06-25 16:49:37 +040037 salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name='{{OVERRIDES_FILENAME}}'
ibumarskov712a6872018-04-25 09:22:15 +040038 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 1}
40 skip_fail: false
41{%- endfor %}
Vladimir Khlyunev72b2be92018-11-21 15:51:19 +040042{%- endif %}
43
44# vkhlyunev: fa85f84 model commit contains sphinx on cfg01 node
45# which is not required for mitaka-trusty testing. Unfortunately we can not fix
46# it in model itself due to constantly updating models according to development
47# of main release.
48- description: Apply sphinx workaround - delete system.sphinx class
49 cmd: sed -i -e '/system.sphinx/d' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml
50 node_name: {{ HOSTNAME_CFG01 }}
51 skip_fail: False
52
53- description: Apply sphinx workaround - delete nginx section
54 cmd: sed -i -e '/ nginx:/,+8d' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml
55 node_name: {{ HOSTNAME_CFG01 }}
56 skip_fail: False
ibumarskov88f01542018-05-31 12:47:06 +040057
58- description: Refresh pillar
59 cmd: salt '*' saltutil.refresh_pillar
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 1, delay: 1}
62 skip_fail: false
ibumarskov712a6872018-04-25 09:22:15 +040063
64{{ SHARED.MACRO_GENERATE_INVENTORY() }}
65
66{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
67
68- description: WR run linux state to fix hosts
69 cmd: salt "cfg*" state.sls linux
70 node_name: {{ HOSTNAME_CFG01 }}
71 retry: {count: 1, delay: 10}
72 skip_fail: true
73
74- description: Install linux-image-extra package on controllers
75 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' cmd.run 'apt -y install linux-image-extra-$(uname -r)'
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 10}
78 skip_fail: false
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030079
80{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
81
82{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
ibumarskov1b85e892018-08-30 11:54:47 +040083
84# WORKAROUND PROD-21071
85- description: Set correct pin for openstack repository
86 cmd: |
87 salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run "sed -i -e 's/Pin: release l=mitaka/Pin: release l=trusty\/openstack\/mitaka testing/g' /etc/apt/preferences.d/mirantis_openstack"
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 1, delay: 5}
90 skip_fail: false
91
92# WORKAROUND PROD-22827
93- description: Set Pin-Priority up to 1200 for openstack repository
94 cmd: |
95 salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run "sed -i -e 's/Pin-Priority: 1100/Pin-Priority: 1200/g' /etc/apt/preferences.d/mirantis_openstack"
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 5}
98 skip_fail: false