Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
Dennis Dmitriev | 5ec4d57 | 2017-09-27 00:47:54 +0300 | [diff] [blame] | 2 | {% 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 Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 4 | |
| 5 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %} |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 6 | # Other salt model repository parameters see in shared-salt.yaml |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 7 | |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 8 | {% import 'shared-salt.yaml' as SHARED with context %} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 9 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 10 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 11 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 12 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 13 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 14 | {{ 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 Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 15 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 16 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 17 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 18 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 19 | |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 20 | - description: "Workaround for PROD-14831 , add 'dns' role to cmp01 and cmp02 nodes" |
Dennis Dmitriev | 04e62dd | 2017-09-26 19:06:42 +0300 | [diff] [blame] | 21 | cmd: | |
| 22 | set -e; |
| 23 | apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev; |
| 24 | pip install git+https://github.com/dis-xcom/reclass-tools; |
Dennis Dmitriev | 7114797 | 2017-09-28 21:37:58 +0300 | [diff] [blame] | 25 | |
| 26 | # Combine 'dns' role with compute nodes |
Dennis Dmitriev | b2326d4 | 2017-09-28 10:14:04 +0300 | [diff] [blame] | 27 | reclass-tools add-key 'classes' 'cluster.{{ LAB_CONFIG_NAME }}.openstack.dns' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute.yml --merge; |
Dennis Dmitriev | 7114797 | 2017-09-28 21:37:58 +0300 | [diff] [blame] | 28 | # Remove linux.network.interface hardcode from 'dns' role to avoid conflict with compute interfaces |
| 29 | reclass-tools del-key parameters.linux.network.interface /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/dns.yml |
Dennis Dmitriev | 04e62dd | 2017-09-26 19:06:42 +0300 | [diff] [blame] | 30 | |
| 31 | export REPLACE_DIRS="/srv/salt/reclass/classes/ /srv/salt/reclass/nodes/" |
Dennis Dmitriev | b2326d4 | 2017-09-28 10:14:04 +0300 | [diff] [blame] | 32 | find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node01_address:.*/openstack_dns_node01_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/g' {} + |
| 33 | 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 Dmitriev | 04e62dd | 2017-09-26 19:06:42 +0300 | [diff] [blame] | 34 | |
| 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 10} |
| 37 | skip_fail: false |
| 38 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 39 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 40 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 41 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 42 | |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 43 | - description: Hack gtw node |
Dennis Dmitriev | 5ec4d57 | 2017-09-27 00:47:54 +0300 | [diff] [blame] | 44 | cmd: salt 'gtw*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4"; |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 45 | node_name: {{ HOSTNAME_CFG01 }} |
| 46 | retry: {count: 1, delay: 10} |
| 47 | skip_fail: false |
| 48 | |
| 49 | - description: Hack cmp01 node |
Dennis Dmitriev | 5ec4d57 | 2017-09-27 00:47:54 +0300 | [diff] [blame] | 50 | cmd: salt 'cmp01*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4"; |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 10} |
| 53 | skip_fail: false |
| 54 | |
| 55 | - description: Hack cmp02 node |
Dennis Dmitriev | 5ec4d57 | 2017-09-27 00:47:54 +0300 | [diff] [blame] | 56 | cmd: salt 'cmp02*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4"; |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 10} |
| 59 | skip_fail: false |