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 | |
| 5 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %} |
| 6 | # Other salt model repository parameters see in shared-salt.yaml |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 7 | {% set OVERRIDES = os_env('OVERRIDES', '') %} |
| 8 | {% 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] | 9 | |
| 10 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 11 | |
| 12 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 13 | |
| 14 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 15 | |
| 16 | {{ 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"') }} |
| 17 | |
| 18 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 19 | |
| 20 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 21 | |
| 22 | {%- if OVERRIDES != '' %} |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 23 | - description: Clear {{OVERRIDES_FILENAME}} |
| 24 | cmd: touch {{OVERRIDES_FILENAME}} |
| 25 | node_name: {{ HOSTNAME_CFG01 }} |
| 26 | retry: {count: 1, delay: 1} |
| 27 | skip_fail: false |
| 28 | |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 29 | {%- for param in OVERRIDES.splitlines() %} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 30 | - description: Override cluster parameters |
| 31 | cmd: | |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 32 | echo -e "{{ param }}" >> {{OVERRIDES_FILENAME}} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 33 | node_name: {{ HOSTNAME_CFG01 }} |
| 34 | retry: {count: 1, delay: 1} |
| 35 | skip_fail: false |
| 36 | {%- endfor %} |
ibumarskov | 88f0154 | 2018-05-31 12:47:06 +0400 | [diff] [blame] | 37 | |
| 38 | - description: Refresh pillar |
| 39 | cmd: salt '*' saltutil.refresh_pillar |
| 40 | node_name: {{ HOSTNAME_CFG01 }} |
| 41 | retry: {count: 1, delay: 1} |
| 42 | skip_fail: false |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 43 | {%- endif %} |
| 44 | |
| 45 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 46 | |
| 47 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 48 | |
| 49 | - description: WR run linux state to fix hosts |
| 50 | cmd: salt "cfg*" state.sls linux |
| 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 10} |
| 53 | skip_fail: true |
| 54 | |
| 55 | - description: Install linux-image-extra package on controllers |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' cmd.run 'apt -y install linux-image-extra-$(uname -r)' |
| 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 10} |
| 59 | skip_fail: false |