Taras Khlivnyak | 89c86fb | 2021-05-12 07:49:44 +0300 | [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-e7-cicd-pike-odl-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','bm-e7-cicd-pike-odl-maas') %} |
| 8 | # Path to the context files used to render Cluster and Environment models |
| 9 | {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-openstack_odl.yaml' %} |
| 10 | {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-vcp-environment.yaml', 'salt-context-environment.yaml','salt-context-cookiecutter-openstack_odl.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 ODL_CONTROLLER_IP = '10.167.11.220' %} |
| 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(KNOWN_HOST_AUTOPOPULATION=false) }} |
| 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\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml; |
| 39 | salt '*' saltutil.refresh_pillar; |
| 40 | node_name: {{ HOSTNAME_CFG01 }} |
| 41 | retry: {count: 1, delay: 10} |
| 42 | skip_fail: false |
| 43 | |
Pavel Glazov | a752fe7 | 2023-07-12 16:52:45 +0400 | [diff] [blame^] | 44 | - description: "Add OpenDayLight as Neutron backend" |
| 45 | cmd: | |
| 46 | set -e; |
| 47 | set -x; |
| 48 | . /root/venv-reclass-tools/bin/activate; |
| 49 | reclass-tools add-key --merge classes service.neutron.compute.opendaylight.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| 50 | reclass-tools add-key --merge classes service.neutron.gateway.opendaylight.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/gateway.yml |
| 51 | reclass-tools add-key --merge classes system.neutron.control.opendaylight.cluster /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| 52 | reclass-tools add-key parameters.neutron.server.backend.rest_api_port 8282 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| 53 | reclass-tools add-key parameters.neutron.server.backend.user admin /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| 54 | reclass-tools add-key parameters.neutron.server.backend.password admin /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| 55 | reclass-tools add-key parameters._param.opendaylight_service_host {{ ODL_CONTROLLER_IP }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/init.yml |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 5} |
| 58 | skip_fail: false |
| 59 | |
| 60 | - description: Add opendaylight control single class |
| 61 | cmd: | |
| 62 | set -e; |
| 63 | set -x; |
| 64 | . /root/venv-reclass-tools/bin/activate; |
| 65 | 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; |
| 66 | 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 |
| 67 | 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; |
| 68 | salt '*' saltutil.refresh_pillar; |
| 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 1, delay: 10} |
| 71 | skip_fail: false |
| 72 | |
Taras Khlivnyak | 89c86fb | 2021-05-12 07:49:44 +0300 | [diff] [blame] | 73 | {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }} |
| 74 | |
| 75 | - description: Defining username and password params for IPMI access |
| 76 | cmd: | |
| 77 | sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 78 | sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 10} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: "Add user/password for IPMI access" |
| 84 | cmd: | |
| 85 | set -e; |
| 86 | set -x; |
| 87 | . /root/venv-reclass-tools/bin/activate; |
| 88 | reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 89 | reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 90 | node_name: {{ HOSTNAME_CFG01 }} |
| 91 | retry: {count: 1, delay: 5} |
| 92 | skip_fail: false |
| 93 | |
| 94 | - description: "Setting workarounds for non-ceph deployments" |
| 95 | cmd: | |
| 96 | set -e; |
| 97 | set -x; |
| 98 | . /root/venv-reclass-tools/bin/activate; |
| 99 | reclass-tools add-key --merge classes system.cinder.volume.single /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| 100 | reclass-tools add-key --merge classes system.cinder.volume.notification.messagingv2 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| 101 | reclass-tools add-key parameters.cinder.volume.default_volume_type lvm-driver /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| 102 | reclass-tools add-key parameters.cinder.volume.backend.lvm-driver.engine lvm /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml |
| 103 | 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 |
| 104 | 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 |
| 105 | sed -i '/system.cinder.volume.single/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| 106 | sed -i '/system.cinder.volume.notification.messagingv2/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml |
| 107 | node_name: {{ HOSTNAME_CFG01 }} |
| 108 | retry: {count: 1, delay: 5} |
| 109 | skip_fail: false |
| 110 | |
Taras Khlivnyak | 077d52e | 2022-01-24 11:45:07 +0200 | [diff] [blame] | 111 | - description: "Upload env_add.yml to cfg01.{{ DOMAIN_NAME }}" |
| 112 | upload: |
| 113 | local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| 114 | local_filename: env_add.yml |
| 115 | remote_path: /root/environment/ |
| 116 | node_name: {{ HOSTNAME_CFG01 }} |
| 117 | retry: {count: 1, delay: 10} |
| 118 | skip_fail: false |
| 119 | |
| 120 | - description: "Upload infra_config_nodes_add.yml to cfg01.{{ DOMAIN_NAME }}" |
| 121 | upload: |
| 122 | local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| 123 | local_filename: infra_config_nodes_add.yml |
| 124 | remote_path: /root/environment/ |
| 125 | node_name: {{ HOSTNAME_CFG01 }} |
| 126 | retry: {count: 1, delay: 10} |
| 127 | skip_fail: false |
| 128 | |
| 129 | - description: "Modify model to add interfaces to kvm nodes" |
| 130 | cmd: | |
| 131 | set -e; |
| 132 | set -x; |
| 133 | . /root/venv-reclass-tools/bin/activate; |
| 134 | reclass-tools merge-context /root/environment/env_add.yml /srv/salt/reclass/classes/environment/{{ LAB_CONFIG_NAME }}/init.yml; |
| 135 | reclass-tools merge-context /root/environment/infra_config_nodes_add.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/nodes.yml; |
| 136 | node_name: {{ HOSTNAME_CFG01 }} |
| 137 | retry: {count: 1, delay: 5} |
| 138 | skip_fail: false |