blob: 0ff7c82d069278d4a899694ce18e5003c56ae8fd [file] [log] [blame]
Tatyana Leontovichbfbc4832018-12-27 12:47:23 +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-cicd-bm-queens-contrail-maas' %}
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-cicd-bm-queens-contrail-maas') %}
7# Path to the context files used to render Cluster and Environment models
8{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-contrail.yaml' %}
9{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml', 'salt-context-cookiecutter-contrail.yaml'] %}
10{%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2422') %}
11{%- set TENANT_VLAN = os_env('TENANT_VLAN', '2423') %}
12
13{%- set IPMI_USER = os_env('IPMI_USER', 'mcp-qa') %}
14{%- set IPMI_PASS = os_env('IPMI_PASS', 'password') %}
15
16{% import 'shared-salt.yaml' as SHARED with context %}
17
18{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
19
Tatyana Leontovich3fb53412019-05-24 00:46:12 +030020{{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }}
21
Tatyana Leontovichbfbc4832018-12-27 12:47:23 +020022{{ SHARED.MACRO_INSTALL_FORMULAS('\*') }}
23
24{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
25
26{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
27
28- description: Temporary WR for cinder backend defined by default in reclass.system
29 cmd: |
30 sed -i 's/backend\:\ {}//g' /srv/salt/reclass/classes/system/cinder/control/cluster.yml;
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 5}
33 skip_fail: false
34
35- description: Temporary WR for correct bridge name according to envoronment templates
36 cmd: |
37 sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
38 sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 10}
41 skip_fail: false
42
43{{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }}
44
45- description: Defining username and password params for IPMI access
46 cmd: |
47 sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
48 sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 10}
51 skip_fail: false
52
53- description: "Add user/password for IPMI access"
54 cmd: |
55 set -e;
56 set -x;
57 . /root/venv-reclass-tools/bin/activate;
58 reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
59 reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 1, delay: 5}
62 skip_fail: false
63
64- description: Temporary workaround !! Fix or debug
65 cmd: |
66 sed -i 's/pg_num: 128/pg_num: 4/g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/ceph/setup.yml;
67 sed -i 's/pgp_num: 128/pgp_num: 4/g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/ceph/setup.yml;
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: true