| {% from 'cookied-model-generator/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| {% from 'cookied-model-generator/underlay.yaml' import DOMAIN_NAME with context %} |
| |
| # Other salt model repository parameters see in shared-salt.yaml |
| {% set LAB_CONFIG_NAME = 'bm-e7-cicd-pike-odl-maas' %} |
| # Name of the context file (without extension, that is fixed .yaml) used to render the Environment model |
| {% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','bm-e7-cicd-pike-odl-maas') %} |
| # Path to the context files used to render Cluster and Environment models |
| {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-openstack_odl.yaml' %} |
| {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-vcp-environment.yaml', 'salt-context-environment.yaml','salt-context-cookiecutter-openstack_odl.yaml'] %} |
| {%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2404') %} |
| {%- set TENANT_VLAN = os_env('TENANT_VLAN', '2406') %} |
| |
| {%- set IPMI_USER = os_env('IPMI_USER', 'mcp-qa') %} |
| {%- set IPMI_PASS = os_env('IPMI_PASS', 'password') %} |
| {%- set ODL_CONTROLLER_IP = '10.167.11.220' %} |
| |
| |
| {% import 'shared-salt.yaml' as SHARED with context %} |
| |
| {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }} |
| |
| {{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }} |
| |
| {{ SHARED.MACRO_INSTALL_FORMULAS('\*') }} |
| |
| {{ SHARED.MACRO_UPLOAD_AND_IMPORT_GPG_ENCRYPTION_KEY() }} |
| |
| {{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }} |
| |
| {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL(KNOWN_HOST_AUTOPOPULATION=false) }} |
| |
| |
| - description: Temporary WR for correct bridge name according to envoronment templates |
| cmd: | |
| sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml; |
| salt '*' saltutil.refresh_pillar; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: "Add OpenDayLight as Neutron backend" |
| cmd: | |
| set -e; |
| set -x; |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools add-key --merge classes service.neutron.compute.opendaylight.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| reclass-tools add-key --merge classes service.neutron.gateway.opendaylight.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml |
| reclass-tools add-key --merge classes system.neutron.control.opendaylight.cluster /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| reclass-tools add-key parameters.neutron.server.backend.rest_api_port 8282 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| reclass-tools add-key parameters.neutron.server.backend.user admin /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| reclass-tools add-key parameters.neutron.server.backend.password admin /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| reclass-tools add-key parameters._param.opendaylight_service_host {{ ODL_CONTROLLER_IP }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/init.yml |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Add opendaylight control single class |
| cmd: | |
| set -e; |
| set -x; |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools add-key --merge parameters.reclass.storage.node.opendaylight_control_node01.classes system.reclass.storage.system.opendaylight_control_single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/nodes.yml; |
| sed -i 's/ system.reclass.storage.system.opendaylight_control_single/\n \- system.reclass.storage.system.opendaylight_control_single/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/nodes.yml |
| reclass-tools add-key --merge parameters.reclass.storage.node.opendaylight_control_node01.classes cluster.{{ LAB_CONFIG_NAME }}.infra /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/nodes.yml; |
| salt '*' saltutil.refresh_pillar; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }} |
| |
| - description: Defining username and password params for IPMI access |
| cmd: | |
| sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: "Add user/password for IPMI access" |
| cmd: | |
| set -e; |
| set -x; |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: "Setting workarounds for non-ceph deployments" |
| cmd: | |
| set -e; |
| set -x; |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools add-key --merge classes system.cinder.volume.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| reclass-tools add-key --merge classes system.cinder.volume.notification.messagingv2 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| reclass-tools add-key parameters.cinder.volume.default_volume_type lvm-driver /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| reclass-tools add-key parameters.cinder.volume.backend.lvm-driver.engine lvm /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| 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 |
| 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 |
| sed -i '/system.cinder.volume.single/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| sed -i '/system.cinder.volume.notification.messagingv2/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: "Upload env_add.yml to cfg01.{{ DOMAIN_NAME }}" |
| upload: |
| local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| local_filename: env_add.yml |
| remote_path: /root/environment/ |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: "Upload infra_config_nodes_add.yml to cfg01.{{ DOMAIN_NAME }}" |
| upload: |
| local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| local_filename: infra_config_nodes_add.yml |
| remote_path: /root/environment/ |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: "Modify model to add interfaces to kvm nodes" |
| cmd: | |
| set -e; |
| set -x; |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools merge-context /root/environment/env_add.yml /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/init.yml; |
| reclass-tools merge-context /root/environment/infra_config_nodes_add.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/nodes.yml; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |