blob: 13e465f21d4df16bf8f02834ff43c0324bbcf1fa [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
Vladimir Jigulinf557c562018-07-30 18:30:09 +040017{{ 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 +030018
19{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
20
21{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
22
23{{ SHARED.MACRO_GENERATE_INVENTORY() }}
24{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 1, delay: 10}
27 skip_fail: false
28
29- description: Temporary workaround for removing cinder-volume from CTL nodes
30 cmd: |
31 sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
32 sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 5}
35 skip_fail: true
36
37- description: WR for mounting 1G hugepages before linux.state
38 cmd: |
39 salt 'cmp*' state.sls linux.system.hugepages;
40 salt 'cmp*' cmd.run "mount -o mode=775,pagesize=1G -t hugetlbfs Hugetlbfs-kvm /mnt/hugepages_1G";
41 salt 'cmp*' cmd.run "echo 16 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages";
42 node_name: {{ HOSTNAME_CFG01 }}
43 retry: {count: 1, delay: 10}
44 skip_fail: false
45
Oleksii Butenkof65a0042018-06-27 13:38:43 +030046- description: WR for correct acces to git repo from jenkins on cfg01 node
47 cmd: |
48 git clone --mirror https://github.com/Mirantis/mk-pipelines.git /home/repo/mk/mk-pipelines/;
49 git clone --mirror https://github.com/Mirantis/pipeline-library.git /home/repo/mcp-ci/pipeline-library/;
50 chown -R git:www-data /home/repo/mk/mk-pipelines/*;
51 chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*;
52
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 10}
55 skip_fail: false
56
57{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
58
59#########################################
60# Configure all running salt minion nodes
61#########################################
62
63- description: Refresh pillars on all minions
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: Sync all salt resources
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 1, delay: 5}
73 skip_fail: false
74
75- description: Show reclass-salt --top for generated nodes
76 cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/
77 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: false
80
81- description: Add cpm nodes to /etc/hosts
82 cmd: |
83 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";
84 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";
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 10}
87 skip_fail: true
88
89{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
90{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
91
92- description: Temporary WR
93 cmd: |
94 ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts || true;
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 10}
97 skip_fail: true
98
99- description: Enable Jenkins
100 cmd: |
101 systemctl enable jenkins || true;
102 systemctl restart jenkins || true;
103 sleep 5;
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 10}
106 skip_fail: true
107
108- description: run jenkins.client
109 cmd: |
110 salt-call state.sls jenkins.client
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 10}
113 skip_fail: false
114