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 | |
Vladimir Khlyunev | 72b2be9 | 2018-11-21 15:51:19 +0400 | [diff] [blame] | 13 | # 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 | |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 22 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 23 | |
| 24 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 25 | |
Vladimir Jigulin | f557c56 | 2018-07-30 18:30:09 +0400 | [diff] [blame] | 26 | {{ 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] | 27 | |
| 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 Khlyunev | 5899e14 | 2018-10-29 14:37:34 +0400 | [diff] [blame] | 34 | {%- set key, value = param.replace(' ','').split(':', 1) %} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 35 | - description: Override cluster parameters |
| 36 | cmd: | |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 37 | 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] | 38 | node_name: {{ HOSTNAME_CFG01 }} |
| 39 | retry: {count: 1, delay: 1} |
| 40 | skip_fail: false |
| 41 | {%- endfor %} |
Vladimir Khlyunev | 72b2be9 | 2018-11-21 15:51:19 +0400 | [diff] [blame] | 42 | {%- 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 |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 57 | |
| 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 |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 63 | |
| 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 Leontovich | 4453dd6 | 2018-06-26 18:44:31 +0300 | [diff] [blame] | 79 | |
| 80 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| 81 | |
| 82 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 83 | |
| 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 |