sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 1 | {% 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-os-contrail40-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-os-contrail40-maas') %} |
| 7 | # Path to the context files used to render Cluster and Environment models |
| 8 | {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-contrail.yaml' %} |
obutenko | a87bca9 | 2018-12-20 15:25:57 +0200 | [diff] [blame] | 9 | {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml', 'salt-context-cookiecutter-contrail.yaml'] %} |
sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 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 Leontovich | 3fb5341 | 2019-05-24 00:46:12 +0300 | [diff] [blame] | 20 | {{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }} |
| 21 | |
sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 22 | {{ 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 | |
sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 28 | - description: Temporary WR for correct bridge name according to envoronment templates |
| 29 | cmd: | |
| 30 | sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 31 | sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 32 | node_name: {{ HOSTNAME_CFG01 }} |
| 33 | retry: {count: 1, delay: 10} |
| 34 | skip_fail: false |
| 35 | |
| 36 | {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }} |
| 37 | |
sgudz | 1d3f6ce | 2018-12-20 12:44:16 +0200 | [diff] [blame] | 38 | - description: Defining username and password params for IPMI access |
sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 39 | cmd: | |
sgudz | 1d3f6ce | 2018-12-20 12:44:16 +0200 | [diff] [blame] | 40 | sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 41 | sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 42 | node_name: {{ HOSTNAME_CFG01 }} |
| 43 | retry: {count: 1, delay: 10} |
| 44 | skip_fail: false |
| 45 | |
| 46 | - description: "Add user/password for IPMI access" |
| 47 | cmd: | |
| 48 | set -e; |
| 49 | set -x; |
| 50 | . /root/venv-reclass-tools/bin/activate; |
sgudz | 1d3f6ce | 2018-12-20 12:44:16 +0200 | [diff] [blame] | 51 | reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 52 | reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
sgudz | c97385a | 2018-11-29 17:01:53 +0200 | [diff] [blame] | 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 5} |
| 55 | skip_fail: false |