blob: d27b6ae6b7087128788ef795aeebcd97862859df [file] [log] [blame]
Dennis Dmitriev85559962018-01-30 15:35:51 +02001{% from 'cookied-model-generator/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-model-generator/underlay.yaml' import DOMAIN_NAME with context %}
3
4{% set LAB_CONFIG_NAME = 'cookied-bm-mcp-dvr-vxlan' %}
5# Name of the context file (without extension, that is fixed .yaml) used to render the Environment model
6{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','cookied-bm-mcp-dvr-vxlan') %}
7# Path to the context files used to render Cluster and Environment models
8{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-openstack_ovs_dvr_vxlan.yaml' %}
9{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-vcp-environment.yaml', 'salt-context-lab03-environment.yaml'] %}
10{%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2416') %}
11{%- set TENANT_VLAN = os_env('TENANT_VLAN', '2417') %}
12
13{% import 'shared-salt.yaml' as SHARED with context %}
14
Dennis Dmitriev2c9db8d2018-03-26 21:49:59 +030015{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
16- description: Re-install all the fromulas
17 cmd: |
18 set -e;
19 apt-get install -y salt-formula-*
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 1}
22 skip_fail: false
23
Tatyana Leontovich2e892752018-07-05 19:56:10 +030024- description: Sync formulas to service
25 cmd: |
26 set -e;
27 RECLASS_ROOT=${RECLASS_ROOT:-/srv/salt/reclass/};
28 FORMULAS_PATH=${FORMULAS_PATH:-/usr/share/salt-formulas};
29 [ ! -d ${RECLASS_ROOT}/classes/service ] && mkdir -p ${RECLASS_ROOT}/classes/service;
30 for formula_service in $(ls /usr/share/salt-formulas/reclass/service/); do
31 #Since some salt formula names contain "-" and in symlinks they should contain "_" adding replacement;
32 formula_service=${formula_service//-/$'_'};
33 if [ ! -L "${RECLASS_ROOT}/classes/service/${formula_service}" ]; then
34 ln -sf ${FORMULAS_PATH}/reclass/service/${formula_service} ${RECLASS_ROOT}/classes/service/${formula_service};
35 fi;
36 done
37 node_name: {{ HOSTNAME_CFG01 }}
38 retry: {count: 1, delay: 1}
39 skip_fail: false
40
Dennis Dmitriev85559962018-01-30 15:35:51 +020041{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
42
43{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
44
45- description: Temporary WR for cinder backend defined by default in reclass.system
46 cmd: |
47 sed -i 's/backend\:\ {}//g' /srv/salt/reclass/classes/system/cinder/control/cluster.yml;
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: "Workaround for rack01 compute generator"
53 cmd: |
54 set -e;
55 . /root/venv-reclass-tools/bin/activate;
56 # Remove rack01 key
Dennis Dmitrievcb77f022018-02-18 20:42:35 +020057 reclass-tools del-key parameters.reclass.storage.node.openstack_compute_rack01 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
Dennis Dmitriev85559962018-01-30 15:35:51 +020058
59 # Add openstack_compute_node definition from system
Dennis Dmitrievcb77f022018-02-18 20:42:35 +020060 reclass-tools add-key 'classes' 'system.reclass.storage.system.openstack_compute_multi' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml --merge;
Dennis Dmitriev85559962018-01-30 15:35:51 +020061
62 # Set ipaddresses for our nodes
Dennis Dmitrievcb77f022018-02-18 20:42:35 +020063 reclass-tools add-key parameters._param.openstack_compute_node01_control_address 10.167.4.3 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
64 reclass-tools add-key parameters._param.openstack_compute_node02_control_address 10.167.4.31 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
65 reclass-tools add-key parameters._param.openstack_compute_node01_tenant_address 10.167.6.3 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
66 reclass-tools add-key parameters._param.openstack_compute_node02_tenant_address 10.167.6.31 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
Dennis Dmitriev85559962018-01-30 15:35:51 +020067
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 10}
70 skip_fail: false
71
72- description: Temporary workaround for removing cinder-volume from CTL nodes
73 cmd: |
Dennis Dmitrievcb77f022018-02-18 20:42:35 +020074 sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml;
75 sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml;
Dennis Dmitriev85559962018-01-30 15:35:51 +020076 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: true
79
80#- description: Refresh pillars and install dependencies for salt-master
81# cmd: |
82# salt '*' saltutil.refresh_pillar; sleep 5;
83# salt '*' state.sls salt.master;
84# salt '*' saltutil.refresh_pillar; sleep 5;
85# node_name: {{ HOSTNAME_CFG01 }}
86# retry: {count: 1, delay: 5}
87# skip_fail: false
88
89{{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }}