blob: 4d554c4c70ad8f61d3b67a9873084117351d5311 [file] [log] [blame]
Tatyana Leontovich4565c522018-12-28 02:48:56 +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# Other salt model repository parameters see in shared-salt.yaml
5{% set LAB_CONFIG_NAME = 'cookied-cicd-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','cookied-cicd-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
17
18{% import 'shared-salt.yaml' as SHARED with context %}
19
20{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
21
Tatyana Leontovich3fb53412019-05-24 00:46:12 +030022{{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }}
23
Tatyana Leontovich4565c522018-12-28 02:48:56 +020024{{ SHARED.MACRO_INSTALL_FORMULAS('\*') }}
25
26{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
27
28{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
29
30
31- description: Temporary WR for correct bridge name according to envoronment templates
32 cmd: |
33 sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
34 sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
35 sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml;
36 salt '*' saltutil.refresh_pillar;
37 node_name: {{ HOSTNAME_CFG01 }}
38 retry: {count: 1, delay: 10}
39 skip_fail: false
40
41{{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }}
42
43- description: Defining username and password params for IPMI access
44 cmd: |
45 sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
46 sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 10}
49 skip_fail: false
50
51- description: "Add user/password for IPMI access"
52 cmd: |
53 set -e;
54 set -x;
55 . /root/venv-reclass-tools/bin/activate;
56 reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
57 reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml;
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
Oleksii Butenkob00ffcc2019-02-18 17:06:12 +020060 skip_fail: false