Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 1 | {% from 'physical_mcp11_dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
Dennis Dmitriev | 5ec4d57 | 2017-09-27 00:47:54 +0300 | [diff] [blame] | 2 | {% from 'physical_mcp11_dvr/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 3 | {% from 'physical_mcp11_dvr/underlay.yaml' import DOMAIN_NAME with context %} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 4 | |
| 5 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-baremetal-lab') %} |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 6 | # Other salt model repository parameters see in shared-salt.yaml |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 7 | |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 8 | {% import 'shared-salt.yaml' as SHARED with context %} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 9 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 10 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 11 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 12 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 13 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 14 | {{ 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"') }} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 15 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 16 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 17 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 18 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 19 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 20 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 21 | |
Dennis Dmitriev | e17bcaf | 2017-05-25 00:26:57 +0300 | [diff] [blame] | 22 | |
| 23 | - description: Configure linux for present baremetal nodes |
| 24 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not |
| 25 | cfg01*' state.sls linux |
| 26 | node_name: {{ HOSTNAME_CFG01 }} |
| 27 | retry: {count: 3, delay: 5} |
| 28 | skip_fail: false |
| 29 | |
| 30 | - description: '*Workaround* of the bug https://mirantis.jira.com/browse/PROD-9576 to get bond0-connectivity *without* rebooting nodes' |
| 31 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 32 | "cat /etc/network/interfaces | grep bond-slaves | awk '{print \$2}' | xargs -I {} ifenslave bond0 {}" |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 33 | node_name: {{ HOSTNAME_CFG01 }} |
| 34 | retry: {count: 1, delay: 5} |
| 35 | skip_fail: false |
| 36 | |
| 37 | - description: ovs-dvr-vlan model specific Execute 'libvirt' states to create necessary libvirt networks |
| 38 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'kvm*' state.sls libvirt |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 10} |
| 41 | skip_fail: false |
| 42 | |
| 43 | - description: Create VMs for control plane |
| 44 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'kvm*' state.sls salt.control |
| 45 | node_name: {{ HOSTNAME_CFG01 }} |
| 46 | retry: {count: 3, delay: 10} |
| 47 | skip_fail: false |
| 48 | |
| 49 | |
| 50 | |
| 51 | - description: Refresh pillars on all minions |
| 52 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 5} |
| 55 | skip_fail: false |
| 56 | |
| 57 | - description: Sync all salt resources |
Dennis Dmitriev | 9a6cacc | 2017-08-14 00:08:41 +0300 | [diff] [blame] | 58 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5 |
Dennis Dmitriev | 77d886c | 2017-05-24 13:13:26 +0300 | [diff] [blame] | 59 | node_name: {{ HOSTNAME_CFG01 }} |
| 60 | retry: {count: 1, delay: 5} |
| 61 | skip_fail: false |
| 62 | |
| 63 | - description: Show reclass-salt --top for generated nodes |
| 64 | cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/ |
| 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 1, delay: 5} |
| 67 | skip_fail: false |
| 68 | |
| 69 | - description: Execute salt.minion.cert |
| 70 | cmd: salt-call --no-color state.sls salt.minion.cert -l info; |
| 71 | node_name: {{ HOSTNAME_CFG01 }} |
| 72 | retry: {count: 1, delay: 5} |
| 73 | skip_fail: false |
| 74 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 75 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |