ibumarskov | 76aa5c7 | 2018-06-13 10:15:37 +0400 | [diff] [blame] | 1 | {% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CMP01 with context %} |
| 3 | {% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CMP02 with context %} |
| 4 | {% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 5 | {% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 6 | {% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import DOMAIN_NAME with context %} |
| 7 | |
| 8 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %} |
| 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') %} |
| 11 | {% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/environment/cookied-mcp-mitaka-ovs/overrides.yml') %} |
ibumarskov | 76aa5c7 | 2018-06-13 10:15:37 +0400 | [diff] [blame] | 12 | |
| 13 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 14 | |
| 15 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 16 | |
| 17 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 18 | |
| 19 | {{ 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" "powerdns" "glusterfs" "jenkins" "maas" "backupninja" "fluentd"') }} |
| 20 | |
| 21 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 22 | |
| 23 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 24 | |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame] | 25 | {%- if OVERRIDES != '' %} |
| 26 | {%- for param in OVERRIDES.splitlines() %} |
| 27 | {%- set key, value = param.replace(' ','').split(':') %} |
| 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 | |
ibumarskov | 76aa5c7 | 2018-06-13 10:15:37 +0400 | [diff] [blame] | 43 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 44 | |
| 45 | {{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }} |
| 46 | |
| 47 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 48 | |
| 49 | - description: Hack gtw node |
| 50 | cmd: salt '{{ HOSTNAME_GTW01 }}' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4"; |
| 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 10} |
| 53 | skip_fail: false |
| 54 | |
| 55 | - description: Hack cmp01 node |
| 56 | cmd: salt '{{ HOSTNAME_CMP01 }}' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4"; |
| 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 10} |
| 59 | skip_fail: false |
| 60 | |
| 61 | - description: Hack cmp02 node |
| 62 | cmd: salt '{{ HOSTNAME_CMP02 }}' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4"; |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 10} |
| 65 | skip_fail: false |