| {% from 'physical_mcp11_dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| {% from 'physical_mcp11_dvr/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| {% from 'physical_mcp11_dvr/underlay.yaml' import DOMAIN_NAME with context %} |
| |
| {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-baremetal-lab') %} |
| # Other salt model repository parameters see in shared-salt.yaml |
| |
| {% import 'shared-salt.yaml' as SHARED with context %} |
| |
| {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| |
| {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| |
| {{ 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"') }} |
| |
| {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| |
| {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| |
| {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| |
| |
| - description: Configure linux for present baremetal nodes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not |
| cfg01*' state.sls linux |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 3, delay: 5} |
| skip_fail: false |
| |
| - description: '*Workaround* of the bug https://mirantis.jira.com/browse/PROD-9576 to get bond0-connectivity *without* rebooting nodes' |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| "cat /etc/network/interfaces | grep bond-slaves | awk '{print \$2}' | xargs -I {} ifenslave bond0 {}" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: ovs-dvr-vlan model specific Execute 'libvirt' states to create necessary libvirt networks |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'kvm*' state.sls libvirt |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: Create VMs for control plane |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'kvm*' state.sls salt.control |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 3, delay: 10} |
| skip_fail: false |
| |
| |
| |
| - description: Refresh pillars on all minions |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Sync all salt resources |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5 |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Show reclass-salt --top for generated nodes |
| cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/ |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Execute salt.minion.cert |
| cmd: salt-call --no-color state.sls salt.minion.cert -l info; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| |
| {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| |
| {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |