blob: d39ca10a5f8b4f14cf319e446282b62a03afae1f [file] [log] [blame]
sgudzf0ff0302018-01-29 18:50:01 +02001{% from 'cookied-bm-ocata-cicd-pipeline/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-ocata-cicd-pipeline/underlay.yaml' import DOMAIN_NAME with context %}
sgudz237fba02018-02-23 15:07:04 +02003{% from 'cookied-bm-ocata-cicd-pipeline/underlay.yaml' import LAB_CONFIG_NAME with context %}
sgudzf0ff0302018-01-29 18:50:01 +02004
5{% set NFV_ENABLED = os_env('NFV_ENABLED','false') %}
6
7{%- if NFV_ENABLED == 'true' %}
8{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-initial-cicd-nfv.yaml' %}
9{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory-nfv.yaml'] %}
10{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','physical-ocata-cicd-nfv') %}
11{%- else %}
12{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-initial-cicd.yaml' %}
13{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml'] %}
14{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','physical-ocata-cicd') %}
15{%- endif %}
16
17{%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2422') %}
18{%- set TENANT_VLAN = os_env('TENANT_VLAN', '2423') %}
19
20
21{% import 'shared-salt.yaml' as SHARED with context %}
22
23
24{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
25
26{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
27
28{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
29
Oleksii Butenkoa2fa0612018-09-20 12:01:44 +030030{{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='\*') }}
Dennis Dmitriev0f272312018-10-01 13:29:40 +030031- description: 'Workaround for typo in salt.minion.service (https://gerrit.mcp.mirantis.com/#/c/14806/)'
sgudz1be0cef2018-02-23 15:42:35 +020032 cmd: |
Dennis Dmitriev0f272312018-10-01 13:29:40 +030033 git clone https://gerrit.mcp.mirantis.com/salt-formulas/salt /tmp/salt-formula-salt;
sgudz1be0cef2018-02-23 15:42:35 +020034 pushd /tmp/salt-formula-salt;
Dennis Dmitriev0f272312018-10-01 13:29:40 +030035 git fetch https://gerrit.mcp.mirantis.com/salt-formulas/salt refs/changes/06/14806/1 && git checkout FETCH_HEAD;
sgudz1be0cef2018-02-23 15:42:35 +020036 popd;
37 cp /tmp/salt-formula-salt/salt/minion/service.sls /usr/share/salt-formulas/env/salt/minion/service.sls;
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
sgudzf0ff0302018-01-29 18:50:01 +020042{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
43
44{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
45
46- description: "Workaround for rack01 compute generator"
47 cmd: |
48 set -e;
49 # Remove rack01 key
50 . /root/venv-reclass-tools/bin/activate;
51 reclass-tools del-key parameters.reclass.storage.node.openstack_compute_rack01 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml;
52 # Add openstack_compute_node definition from system
53 reclass-tools add-key 'classes' 'system.reclass.storage.system.openstack_compute_multi' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml --merge;
54
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 10}
57 skip_fail: false
58
sgudzf0ff0302018-01-29 18:50:01 +020059- description: "Workaround for PROD-16973"
60 cmd: |
61 set -e;
62 # Remove obsolete logging section key
63 . /root/venv-reclass-tools/bin/activate;
64 reclass-tools del-key parameters.nova.controller.logging /srv/salt/reclass/classes/system/nova/control/cluster.yml;
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69{{ SHARED.MACRO_GENERATE_INVENTORY() }}
70
71{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
72
73- description: Temporary workaround for removing cinder-volume from CTL nodes
74 cmd: |
75 sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml;
76 sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml;
77 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: true
80
81- description: WR for mounting 1G hugepages before linux.state
82 cmd: |
83 salt 'cmp*' state.sls linux.system.hugepages;
84 salt 'cmp*' cmd.run "mount -o mode=775,pagesize=1G -t hugetlbfs Hugetlbfs-kvm /mnt/hugepages_1G";
85 salt 'cmp*' cmd.run "echo 16 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages";
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 10}
88 skip_fail: false
89
90- description: WR for correct acces to git repo from jenkins on cfg01 node
91 cmd: |
92 git clone --mirror https://github.com/Mirantis/mk-pipelines.git /home/repo/mk/mk-pipelines/;
93 git clone --mirror https://github.com/Mirantis/pipeline-library.git /home/repo/mcp-ci/pipeline-library/;
94 chown -R git:www-data /home/repo/mk/mk-pipelines/*;
95 chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*;
96
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 10}
99 skip_fail: false
100
101{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
102
103#########################################
104# Configure all running salt minion nodes
105#########################################
106
107- description: Hack resolv.conf on VCP nodes for internal services access
108 cmd: |
109 salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;"
110 node_name: {{ HOSTNAME_CFG01 }}
111 retry: {count: 1, delay: 5}
112 skip_fail: false
113
114- description: Refresh pillars on all minions
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 5}
118 skip_fail: false
119
120- description: Sync all salt resources
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: false
125
126- description: Show reclass-salt --top for generated nodes
127 cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 5}
130 skip_fail: false
Tatyana Leontovich4453dd62018-06-26 18:44:31 +0300131
132{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
133
134{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}