blob: 4cefd30dd7d49bb6e5a9bda86e00d7004749a51b [file] [log] [blame]
Hanna Arhipovada9d7702021-04-13 15:14:13 +03001{% 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# Other salt model repository parameters see in shared-salt.yaml
5{% set LAB_CONFIG_NAME = 'bm-e7-cicd-pike-ovs-maas' %}
6# Name of the context file (without extension, that is fixed .yaml) used to render the Environment model
Taras Khlivnyakb68630b2021-04-26 23:24:56 +03007{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','bm-e7-cicd-pike-ovs-maas') %}
Hanna Arhipovada9d7702021-04-13 15:14:13 +03008# Path to the context files used to render Cluster and Environment models
9{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-openstack_ovs.yaml' %}
10{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-vcp-environment.yaml', 'salt-context-environment.yaml','salt-context-cookiecutter-openstack_ovs.yaml'] %}
11{%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2404') %}
12{%- set TENANT_VLAN = os_env('TENANT_VLAN', '2406') %}
13
14{%- set IPMI_USER = os_env('IPMI_USER', 'mcp-qa') %}
15{%- set IPMI_PASS = os_env('IPMI_PASS', 'password') %}
16
17
18{% import 'shared-salt.yaml' as SHARED with context %}
19
20{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
21
22{{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }}
23
24{{ SHARED.MACRO_INSTALL_FORMULAS('\*') }}
25
26{{ SHARED.MACRO_UPLOAD_AND_IMPORT_GPG_ENCRYPTION_KEY() }}
27
28{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
29
Taras Khlivnyakb68630b2021-04-26 23:24:56 +030030{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL(KNOWN_HOST_AUTOPOPULATION=false) }}
Hanna Arhipovada9d7702021-04-13 15:14:13 +030031
32
33- description: Temporary WR for correct bridge name according to envoronment templates
34 cmd: |
35 sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
36 sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
37 sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml;
38 salt '*' saltutil.refresh_pillar;
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}
Denis V. Meltsaykin3e4f3fc2021-05-03 11:39:17 +020062 skip_fail: false
Taras Khlivnyakb63a8d02021-05-07 06:39:57 +030063
64- description: "Setting workarounds for non-ceph deployments"
65 cmd: |
66 set -e;
67 set -x;
68 . /root/venv-reclass-tools/bin/activate;
69 reclass-tools add-key --merge classes system.cinder.volume.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml
70 reclass-tools add-key --merge classes system.cinder.volume.notification.messagingv2 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml
71 reclass-tools add-key parameters.cinder.volume.default_volume_type lvm-driver /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml
72 reclass-tools add-key parameters.cinder.volume.backend.lvm-driver.engine lvm /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml
73 reclass-tools add-key parameters.cinder.volume.backend.lvm-driver.type_name lvm-driver /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml
74 reclass-tools add-key parameters.cinder.volume.backend.lvm-driver.volume_group cinder-vg /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml
75 sed -i '/system.cinder.volume.single/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml
76 sed -i '/system.cinder.volume.notification.messagingv2/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml
77 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: false