blob: 3cd7087d667ad554086d0adf18f01c77010ca139 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +03002
3{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02004# Other salt model repository parameters see in shared-salt.yaml
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +03005
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02006{% import 'shared-salt.yaml' as SHARED with context %}
7{% from 'shared-salt.yaml' import IPV4_NET_CONTROL_PREFIX with context %}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +03008
Dennis Dmitriev492813e2017-08-09 15:08:58 +03009{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030010
Dennis Dmitriev492813e2017-08-09 15:08:58 +030011{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030012
Dennis Dmitriev492813e2017-08-09 15:08:58 +030013{{ 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"') }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030014
Dennis Dmitriev492813e2017-08-09 15:08:58 +030015{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030016
Dennis Dmitriev492813e2017-08-09 15:08:58 +030017{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030018
Dennis Dmitriev04e62dd2017-09-26 19:06:42 +030019- description: "Workaround for PROD-14831 , add 'dns' role to ctl01 and ctl02 nodes"
20 cmd: |
21 set -e;
22 apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev;
23 pip install git+https://github.com/dis-xcom/reclass-tools;
24 reclass-tools add-key 'parameters.reclass.storage.node.openstack_control_node01.classes' 'cluster.{{ LAB_CONFIG_NAME }}.openstack.dns' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml --merge;
25 reclass-tools add-key 'parameters.reclass.storage.node.openstack_control_node02.classes' 'cluster.{{ LAB_CONFIG_NAME }}.openstack.dns' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml --merge;
26
27 export REPLACE_DIRS="/srv/salt/reclass/classes/ /srv/salt/reclass/nodes/"
28 find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node01_address:.*/openstack_dns_node01_address: ${_param:openstack_control_node01_address}/g' {} +
29 find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node02_address:.*/openstack_dns_node02_address: ${_param:openstack_control_node02_address}/g' {} +
30
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 10}
33 skip_fail: false
34
Dennis Dmitriev492813e2017-08-09 15:08:58 +030035{{ SHARED.MACRO_GENERATE_INVENTORY() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030036
Dennis Dmitriev492813e2017-08-09 15:08:58 +030037{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030038
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030039- description: Hack gtw node
40 cmd: salt 'gtw*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 10}
43 skip_fail: false
44
45- description: Hack cmp01 node
46 cmd: salt 'cmp01*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 10}
49 skip_fail: false
50
51- description: Hack cmp02 node
52 cmd: salt 'cmp02*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 10}
55 skip_fail: false