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