blob: 3272f97dfe65979224373be5e4086d6eb12703f6 [file] [log] [blame]
Oleksii Butenkof65a0042018-06-27 13:38:43 +03001{% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CMP01 with context %}
3{% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CMP02 with context %}
4{% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_GTW01 with context %}
5{% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import LAB_CONFIG_NAME with context %}
6{% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import DOMAIN_NAME with context %}
7
8{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-baremetal-lab') %}
9# Other salt model repository parameters see in shared-salt.yaml
10
11{% import 'shared-salt.yaml' as SHARED with context %}
12
13{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
14
15{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
16
Dennis Dmitrievd96773d2018-08-13 13:35:31 +030017- description: "Workaround for PROD-22201 (remove after switching to reclass 1.5.x) - Remove linux.network.interface object from the system models and use fixed 'environment' model instead"
18 cmd: |
19 set -e;
20 apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev;
21 [[ -d /root/venv-reclass-tools ]] || virtualenv /root/venv-reclass-tools;
22 . /root/venv-reclass-tools/bin/activate;
23 pip install git+https://github.com/dis-xcom/reclass-tools;
24 reclass-tools del-key parameters.linux.network.interface /srv/salt/reclass/classes/system/;
25
26 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 1, delay: 5}
28 skip_fail: false
29
Vladimir Jigulinf557c562018-07-30 18:30:09 +040030{{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='"linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon" "prometheus" "telegraf" "elasticsearch" "fluentd" "runtest" "maas" "jenkins" "glusterfs" "backupninja" "auditd" "logrotate"') }}
Oleksii Butenkof65a0042018-06-27 13:38:43 +030031
32{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
33
34{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
35
Tatyana Leontovich7b9b2da2018-08-10 19:52:07 +030036- description: "WR for changing image to proposed"
37 cmd: |
38 set -e;
39 # Add message_queu host for opencontrail
40 . /root/venv-reclass-tools/bin/activate;
41 reclass-tools add-key parameters._param.salt_control_xenial_image 'http://ci.mcp.mirantis.net:8085/images/ubuntu-16-04-x64-mcp{{ REPOSITORY_SUITE }}.qcow2' /srv/salt/reclass/classes/cluster//{{ LAB_CONFIG_NAME }}infra/init.yml;
42 reclass-tools add-key parameters._param.salt_control_trusty_image 'http://ci.mcp.mirantis.net:8085/images/ubuntu-14-04-x64-mcp{{ REPOSITORY_SUITE }}.qcow2' /srv/salt/reclass/classes/cluster//{{ LAB_CONFIG_NAME }}infra/init.yml;
43 node_name: {{ HOSTNAME_CFG01 }}
44 retry: {count: 1, delay: 10}
45 skip_fail: false
46
Oleksii Butenkof65a0042018-06-27 13:38:43 +030047{{ SHARED.MACRO_GENERATE_INVENTORY() }}
48{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 10}
51 skip_fail: false
52
53- description: Temporary workaround for removing cinder-volume from CTL nodes
54 cmd: |
55 sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
56 sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 5}
59 skip_fail: true
60
Tatyana Leontovichfa388892018-08-13 13:27:25 +030061- description: Temporary workaround for removing virtual gtw nodes
62 cmd: |
63 sed -i 's/\-\ system\.salt\.control\.sizes\.ovs\.compact//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
64 sed -i 's/\-\ system\.salt\.control\.placement\.ovs\.compact//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: true
68
Oleksii Butenkof65a0042018-06-27 13:38:43 +030069- description: WR for mounting 1G hugepages before linux.state
70 cmd: |
71 salt 'cmp*' state.sls linux.system.hugepages;
72 salt 'cmp*' cmd.run "mount -o mode=775,pagesize=1G -t hugetlbfs Hugetlbfs-kvm /mnt/hugepages_1G";
73 salt 'cmp*' cmd.run "echo 16 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages";
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 1, delay: 10}
76 skip_fail: false
77
Oleksii Butenkof65a0042018-06-27 13:38:43 +030078- description: WR for correct acces to git repo from jenkins on cfg01 node
79 cmd: |
80 git clone --mirror https://github.com/Mirantis/mk-pipelines.git /home/repo/mk/mk-pipelines/;
81 git clone --mirror https://github.com/Mirantis/pipeline-library.git /home/repo/mcp-ci/pipeline-library/;
82 chown -R git:www-data /home/repo/mk/mk-pipelines/*;
83 chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*;
84
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 10}
87 skip_fail: false
88
89{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
90
91#########################################
92# Configure all running salt minion nodes
93#########################################
94
95- description: Refresh pillars on all minions
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 5}
99 skip_fail: false
100
101- description: Sync all salt resources
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107- description: Show reclass-salt --top for generated nodes
108 cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 5}
111 skip_fail: false
112
113- description: Add cpm nodes to /etc/hosts
114 cmd: |
115 salt --hard-crash --state-output=mixed --state-verbose=False -C '*' cmd.run "echo '10.167.11.105 cmp01.cookied-bm-dpdk-pipeline.local cmp01' >> /etc/hosts";
116 salt --hard-crash --state-output=mixed --state-verbose=False -C '*' cmd.run "echo '10.167.11.106 cmp02.cookied-bm-dpdk-pipeline.local cmp02' >> /etc/hosts";
117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 1, delay: 10}
119 skip_fail: true
120
121{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
122{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
123
124- description: Temporary WR
125 cmd: |
126 ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts || true;
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 1, delay: 10}
129 skip_fail: true
130
131- description: Enable Jenkins
132 cmd: |
133 systemctl enable jenkins || true;
134 systemctl restart jenkins || true;
135 sleep 5;
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 10}
138 skip_fail: true
139
140- description: run jenkins.client
141 cmd: |
142 salt-call state.sls jenkins.client
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 10}
145 skip_fail: false
146