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 |
| 7 | {% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %} |
| 8 | |
| 9 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 10 | |
| 11 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 12 | |
| 13 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 14 | |
| 15 | {{ 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"') }} |
| 16 | |
| 17 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 18 | |
| 19 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 20 | |
| 21 | {%- if OVERRIDES != '' %} |
| 22 | {%- for param in OVERRIDES.splitlines() %} |
| 23 | {%- set key, value = param.replace(' ','').split(':') %} |
| 24 | - description: Override cluster parameters |
| 25 | cmd: | |
| 26 | salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name=/srv/salt/reclass/classes/cluster/overrides.yml |
| 27 | salt '*' saltutil.refresh_pillar |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 1, delay: 1} |
| 30 | skip_fail: false |
| 31 | {%- endfor %} |
| 32 | {%- endif %} |
| 33 | |
| 34 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 35 | |
| 36 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 37 | |
| 38 | - description: WR run linux state to fix hosts |
| 39 | cmd: salt "cfg*" state.sls linux |
| 40 | node_name: {{ HOSTNAME_CFG01 }} |
| 41 | retry: {count: 1, delay: 10} |
| 42 | skip_fail: true |
| 43 | |
| 44 | - description: Install linux-image-extra package on controllers |
| 45 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' cmd.run 'apt -y install linux-image-extra-$(uname -r)' |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 10} |
| 48 | skip_fail: false |