blob: 125b6e1b1934ac5508905a536268b3eaada88c32 [file] [log] [blame]
Oleksii Butenkoade9c6c2018-03-05 15:16:40 +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 SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-baremetal-lab') %}
5# Other salt model repository parameters see in shared-salt.yaml
6{% set LAB_CONFIG_NAME = 'cookied-bm-mcp-ovs-dpdk' %}
Tatyana Leontovich14e201d2018-07-05 13:28:54 +03007{% set SALT_VERSION = os_env('SALT_VERSION', '2017.7') %}
Oleksii Butenkoade9c6c2018-03-05 15:16:40 +02008# Name of the context file (without extension, that is fixed .yaml) used to render the Environment model
9{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','cookied-bm-mcp-ovs-dpdk') %}
10# Path to the context files used to render Cluster and Environment models
11{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-openstack_ovs_dpdk.yaml' %}
12{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-vcp-environment.yaml', 'salt-context-environment.yaml'] %}
13{%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2416') %}
14{%- set TENANT_VLAN = os_env('TENANT_VLAN', '2417') %}
Oleksii Butenko9d9b0502018-04-25 15:45:07 +030015{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %}
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030016{% set SALT_REPOSITORY = os_env('SALT_REPOSITORY', "deb [arch=amd64] http://apt.mirantis.com/${DISTRIB_CODENAME}/salt/" + SALT_VERSION + REPOSITORY_SUITE + " main") %}
17{# set SALT_REPOSITORY = os_env('SALT_REPOSITORY', "deb [arch=amd64] http://mirror.mirantis.com/" + REPOSITORY_SUITE+ "/saltstack-2016.3/${DISTRIB_CODENAME} ${DISTRIB_CODENAME} main") #}
Oleksii Butenkoade9c6c2018-03-05 15:16:40 +020018{% import 'shared-salt.yaml' as SHARED with context %}
19
20{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
21
22{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
23
24{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
25
26- description: Re-install all the fromulas
27 cmd: |
28 set -e;
29 apt-get install -y salt-formula-*
30 node_name: {{ HOSTNAME_CFG01 }}
31 retry: {count: 1, delay: 1}
32 skip_fail: false
33
Tatyana Leontovich2e892752018-07-05 19:56:10 +030034- description: Sync formulas to service
35 cmd: |
36 set -e;
37 RECLASS_ROOT=${RECLASS_ROOT:-/srv/salt/reclass/};
38 FORMULAS_PATH=${FORMULAS_PATH:-/usr/share/salt-formulas};
39 [ ! -d ${RECLASS_ROOT}/classes/service ] && mkdir -p ${RECLASS_ROOT}/classes/service;
40 for formula_service in $(ls /usr/share/salt-formulas/reclass/service/); do
41 #Since some salt formula names contain "-" and in symlinks they should contain "_" adding replacement;
42 formula_service=${formula_service//-/$'_'};
43 if [ ! -L "${RECLASS_ROOT}/classes/service/${formula_service}" ]; then
44 ln -sf ${FORMULAS_PATH}/reclass/service/${formula_service} ${RECLASS_ROOT}/classes/service/${formula_service};
45 fi;
46 done
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 1}
49 skip_fail: false
50
Oleksii Butenkoade9c6c2018-03-05 15:16:40 +020051- description: "Workaround for rack01 compute generator"
52 cmd: |
53 set -e;
54 . /root/venv-reclass-tools/bin/activate;
55 # Remove rack01 key
56 reclass-tools del-key parameters.reclass.storage.node.openstack_compute_rack01 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
57 # Add openstack_compute_node definition from system
58 reclass-tools add-key 'classes' 'system.reclass.storage.system.openstack_compute_multi' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml --merge;
Oleksii Butenkoade9c6c2018-03-05 15:16:40 +020059 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 10}
61 skip_fail: false
62
63
64- description: Temporary workaround for removing cinder-volume from CTL nodes
65 cmd: |
66 sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml;
67 sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml;
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: true
71
72{{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }}
73