blob: d67133754c0f101d640451740f47b4746990993a [file] [log] [blame]
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03001{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_APT01 with context %}
2{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %}
3{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %}
4{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %}
5{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %}
Tatyana Leontovich8dbc7882018-08-29 13:11:16 +03006{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CID01 with context %}
7{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CID02 with context %}
8{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CID03 with context %}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03009{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CMP01 with context %}
10{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CMP02 with context %}
11{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_GTW01 with context %}
12{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_PRX01 with context %}
Tatyana Leontovich5fb5ea52018-07-27 19:35:36 +030013{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_DNS01 with context %}
14{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_DNS02 with context %}
15{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_MDB01 with context %}
16{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_MDB02 with context %}
17{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_MDB03 with context %}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030018{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_VS with context %}
19{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import LAB_CONFIG_NAME with context %}
20{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import DOMAIN_NAME with context %}
21
22{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.local.test/salt-models/mcp-virtual-lab') %}
23# Other salt model repository parameters see in shared-salt.yaml
24
25
26{% import 'shared-salt.yaml' as SHARED with context %}
27{% from 'shared-salt.yaml' import IPV4_NET_CONTROL_PREFIX with context %}
28{% import 'virtual-offline-pike-ovs-dpdk/vswitch-config.yaml' as VSWITCH with context %}
29{% set VSWITCH_IP = SHARED.IPV4_NET_CONTROL_PREFIX+'.178' %}
30
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030031- description: Check nginx APT node is ready
32 cmd: systemctl status nginx;
33 node_name: {{ HOSTNAME_APT01 }}
34 retry: {count: 1, delay: 10}
35 skip_fail: false
36
37- description: Check dnsmasq on APT node is ready
38 cmd: systemctl status dnsmasq;
39 node_name: {{ HOSTNAME_APT01 }}
40 retry: {count: 1, delay: 10}
41 skip_fail: false
42
43{{ VSWITCH.MACRO_CONFIGURE_VSWITCH(HOSTNAME_VS, VSWITCH_IP) }}
44
45{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }}
46{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL01) }}
47{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL02) }}
48{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL03) }}
Tatyana Leontovich8dbc7882018-08-29 13:11:16 +030049{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CID01) }}
50{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CID02) }}
51{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CID03) }}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030052{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP01) }}
53{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP02) }}
54{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_GTW01) }}
55{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_PRX01) }}
Tatyana Leontovich5fb5ea52018-07-27 19:35:36 +030056{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_DNS01) }}
57{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_DNS02) }}
58{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_MDB01) }}
59{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_MDB02) }}
60{{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_MDB03) }}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030061
62{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
63
64{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
65
66- description: 'Workaround of local_repo_url - set to offline image repository structure'
67 cmd: |
68 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/local_repo_url: .*/local_repo_url: mirror.mcp.mirantis.local.test/g' {} +
69 find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/aptly_server_address: .*/aptly_server_address: {{ os_env('HOST_APT') }}/g' {} +
70 node_name: {{ HOSTNAME_CFG01 }}
71 retry: {count: 1, delay: 10}
72 skip_fail: false
73
Tatyana Leontovich8dbc7882018-08-29 13:11:16 +030074{{ 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" "powerdns" "fluentd" "backupninja" "watchdog" "runtest" "auditd" "logrotate" "gnocchi" "manila" "jenkins" "glusterfs"') }}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030075
76{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
77
78{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
79
80{{ SHARED.MACRO_GENERATE_INVENTORY() }}
81
82{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
83
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030084{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
85{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
86
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030087{{ VSWITCH.MACRO_CHECK_BGPVPN_ENABLED_BY_DEFAULT() }}
88
89{{ VSWITCH.MACRO_ENABLE_L2GW(SHARED.CLUSTER_NAME, VSWITCH_IP) }}
Tatyana Leontovicha0cb2702018-07-17 12:30:18 +030090
Tatyana Leontoviche1d16192018-07-18 15:07:51 +030091- description: Enable hugepages on cmp nodes
92 cmd: salt 'cmp*' cmd.run "apt-get install -y hugepages; echo 2048 > /proc/sys/vm/nr_hugepages";
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 10}
95 skip_fail: false
96
Tatyana Leontovich8dbc7882018-08-29 13:11:16 +030097#- description: Install watchdog
98# cmd: salt -C "I@watchdog:server" state.sls watchdog;
99# node_name: {{ HOSTNAME_CFG01 }}
100# retry: {count: 1, delay: 10}
101# skip_fail: false
102
103- description: WR for correct acces to git repo from jenkins on cfg01 node
104 cmd: |
105 export GIT_SSL_NO_VERIFY=true; git clone --mirror https://gerrit.mcp.mirantis.local.test/mk/mk-pipelines /home/repo/mk/mk-pipelines/;
106 export GIT_SSL_NO_VERIFY=true; git clone --mirror https://gerrit.mcp.mirantis.local.test/mcp-ci/pipeline-library /home/repo/mcp-ci/pipeline-library/;
107 chown -R git:www-data /home/repo/mk/mk-pipelines/*;
108 chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*;
Tatyana Leontovich28b2d1c2018-08-07 23:47:07 +0300109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 10}
111 skip_fail: false
112
Tatyana Leontovich8dbc7882018-08-29 13:11:16 +0300113- description: '*Workaround* to remove apt key until migrate on CC'
114 cmd: salt-key -d apt01.virtual-offline-pike-ovs-dpdk -y
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 1}
117 skip_fail: true
118
119- description: '*Workaround* stop minion on apt like proxy node'
120 cmd: systemctl stop salt-minion.service
121 node_name: {{ HOSTNAME_APT01 }}
122 retry: {count: 1, delay: 1}
123 skip_fail: true
124
Tatyana Leontoviche1d16192018-07-18 15:07:51 +0300125- description: Workaround to avoid reboot cmp nodes bring OVS interfaces UP
126 cmd: |
127 salt 'cmp*' cmd.run "ifup br-mesh";
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 10}
Tatyana Leontovich8dbc7882018-08-29 13:11:16 +0300130 skip_fail: false
131
132- description: Temporary WR
133 cmd: |
134 ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts || true;
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 10}
137 skip_fail: true
138
139- description: Enable Jenkins
140 cmd: |
141 systemctl enable jenkins || true;
142 systemctl restart jenkins || true;
143 sleep 5;
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 10}
146 skip_fail: true
147
148- description: run jenkins.client
149 cmd: |
150 salt-call state.sls jenkins.client
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 3, delay: 60}
153 skip_fail: false