ibumarskov | 12b79ae | 2018-03-15 01:11:41 -0700 | [diff] [blame^] | 1 | {% from 'virtual-mcp-mitaka-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-mcp-mitaka-dvr/underlay.yaml' import HOSTNAME_CMP01 with context %} |
| 3 | {% from 'virtual-mcp-mitaka-dvr/underlay.yaml' import HOSTNAME_CMP02 with context %} |
| 4 | {% from 'virtual-mcp-mitaka-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 5 | {% from 'virtual-mcp-mitaka-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 6 | {% from 'virtual-mcp-mitaka-dvr/underlay.yaml' import DOMAIN_NAME with context %} |
| 7 | |
| 8 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %} |
| 9 | # Other salt model repository parameters see in shared-salt.yaml |
| 10 | |
| 11 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 12 | |
| 13 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 14 | |
| 15 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 16 | |
| 17 | {{ 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"') }} |
| 18 | |
| 19 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 20 | |
| 21 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 22 | |
| 23 | {{ SHARED.ADJUST_SL_OPTS(OVERRIDES_FILENAME='/srv/salt/reclass/classes/cluster/' + SHARED.CLUSTER_NAME + '/stacklight/server.yml') }} |
| 24 | |
| 25 | #- description: "Workaround for PROD-14831 , add 'dns' role to cmp01 and cmp02 nodes" |
| 26 | # cmd: | |
| 27 | # set -e; |
| 28 | # apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev; |
| 29 | # [[ -d /root/venv-reclass-tools ]] || virtualenv /root/venv-reclass-tools; |
| 30 | # . /root/venv-reclass-tools/bin/activate; |
| 31 | # pip install git+https://github.com/dis-xcom/reclass-tools; |
| 32 | |
| 33 | # # Combine 'dns' role with compute nodes |
| 34 | # reclass-tools add-key 'classes' 'cluster.{{ LAB_CONFIG_NAME }}.openstack.dns' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute.yml --merge; |
| 35 | # # Remove linux.network.interface hardcode from 'dns' role to avoid conflict with compute interfaces |
| 36 | # reclass-tools del-key parameters.linux.network.interface /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/dns.yml |
| 37 | |
| 38 | # export REPLACE_DIRS="/srv/salt/reclass/classes/ /srv/salt/reclass/nodes/" |
| 39 | # find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node01_address:.*/openstack_dns_node01_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/g' {} + |
| 40 | # find ${REPLACE_DIRS} -type f -exec sed -i 's/openstack_dns_node02_address:.*/openstack_dns_node02_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/g' {} + |
| 41 | |
| 42 | # node_name: {{ HOSTNAME_CFG01 }} |
| 43 | # retry: {count: 1, delay: 10} |
| 44 | # skip_fail: false |
| 45 | |
| 46 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 47 | |
| 48 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 49 | |
| 50 | - description: Hack gtw node |
| 51 | cmd: salt '{{ HOSTNAME_GTW01 }}' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4"; |
| 52 | node_name: {{ HOSTNAME_CFG01 }} |
| 53 | retry: {count: 1, delay: 10} |
| 54 | skip_fail: false |
| 55 | |
| 56 | - description: Hack cmp01 node |
| 57 | cmd: salt '{{ HOSTNAME_CMP01 }}' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4"; |
| 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 1, delay: 10} |
| 60 | skip_fail: false |
| 61 | |
| 62 | - description: Hack cmp02 node |
| 63 | cmd: salt '{{ HOSTNAME_CMP02 }}' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4"; |
| 64 | node_name: {{ HOSTNAME_CFG01 }} |
| 65 | retry: {count: 1, delay: 10} |
| 66 | skip_fail: false |