ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 1 | {% 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 Dmitriev | 0f27231 | 2018-10-01 13:29:40 +0300 | [diff] [blame] | 5 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.com/salt-models/mcp-virtual-lab') %} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 6 | # Other salt model repository parameters see in shared-salt.yaml |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 7 | {% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %} |
Tatyana Leontovich | 14e201d | 2018-07-05 13:28:54 +0300 | [diff] [blame] | 8 | {% set SALT_VERSION = os_env('SALT_VERSION', '2017.7') %} |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 9 | {% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/cluster/overrides.yml') %} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 10 | |
| 11 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 12 | |
| 13 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 14 | |
| 15 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 16 | |
Vladimir Jigulin | f557c56 | 2018-07-30 18:30:09 +0400 | [diff] [blame] | 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" "logrotate"') }} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 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() %} |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 25 | {%- set key, value = param.replace(' ','').split(':') %} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 26 | - description: Override cluster parameters |
| 27 | cmd: | |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 28 | salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name='{{OVERRIDES_FILENAME}}' |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 29 | node_name: {{ HOSTNAME_CFG01 }} |
| 30 | retry: {count: 1, delay: 1} |
| 31 | skip_fail: false |
| 32 | {%- endfor %} |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 33 | |
| 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 |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 39 | {%- 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 Leontovich | 4453dd6 | 2018-06-26 18:44:31 +0300 | [diff] [blame] | 56 | |
| 57 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| 58 | |
| 59 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 60 | |
| 61 | # WORKAROUND PROD-21071 |
| 62 | - description: Set correct pin for openstack repository |
| 63 | cmd: | |
| 64 | 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" |
| 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 1, delay: 5} |
| 67 | skip_fail: false |
| 68 | |
| 69 | # WORKAROUND PROD-22827 |
| 70 | - description: Set Pin-Priority up to 1200 for openstack repository |
| 71 | cmd: | |
| 72 | 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" |
| 73 | node_name: {{ HOSTNAME_CFG01 }} |
| 74 | retry: {count: 1, delay: 5} |
| 75 | skip_fail: false |