Vladimir Khlyunev | 375b945 | 2024-11-21 01:46:31 +0400 | [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 | # Other salt model repository parameters see in shared-salt.yaml |
| 5 | {% set LAB_CONFIG_NAME = 'bm-queens-sriov-ovs' %} |
| 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','bm-queens-sriov-ovs') %} |
| 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() }} |
| 32 | |
| 33 | |
| 34 | - description: Temporary WR for correct bridge name according to envoronment templates |
| 35 | cmd: | |
| 36 | sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 37 | sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 38 | sed -i 's/br\-baremetal/br\_baremetal/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 39 | sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml; |
| 40 | salt '*' saltutil.refresh_pillar; |
| 41 | node_name: {{ HOSTNAME_CFG01 }} |
| 42 | retry: {count: 1, delay: 10} |
| 43 | skip_fail: false |
| 44 | |
| 45 | {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }} |
| 46 | |
| 47 | - description: Defining username and password params for IPMI access |
| 48 | cmd: | |
| 49 | sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 50 | sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 51 | sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml; |
| 52 | sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml; |
| 53 | sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml; |
| 54 | sed -i 's/==CISCO_PASS==/${_param:cisco_password}/g' /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml; |
| 55 | node_name: {{ HOSTNAME_CFG01 }} |
| 56 | retry: {count: 1, delay: 10} |
| 57 | skip_fail: false |
| 58 | |
| 59 | - description: "Add user/password for IPMI access" |
| 60 | cmd: | |
| 61 | set -e; |
| 62 | set -x; |
| 63 | . /root/venv-reclass-tools/bin/activate; |
| 64 | reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 65 | reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 66 | reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml; |
| 67 | reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/baremetal_nodes.yml; |
| 68 | reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml; |
| 69 | reclass-tools add-key parameters._param.cisco_password {{ CISCO_PASS }} /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/features/ironic/switch.yml; |
| 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 1, delay: 5} |
| 72 | skip_fail: false |
| 73 | |
| 74 | - description: "Maas disk_erase_with_secure_erase set false" |
| 75 | cmd: | |
| 76 | set -e; |
| 77 | set -x; |
| 78 | . /root/venv-reclass-tools/bin/activate; |
| 79 | reclass-tools add-bool-key parameters.maas.region.maas_config.disk_erase_with_secure_erase false /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 80 | node_name: {{ HOSTNAME_CFG01 }} |
| 81 | retry: {count: 1, delay: 5} |
| 82 | skip_fail: false |
| 83 | |
| 84 | - description: "SR-IOV configuration" |
| 85 | cmd: | |
| 86 | set -e; |
| 87 | set -x; |
| 88 | . /root/venv-reclass-tools/bin/activate; |
| 89 | reclass-tools add-key --merge classes system.neutron.compute.nfv.sriov /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 90 | reclass-tools add-key parameters._param.sriov_nic01_device_name ten2 /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 91 | reclass-tools add-key parameters._param.sriov_nic01_numvfs 16 /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 92 | reclass-tools add-key parameters._param.sriov_nic01_physical_network physnet1 /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 93 | reclass-tools add-bool-key parameters._param.sriov_unsafe_interrupts True /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 94 | reclass-tools add-key parameters.nova.compute.sriov.sriov_nic01.physical_network '${_param:sriov_nic01_physical_network}' /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 95 | reclass-tools add-key parameters.nova.compute.sriov.sriov_nic01.devname '${_param:sriov_nic01_device_name}' /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 96 | reclass-tools add-key parameters.linux.system.kernel.boot_options "['intel_iommu=on']" /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 97 | reclass-tools add-bool-key parameters.linux.system.kernel.sriov True /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 98 | reclass-tools add-bool-key parameters.linux.system.kernel.unsafe_interrupts True /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 99 | reclass-tools add-key parameters.linux.network.interface.ten2.pre_up_cmds "['echo \${_param:sriov_nic01_numvfs} > /sys/class/net/\${_param:sriov_nic01_device_name}/device/sriov_numvfs']" /srv/salt/reclass/classes/cluster/*/openstack/compute/init.yml |
| 100 | reclass-tools add-key --merge classes system.neutron.control.openvswitch.sriov /srv/salt/reclass/classes/cluster/*/openstack/control.yml |
| 101 | reclass-tools add-key parameters.nova.controller.pci.alias.alias.name intelvf /srv/salt/reclass/classes/cluster/*/openstack/control.yml |
| 102 | reclass-tools add-key parameters.nova.controller.pci.alias.alias.product_id 10ed /srv/salt/reclass/classes/cluster/*/openstack/control.yml |
| 103 | reclass-tools add-key parameters.nova.controller.pci.alias.alias.device_type type-VF /srv/salt/reclass/classes/cluster/*/openstack/control.yml |
| 104 | reclass-tools add-key --str parameters.nova.controller.pci.alias.alias.vendor_id "8086" /srv/salt/reclass/classes/cluster/*/openstack/control.yml |
| 105 | |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 5} |
| 108 | skip_fail: false |