blob: 8a6d342d7a9f41a64ea751cf9cd5ae72d2dec320 [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
Oleksii Butenko44afc962018-08-16 13:18:51 +030036- description: "WR for changing VCP images path to internal storage"
Tatyana Leontovich7b9b2da2018-08-10 19:52:07 +030037 cmd: |
38 set -e;
Oleksii Butenko44afc962018-08-16 13:18:51 +030039 apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev;
40 [[ -d /root/venv-reclass-tools ]] || virtualenv /root/venv-reclass-tools;
Tatyana Leontovich7b9b2da2018-08-10 19:52:07 +030041 . /root/venv-reclass-tools/bin/activate;
Oleksii Butenko44afc962018-08-16 13:18:51 +030042 pip install git+https://github.com/dis-xcom/reclass-tools;
43 reclass-tools add-key parameters._param.salt_control_xenial_image 'https://apt.mcp.mirantis.net/images/ubuntu-16-04-x64-mcp{{ SHARED.REPOSITORY_SUITE }}.qcow2' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
Tatyana Leontovich7b9b2da2018-08-10 19:52:07 +030044 node_name: {{ HOSTNAME_CFG01 }}
45 retry: {count: 1, delay: 10}
46 skip_fail: false
47
Oleksii Butenkof65a0042018-06-27 13:38:43 +030048{{ SHARED.MACRO_GENERATE_INVENTORY() }}
49{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 1, delay: 10}
52 skip_fail: false
53
54- description: Temporary workaround for removing cinder-volume from CTL nodes
55 cmd: |
56 sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
57 sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: true
61
Tatyana Leontovichfa388892018-08-13 13:27:25 +030062- description: Temporary workaround for removing virtual gtw nodes
63 cmd: |
64 sed -i 's/\-\ system\.salt\.control\.sizes\.ovs\.compact//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
65 sed -i 's/\-\ system\.salt\.control\.placement\.ovs\.compact//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/kvm.yml;
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: true
69
Oleksii Butenkof65a0042018-06-27 13:38:43 +030070- description: WR for mounting 1G hugepages before linux.state
71 cmd: |
72 salt 'cmp*' state.sls linux.system.hugepages;
73 salt 'cmp*' cmd.run "mount -o mode=775,pagesize=1G -t hugetlbfs Hugetlbfs-kvm /mnt/hugepages_1G";
74 salt 'cmp*' cmd.run "echo 16 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages";
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 1, delay: 10}
77 skip_fail: false
78
Oleksii Butenkof65a0042018-06-27 13:38:43 +030079- description: WR for correct acces to git repo from jenkins on cfg01 node
80 cmd: |
81 git clone --mirror https://github.com/Mirantis/mk-pipelines.git /home/repo/mk/mk-pipelines/;
82 git clone --mirror https://github.com/Mirantis/pipeline-library.git /home/repo/mcp-ci/pipeline-library/;
83 chown -R git:www-data /home/repo/mk/mk-pipelines/*;
84 chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*;
85
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 10}
88 skip_fail: false
89
90{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
91
92#########################################
93# Configure all running salt minion nodes
94#########################################
95
96- description: Refresh pillars on all minions
97 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 5}
100 skip_fail: false
101
102- description: Sync all salt resources
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: false
107
108- description: Show reclass-salt --top for generated nodes
109 cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/
110 node_name: {{ HOSTNAME_CFG01 }}
111 retry: {count: 1, delay: 5}
112 skip_fail: false
113
114- description: Add cpm nodes to /etc/hosts
115 cmd: |
116 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";
117 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";
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 10}
120 skip_fail: true
121
122{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
123{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
124
125- description: Temporary WR
126 cmd: |
127 ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts || true;
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 10}
130 skip_fail: true
131
132- description: Enable Jenkins
133 cmd: |
134 systemctl enable jenkins || true;
135 systemctl restart jenkins || true;
136 sleep 5;
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 10}
139 skip_fail: true
140
141- description: run jenkins.client
142 cmd: |
143 salt-call state.sls jenkins.client
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 10}
146 skip_fail: false
147