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