blob: 36bf49c86ad76d0b47861301c623e3611f870ffc [file] [log] [blame]
Dennis Dmitriev77d886c2017-05-24 13:13:26 +03001{% from 'physical_mcp11_dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
Dennis Dmitriev5ec4d572017-09-27 00:47:54 +03002{% 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 Dmitriev77d886c2017-05-24 13:13:26 +03004
5{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-baremetal-lab') %}
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02006# Other salt model repository parameters see in shared-salt.yaml
Dennis Dmitriev77d886c2017-05-24 13:13:26 +03007
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02008{% import 'shared-salt.yaml' as SHARED with context %}
Dennis Dmitriev77d886c2017-05-24 13:13:26 +03009
Dennis Dmitriev492813e2017-08-09 15:08:58 +030010{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
Dennis Dmitriev77d886c2017-05-24 13:13:26 +030011
Dennis Dmitriev492813e2017-08-09 15:08:58 +030012{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
Dennis Dmitriev77d886c2017-05-24 13:13:26 +030013
Dennis Dmitriev492813e2017-08-09 15:08:58 +030014{{ 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 Dmitriev77d886c2017-05-24 13:13:26 +030015
Dennis Dmitriev492813e2017-08-09 15:08:58 +030016{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
Dennis Dmitriev77d886c2017-05-24 13:13:26 +030017
Dennis Dmitriev492813e2017-08-09 15:08:58 +030018{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
Dennis Dmitriev77d886c2017-05-24 13:13:26 +030019
Dennis Dmitriev492813e2017-08-09 15:08:58 +030020{{ SHARED.MACRO_GENERATE_INVENTORY() }}
Dennis Dmitriev77d886c2017-05-24 13:13:26 +030021
Dennis Dmitrieve17bcaf2017-05-25 00:26:57 +030022
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 Dmitriev77d886c2017-05-24 13:13:26 +030033 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 Dmitriev9a6cacc2017-08-14 00:08:41 +030058 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5
Dennis Dmitriev77d886c2017-05-24 13:13:26 +030059 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 Dmitriev492813e2017-08-09 15:08:58 +030075{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}