blob: c0292a4752c9f1d0c1a6e60d938883a4663d75cf [file] [log] [blame]
PGlazov3a9f3332021-11-23 15:40:00 +04001{% 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 = 'released-bm-b300-cicd-queens-ovs-maas' %}
6# Name of the context file (without extension, that is fixed .yaml) used to render the Environment model
7{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','released-bm-b300-cicd-queens-ovs-maas') %}
8# 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{%- set CISCO_PASS = os_env('CISCO_PASS', 'cisco_pass') %}
17
18
19{% import 'shared-salt.yaml' as SHARED with context %}
20
21{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
22
23{{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }}
24
25{{ SHARED.MACRO_INSTALL_FORMULAS('\*') }}
26
27{{ SHARED.MACRO_UPLOAD_AND_IMPORT_GPG_ENCRYPTION_KEY() }}
28
29{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
30
31{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
PGlazov3a9f3332021-11-23 15:40:00 +040032- description: Temporary WR for correct bridge name according to envoronment templates
33 cmd: |
34 sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
35 sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
36 sed -i 's/br\-baremetal/br\_baremetal/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 sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml;
50 sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml;
51 sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml;
52 sed -i 's/==CISCO_PASS==/${_param:cisco_password}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml;
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 10}
55 skip_fail: false
56
57- description: "Add user/password for IPMI access"
58 cmd: |
59 set -e;
60 set -x;
61 . /root/venv-reclass-tools/bin/activate;
62 reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
63 reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
64 reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml;
65 reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml;
66 reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml;
67 reclass-tools add-key parameters._param.cisco_password {{ CISCO_PASS }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml;
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: false
Pavel Glazov44f93332022-06-01 04:49:58 +040071
72- description: Inject jenkins-formula extra repo to cluster model
73 cmd: |
74 . venv-reclass-tools/bin/activate;
Pavel Glazov42359f02023-03-21 15:46:57 +040075 reclass-tools add-key parameters.linux.system.repo.salt-formula-jenkins-2019-2-19.source "deb [trusted=yes] http://cz7780.bud.mirantis.net:8080/salt-formula-jenkins-2019.2.19/ xenial main" /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/init.yml
Pavel Glazov44f93332022-06-01 04:49:58 +040076 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 1}
78 skip_fail: false