Dennis Dmitriev | 8555996 | 2018-01-30 15:35:51 +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-bm-mcp-ocata-contrail' %} |
| 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','physical-cookied-bm-mcp-ocata-contrail') %} |
| 7 | # Path to the context files used to render Cluster and Environment models |
| 8 | {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-contrail-dpdk.yaml' %} |
| 9 | {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml'] %} |
| 10 | {%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2422') %} |
| 11 | {%- set TENANT_VLAN = os_env('TENANT_VLAN', '2423') %} |
| 12 | |
| 13 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 14 | |
Dennis Dmitriev | 2c9db8d | 2018-03-26 21:49:59 +0300 | [diff] [blame] | 15 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }} |
| 16 | - description: Re-install all the fromulas |
| 17 | cmd: | |
| 18 | set -e; |
| 19 | apt-get install -y salt-formula-* |
| 20 | node_name: {{ HOSTNAME_CFG01 }} |
| 21 | retry: {count: 1, delay: 1} |
| 22 | skip_fail: false |
| 23 | |
Tatyana Leontovich | 2e89275 | 2018-07-05 19:56:10 +0300 | [diff] [blame] | 24 | - description: Sync formulas to service |
| 25 | cmd: | |
| 26 | set -e; |
| 27 | RECLASS_ROOT=${RECLASS_ROOT:-/srv/salt/reclass/}; |
| 28 | FORMULAS_PATH=${FORMULAS_PATH:-/usr/share/salt-formulas}; |
| 29 | [ ! -d ${RECLASS_ROOT}/classes/service ] && mkdir -p ${RECLASS_ROOT}/classes/service; |
| 30 | for formula_service in $(ls /usr/share/salt-formulas/reclass/service/); do |
| 31 | #Since some salt formula names contain "-" and in symlinks they should contain "_" adding replacement; |
| 32 | formula_service=${formula_service//-/$'_'}; |
| 33 | if [ ! -L "${RECLASS_ROOT}/classes/service/${formula_service}" ]; then |
| 34 | ln -sf ${FORMULAS_PATH}/reclass/service/${formula_service} ${RECLASS_ROOT}/classes/service/${formula_service}; |
| 35 | fi; |
| 36 | done |
| 37 | node_name: {{ HOSTNAME_CFG01 }} |
| 38 | retry: {count: 1, delay: 1} |
| 39 | skip_fail: false |
| 40 | |
Dennis Dmitriev | 8555996 | 2018-01-30 15:35:51 +0200 | [diff] [blame] | 41 | {{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }} |
| 42 | |
| 43 | {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }} |
| 44 | |
| 45 | - description: Temporary WR for cinder backend defined by default in reclass.system |
| 46 | cmd: | |
| 47 | sed -i 's/backend\:\ {}//g' /srv/salt/reclass/classes/system/cinder/control/cluster.yml; |
| 48 | node_name: {{ HOSTNAME_CFG01 }} |
| 49 | retry: {count: 1, delay: 5} |
| 50 | skip_fail: false |
| 51 | |
| 52 | - description: "Workaround for rack01 compute generator" |
| 53 | cmd: | |
| 54 | set -e; |
| 55 | . /root/venv-reclass-tools/bin/activate; |
| 56 | # Remove rack01 key |
Dennis Dmitriev | cb77f02 | 2018-02-18 20:42:35 +0200 | [diff] [blame] | 57 | reclass-tools del-key parameters.reclass.storage.node.openstack_compute_rack01 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml; |
Dennis Dmitriev | 8555996 | 2018-01-30 15:35:51 +0200 | [diff] [blame] | 58 | # Add openstack_compute_node definition from system |
Dennis Dmitriev | cb77f02 | 2018-02-18 20:42:35 +0200 | [diff] [blame] | 59 | reclass-tools add-key 'classes' 'system.reclass.storage.system.openstack_compute_multi' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml --merge; |
Dennis Dmitriev | 8555996 | 2018-01-30 15:35:51 +0200 | [diff] [blame] | 60 | |
| 61 | node_name: {{ HOSTNAME_CFG01 }} |
| 62 | retry: {count: 1, delay: 10} |
| 63 | skip_fail: false |
| 64 | |
| 65 | |
| 66 | - description: Temporary workaround for removing cinder-volume from CTL nodes |
| 67 | cmd: | |
Dennis Dmitriev | cb77f02 | 2018-02-18 20:42:35 +0200 | [diff] [blame] | 68 | sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml; |
| 69 | sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml; |
Dennis Dmitriev | 8555996 | 2018-01-30 15:35:51 +0200 | [diff] [blame] | 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 1, delay: 5} |
| 72 | skip_fail: true |
| 73 | |
| 74 | {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }} |
| 75 | |
| 76 | - description: "Workaround for PROD-14060" |
| 77 | cmd: | |
| 78 | set -e; |
| 79 | # Add tenant and single addresses for computes |
| 80 | salt-call reclass.cluster_meta_set deploy_address 172.16.49.72 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml |
| 81 | salt-call reclass.cluster_meta_set tenant_address 192.168.0.101 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml |
| 82 | salt-call reclass.cluster_meta_set single_address 10.167.8.101 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml |
| 83 | |
| 84 | salt-call reclass.cluster_meta_set deploy_address 172.16.49.74 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml |
| 85 | salt-call reclass.cluster_meta_set tenant_address 192.168.0.102 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml |
| 86 | salt-call reclass.cluster_meta_set single_address 10.167.8.102 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml |
| 87 | |
| 88 | node_name: {{ HOSTNAME_CFG01 }} |
| 89 | retry: {count: 1, delay: 10} |
| 90 | skip_fail: false |