Tatyana Leontovich | bfbc483 | 2018-12-27 12:47:23 +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-contrail32-maas-2018.8.0' %} |
| 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-contrail32-maas-2018.8.0') %} |
| 7 | # Path to the context files used to render Cluster and Environment models |
| 8 | {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-contrail.yaml' %} |
| 9 | {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml', 'salt-context-cookiecutter-contrail.yaml'] %} |
| 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 | |
| 20 | {{ SHARED.MACRO_INSTALL_FORMULAS('\*') }} |
| 21 | |
| 22 | {{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }} |
| 23 | |
| 24 | {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }} |
| 25 | |
| 26 | - description: Temporary WR for cinder backend defined by default in reclass.system |
| 27 | cmd: | |
| 28 | sed -i 's/backend\:\ {}//g' /srv/salt/reclass/classes/system/cinder/control/cluster.yml; |
| 29 | node_name: {{ HOSTNAME_CFG01 }} |
| 30 | retry: {count: 1, delay: 5} |
| 31 | skip_fail: false |
| 32 | |
| 33 | - description: Temporary WR for correct bridge name according to envoronment templates |
| 34 | cmd: | |
| 35 | sed -i 's/br\-ctl/br\_ctl/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 36 | sed -i 's/br\-mgm/br\_mgm/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml; |
| 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: Temporary WR for correct bridge name according to envoronment templates |
| 44 | cmd: | |
| 45 | sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 46 | sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 47 | # For 2018.11.0+ : |
| 48 | # sed -i 's/==IPMI_USER==/${_param:power_user}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 49 | # sed -i 's/==IPMI_PASS==/${_param:power_password}/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 50 | node_name: {{ HOSTNAME_CFG01 }} |
| 51 | retry: {count: 1, delay: 10} |
| 52 | skip_fail: false |
| 53 | |
| 54 | - description: "Add user/password for IPMI access" |
| 55 | cmd: | |
| 56 | set -e; |
| 57 | set -x; |
| 58 | . /root/venv-reclass-tools/bin/activate; |
| 59 | reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 60 | reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 61 | # For 2018.11.0+ : |
| 62 | # reclass-tools add-key parameters._param.power_user {{ IPMI_USER }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 63 | # reclass-tools add-key parameters._param.power_password {{ IPMI_PASS }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas_machines.yml; |
| 64 | node_name: {{ HOSTNAME_CFG01 }} |
| 65 | retry: {count: 1, delay: 5} |
| 66 | skip_fail: false |
| 67 | |
| 68 | - description: "Workaround of bug PROD-22286 for VCP image path (MCP 2018.8.0)" |
| 69 | cmd: | |
| 70 | set -e; |
| 71 | set -x; |
| 72 | . /root/venv-reclass-tools/bin/activate; |
| 73 | reclass-tools add-key parameters._param.salt_control_xenial_image 'http://images.mcp.mirantis.net/ubuntu-16-04-x64-mcp{{ SHARED.REPOSITORY_SUITE }}.qcow2' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml; |
| 74 | reclass-tools add-key parameters._param.salt_control_trusty_image 'http://images.mcp.mirantis.net/ubuntu-14-04-x64-mcp{{ SHARED.REPOSITORY_SUITE }}.qcow2' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml; |
| 75 | node_name: {{ HOSTNAME_CFG01 }} |
| 76 | retry: {count: 1, delay: 5} |
| 77 | skip_fail: false |
| 78 | |
| 79 | - description: Temporary workaround !! Fix or debug |
| 80 | cmd: | |
| 81 | sed -i 's/pg_num: 128/pg_num: 4/g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/ceph/setup.yml; |
| 82 | sed -i 's/pgp_num: 128/pgp_num: 4/g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/ceph/setup.yml; |
| 83 | node_name: {{ HOSTNAME_CFG01 }} |
| 84 | retry: {count: 1, delay: 5} |
| 85 | skip_fail: true |
| 86 | |
| 87 | - description: "Workaround for correct repositories for salt during maas bootstrap" |
| 88 | cmd: | |
| 89 | set -e; |
| 90 | set -x; |
| 91 | . /root/venv-reclass-tools/bin/activate; |
| 92 | reclass-tools add-key parameters.maas.cluster.saltstack_repo_key '${linux:system:repo:mcp_saltstack:key}' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 93 | reclass-tools add-key parameters.maas.cluster.saltstack_repo_trusty 'deb [arch=amd64] ${_param:linux_system_repo_mcp_saltstack_url}/trusty/ trusty main' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 94 | reclass-tools add-key parameters.maas.cluster.saltstack_repo_xenial 'deb [arch=amd64] ${_param:linux_system_repo_mcp_saltstack_url}/xenial/ xenial main' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/maas.yml; |
| 95 | node_name: {{ HOSTNAME_CFG01 }} |
| 96 | retry: {count: 1, delay: 5} |
| 97 | skip_fail: false |
| 98 | |
| 99 | - description: "Workaround of hardcoded apt_mk_version in docker repo" |
| 100 | cmd: | |
| 101 | set -e; |
| 102 | set -x; |
| 103 | . /root/venv-reclass-tools/bin/activate; |
| 104 | reclass-tools add-key 'classes' 'system.linux.system.repo.mcp.apt_mirantis.docker' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_init.yml --merge; |
| 105 | reclass-tools add-key parameters._param.apt_mk_version {{ SHARED.REPOSITORY_SUITE }} /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_init.yml; |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 5} |
| 108 | skip_fail: false |