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 | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 2 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CMP01 with context %} |
| 3 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CMP02 with context %} |
| 4 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %} |
Dennis Dmitriev | 5ec4d57 | 2017-09-27 00:47:54 +0300 | [diff] [blame] | 5 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 6 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import DOMAIN_NAME with context %} |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 7 | |
| 8 | {% 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] | 9 | # Other salt model repository parameters see in shared-salt.yaml |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame^] | 10 | {% set OVERRIDES = os_env('OVERRIDES', 'override_example: true') %} |
| 11 | {% set OVERRIDES_FILENAME = os_env('OVERRIDES_FILENAME', '/srv/salt/reclass/classes/environment/virtual-mcp-ocata-dvr/overrides.yml') %} |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 12 | |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 13 | {% import 'shared-salt.yaml' as SHARED with context %} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 14 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 15 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 16 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 17 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 18 | |
ibumarskov | 75e9010 | 2018-05-24 14:45:46 +0400 | [diff] [blame] | 19 | {{ 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" "glusterfs" "jenkins" "maas" "backupninja" "fluentd"') }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 20 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 21 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 22 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 23 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 24 | |
ibumarskov | 5921bb2 | 2018-06-25 16:49:37 +0400 | [diff] [blame^] | 25 | {%- if OVERRIDES != '' %} |
| 26 | {%- for param in OVERRIDES.splitlines() %} |
| 27 | {%- set key, value = param.replace(' ','').split(':') %} |
| 28 | - description: Override cluster parameters |
| 29 | cmd: | |
| 30 | salt-call reclass.cluster_meta_set name='{{ key }}' value='{{ value }}' file_name='{{OVERRIDES_FILENAME}}' |
| 31 | node_name: {{ HOSTNAME_CFG01 }} |
| 32 | retry: {count: 1, delay: 1} |
| 33 | skip_fail: false |
| 34 | {%- endfor %} |
| 35 | |
| 36 | - description: Refresh pillar |
| 37 | cmd: salt '*' saltutil.refresh_pillar |
| 38 | node_name: {{ HOSTNAME_CFG01 }} |
| 39 | retry: {count: 1, delay: 1} |
| 40 | skip_fail: false |
| 41 | {%- endif %} |
| 42 | |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 43 | {{ SHARED.ADJUST_SL_OPTS(OVERRIDES_FILENAME='/srv/salt/reclass/classes/cluster/' + SHARED.CLUSTER_NAME + '/stacklight/server.yml') }} |
| 44 | |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 45 | #- description: "Workaround for PROD-14831 , add 'dns' role to cmp01 and cmp02 nodes" |
| 46 | # cmd: | |
| 47 | # set -e; |
| 48 | # apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev; |
| 49 | # [[ -d /root/venv-reclass-tools ]] || virtualenv /root/venv-reclass-tools; |
| 50 | # . /root/venv-reclass-tools/bin/activate; |
| 51 | # pip install git+https://github.com/dis-xcom/reclass-tools; |
Dennis Dmitriev | 7114797 | 2017-09-28 21:37:58 +0300 | [diff] [blame] | 52 | |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 53 | # # Combine 'dns' role with compute nodes |
| 54 | # reclass-tools add-key 'classes' 'cluster.{{ LAB_CONFIG_NAME }}.openstack.dns' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute.yml --merge; |
| 55 | # # Remove linux.network.interface hardcode from 'dns' role to avoid conflict with compute interfaces |
| 56 | # 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] | 57 | |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 58 | # export REPLACE_DIRS="/srv/salt/reclass/classes/ /srv/salt/reclass/nodes/" |
| 59 | # find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node01_address:.*/openstack_dns_node01_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/g' {} + |
| 60 | # 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] | 61 | |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 62 | # node_name: {{ HOSTNAME_CFG01 }} |
| 63 | # retry: {count: 1, delay: 10} |
| 64 | # skip_fail: false |
Dennis Dmitriev | 04e62dd | 2017-09-26 19:06:42 +0300 | [diff] [blame] | 65 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 66 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 67 | |
Dennis Dmitriev | 492813e | 2017-08-09 15:08:58 +0300 | [diff] [blame] | 68 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 69 | |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 70 | - description: Hack gtw node |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 71 | cmd: salt '{{ HOSTNAME_GTW01 }}' 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] | 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 10} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Hack cmp01 node |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 77 | cmd: salt '{{ HOSTNAME_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] | 78 | node_name: {{ HOSTNAME_CFG01 }} |
| 79 | retry: {count: 1, delay: 10} |
| 80 | skip_fail: false |
| 81 | |
| 82 | - description: Hack cmp02 node |
Dennis Dmitriev | d52025d | 2018-02-20 07:46:56 +0200 | [diff] [blame] | 83 | cmd: salt '{{ HOSTNAME_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] | 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 10} |
| 86 | skip_fail: false |