blob: 689dcf456d243245c6b47cf82714a45ed9458969 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
Dennis Dmitriev5ec4d572017-09-27 00:47:54 +03002{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import DOMAIN_NAME with context %}
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +03004
5{% 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 +02006# Other salt model repository parameters see in shared-salt.yaml
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +03007
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02008{% import 'shared-salt.yaml' as SHARED with context %}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +03009
Dennis Dmitriev492813e2017-08-09 15:08:58 +030010{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030011
Dennis Dmitriev492813e2017-08-09 15:08:58 +030012{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +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" "powerdns"') }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030015
Dennis Dmitriev492813e2017-08-09 15:08:58 +030016{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030017
Dennis Dmitriev492813e2017-08-09 15:08:58 +030018{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030019
Tatyana Leontovicha6c64a72017-10-25 22:21:18 +030020- description: "Workaround for PROD-14831 , add 'dns' role to cmp01 and cmp02 nodes"
Dennis Dmitriev04e62dd2017-09-26 19:06:42 +030021 cmd: |
22 set -e;
23 apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev;
Dennis Dmitrievd96ace12018-01-26 14:46:21 +020024 [[ -d /root/venv-reclass-tools ]] || virtualenv /root/venv-reclass-tools;
25 . /root/venv-reclass-tools/bin/activate;
Dennis Dmitriev04e62dd2017-09-26 19:06:42 +030026 pip install git+https://github.com/dis-xcom/reclass-tools;
Dennis Dmitriev71147972017-09-28 21:37:58 +030027
28 # Combine 'dns' role with compute nodes
Dennis Dmitrievb2326d42017-09-28 10:14:04 +030029 reclass-tools add-key 'classes' 'cluster.{{ LAB_CONFIG_NAME }}.openstack.dns' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute.yml --merge;
Dennis Dmitriev71147972017-09-28 21:37:58 +030030 # Remove linux.network.interface hardcode from 'dns' role to avoid conflict with compute interfaces
31 reclass-tools del-key parameters.linux.network.interface /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/dns.yml
Dennis Dmitriev04e62dd2017-09-26 19:06:42 +030032
33 export REPLACE_DIRS="/srv/salt/reclass/classes/ /srv/salt/reclass/nodes/"
Dennis Dmitrievb2326d42017-09-28 10:14:04 +030034 find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node01_address:.*/openstack_dns_node01_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/g' {} +
35 find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node02_address:.*/openstack_dns_node02_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/g' {} +
Dennis Dmitriev04e62dd2017-09-26 19:06:42 +030036
37 node_name: {{ HOSTNAME_CFG01 }}
38 retry: {count: 1, delay: 10}
39 skip_fail: false
40
Dennis Dmitriev492813e2017-08-09 15:08:58 +030041{{ SHARED.MACRO_GENERATE_INVENTORY() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030042
Dennis Dmitriev492813e2017-08-09 15:08:58 +030043{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030044
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030045- description: Hack gtw node
Dennis Dmitriev5ec4d572017-09-27 00:47:54 +030046 cmd: salt 'gtw*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030047 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 10}
49 skip_fail: false
50
51- description: Hack cmp01 node
Dennis Dmitriev5ec4d572017-09-27 00:47:54 +030052 cmd: salt 'cmp01*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030053 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 10}
55 skip_fail: false
56
57- description: Hack cmp02 node
Dennis Dmitriev5ec4d572017-09-27 00:47:54 +030058 cmd: salt 'cmp02*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030059 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 10}
61 skip_fail: false