Vladimir Khlyunev | 25f1e74 | 2018-11-07 16:52:10 +0400 | [diff] [blame^] | 1 | {% from 'cookied-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'cookied-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CMP01 with context %} |
| 3 | {% from 'cookied-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CMP02 with context %} |
| 4 | {% from 'cookied-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 5 | {% from 'cookied-mcp-ocata-ovs/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 6 | {% from 'cookied-mcp-ocata-ovs/underlay.yaml' import DOMAIN_NAME with context %} |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 7 | |
Dennis Dmitriev | 0f27231 | 2018-10-01 13:29:40 +0300 | [diff] [blame] | 8 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.com/salt-models/mcp-virtual-lab') %} |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 9 | # Other salt model repository parameters see in shared-salt.yaml |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 10 | {% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %} |
Vladimir Khlyunev | 25f1e74 | 2018-11-07 16:52:10 +0400 | [diff] [blame^] | 11 | {% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/environment/cookied-mcp-ocata-ovs/overrides.yml') %} |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 12 | |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 13 | {% import 'shared-salt.yaml' as SHARED with context %} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 14 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 15 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 16 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 17 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 18 | |
Pavel Glazov | ecc6d38 | 2018-10-30 17:54:21 +0400 | [diff] [blame] | 19 | {{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='\*') }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 20 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 21 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 22 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 23 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 24 | |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 25 | {%- if OVERRIDES != '' %} |
| 26 | {%- for param in OVERRIDES.splitlines() %} |
Vladimir Khlyunev | 5899e14 | 2018-10-29 14:37:34 +0400 | [diff] [blame] | 27 | {%- set key, value = param.replace(' ','').split(':', 1) %} |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 28 | - 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 | |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 43 | {{ SHARED.ADJUST_SL_OPTS(OVERRIDES_FILENAME='/srv/salt/reclass/classes/cluster/' + SHARED.CLUSTER_NAME + '/stacklight/server.yml') }} |
| 44 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 45 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 46 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 47 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 48 | |
Tatyana Leontovich | 4453dd6 | 2018-06-26 18:44:31 +0300 | [diff] [blame] | 49 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 50 | |
Tatyana Leontovich | 4453dd6 | 2018-06-26 18:44:31 +0300 | [diff] [blame] | 51 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |
ibumarskov | 7bdc7ed | 2018-08-24 12:06:38 +0400 | [diff] [blame] | 52 | |
| 53 | # WORKAROUND PROD-21071 |
| 54 | - description: Set correct pin for openstack repository |
| 55 | cmd: | |
| 56 | salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run "sed -i -e 's/Pin: release l=ocata/Pin: release l=xenial\/openstack\/ocata testing/g' /etc/apt/preferences.d/mirantis_openstack" |
| 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 5} |
| 59 | skip_fail: false |