Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp10-dvr/map.jinja' import HOSTNAME_CFG01 with context %} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 2 | |
| 3 | # Install salt to the config node |
| 4 | |
| 5 | |
Tatyana Leontovich | 5fd6ed6 | 2017-04-04 15:08:29 +0300 | [diff] [blame] | 6 | - description: Configure repository on the cfg01 node |
| 7 | cmd: |
Tatyana Leontovich | 3c6aa45 | 2017-04-25 15:04:40 +0300 | [diff] [blame] | 8 | echo "nameserver 172.18.208.44" >> /etc/resolv.conf; |
| 9 | echo "nameserver 8.8.8.8" >> /etc/resolv.conf; |
Tatyana Leontovich | 5fd6ed6 | 2017-04-04 15:08:29 +0300 | [diff] [blame] | 10 | which wget >/dev/null || (apt-get update; apt-get install -y wget); |
obutenko | 89aedf8 | 2017-08-04 12:50:37 +0300 | [diff] [blame^] | 11 | echo "deb [arch=amd64] http://apt.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list; |
| 12 | wget -O - http://apt.mirantis.com/public.gpg | apt-key add -; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 13 | echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list; |
| 14 | wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 15 | node_name: {{ HOSTNAME_CFG01 }} |
| 16 | retry: {count: 1, delay: 1} |
| 17 | skip_fail: false |
| 18 | |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 19 | - description: Update packages on cfg01 |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 20 | cmd: apt-get clean; apt-get update |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 21 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 22 | retry: {count: 1, delay: 1} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 23 | skip_fail: false |
| 24 | |
Tatyana Leontovich | 5fd6ed6 | 2017-04-04 15:08:29 +0300 | [diff] [blame] | 25 | - description: Installing salt master on cfg01 |
| 26 | cmd: apt-get install -y reclass git; apt-get install -y salt-master |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 27 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 28 | retry: {count: 1, delay: 1} |
| 29 | skip_fail: false |
| 30 | |
| 31 | - description: Install common packages on cfg01 |
| 32 | cmd: apt-get install -y python-pip wget curl tmux byobu iputils-ping traceroute htop tree |
| 33 | node_name: {{ HOSTNAME_CFG01 }} |
| 34 | retry: {count: 1, delay: 1} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 35 | skip_fail: false |
| 36 | |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 37 | - description: Configure salt-master on cfg01 |
| 38 | cmd: | |
| 39 | cat << 'EOF' >> /etc/salt/master.d/master.conf |
| 40 | file_roots: |
| 41 | base: |
| 42 | - /usr/share/salt-formulas/env |
| 43 | pillar_opts: False |
| 44 | open_mode: True |
| 45 | reclass: &reclass |
| 46 | storage_type: yaml_fs |
| 47 | inventory_base_uri: /srv/salt/reclass |
| 48 | ext_pillar: |
| 49 | - reclass: *reclass |
| 50 | master_tops: |
| 51 | reclass: *reclass |
| 52 | EOF |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 1} |
| 55 | skip_fail: false |
| 56 | |
Tatyana Leontovich | 30a9db1 | 2017-04-06 14:28:39 +0300 | [diff] [blame] | 57 | - description: Configure GIT settings and certificates |
| 58 | cmd: touch /root/.git_trusted_certs.pem; |
| 59 | for server in git.tcpcloud.eu github.com; do |
| 60 | openssl s_client -showcerts -connect $server:443 </dev/null |
| 61 | | openssl x509 -outform PEM |
| 62 | >> /root/.git_trusted_certs.pem; |
| 63 | done; |
| 64 | HOME=/root git config --global http.sslCAInfo /root/.git_trusted_certs.pem; |
| 65 | HOME=/root git config --global user.email "tcp-qa@example.com"; |
| 66 | HOME=/root git config --global user.name "TCP QA"; |
| 67 | node_name: {{ HOSTNAME_CFG01 }} |
| 68 | retry: {count: 1, delay: 1} |
| 69 | skip_fail: false |
| 70 | |
| 71 | |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 72 | - description: Clone reclass models with submodules |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 73 | cmd: | |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 74 | ssh-keyscan -H github.com >> ~/.ssh/known_hosts; |
Tatyana Leontovich | 5fd6ed6 | 2017-04-04 15:08:29 +0300 | [diff] [blame] | 75 | git clone -b master --recurse-submodules https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab /srv/salt/reclass; |
| 76 | mkdir -p /srv/salt/reclass/classes/service; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 1, delay: 1} |
| 79 | skip_fail: false |
| 80 | |
| 81 | - description: Configure reclass |
| 82 | cmd: | |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 83 | FORMULA_PATH=${FORMULA_PATH:-/usr/share/salt-formulas}; |
obutenko | 89aedf8 | 2017-08-04 12:50:37 +0300 | [diff] [blame^] | 84 | FORMULA_REPOSITORY=${FORMULA_REPOSITORY:-deb [arch=amd64] http://apt.mirantis.com/xenial stable salt}; |
| 85 | FORMULA_GPG=${FORMULA_GPG:-http://apt.mirantis.com/public.gpg}; |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 86 | which wget > /dev/null || (apt-get update; apt-get install -y wget); |
Tatyana Leontovich | 543afa9 | 2017-04-21 14:48:03 +0300 | [diff] [blame] | 87 | echo "${FORMULA_REPOSITORY}" > /etc/apt/sources.list.d/mcp_salt.list; |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 88 | wget -O - "${FORMULA_GPG}" | apt-key add -; |
| 89 | apt-get clean; apt-get update; |
| 90 | [ ! -d /srv/salt/reclass/classes/service ] && mkdir -p /srv/salt/reclass/classes/service; |
| 91 | declare -a formula_services=("linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon"); |
| 92 | echo -e "\nInstalling all required salt formulas\n"; |
| 93 | apt-get install -y "${formula_services[@]/#/salt-formula-}"; |
Tatyana Leontovich | 14f6a1a | 2017-04-04 17:30:58 +0300 | [diff] [blame] | 94 | for formula_service in "${formula_services[@]}"; do |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 95 | echo -e "\nLink service metadata for formula ${formula_service} ...\n"; |
| 96 | [ ! -L "/srv/salt/reclass/classes/service/${formula_service}" ] && ln -s ${FORMULA_PATH}/reclass/service/${formula_service} /srv/salt/reclass/classes/service/${formula_service}; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 97 | done; |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 98 | [ ! -d /srv/salt/env ] && mkdir -p /srv/salt/env; |
| 99 | [ ! -L /srv/salt/env/prd ] && ln -s ${FORMULA_PATH}/env /srv/salt/env/prd; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 100 | [ ! -d /etc/reclass ] && mkdir /etc/reclass; |
Tatyana Leontovich | 193554a | 2017-04-04 17:19:13 +0300 | [diff] [blame] | 101 | |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 102 | cat << 'EOF' >> /etc/reclass/reclass-config.yml |
| 103 | storage_type: yaml_fs |
| 104 | pretty_print: True |
| 105 | output: yaml |
| 106 | inventory_base_uri: /srv/salt/reclass |
| 107 | EOF |
| 108 | node_name: {{ HOSTNAME_CFG01 }} |
| 109 | retry: {count: 1, delay: 1} |
| 110 | skip_fail: false |
| 111 | |
| 112 | - description: Configure salt-minion on cfg01 |
| 113 | cmd: | |
| 114 | [ ! -d /etc/salt/minion.d ] && mkdir -p /etc/salt/minion.d; |
| 115 | cat << "EOF" >> /etc/salt/minion.d/minion.conf |
| 116 | id: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 5fd6ed6 | 2017-04-04 15:08:29 +0300 | [diff] [blame] | 117 | master: 127.0.0.1 |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 118 | EOF |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 119 | apt-get install -y salt-minion; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 120 | node_name: {{ HOSTNAME_CFG01 }} |
| 121 | retry: {count: 1, delay: 1} |
| 122 | skip_fail: false |
| 123 | |
Tatyana Leontovich | 14f6a1a | 2017-04-04 17:30:58 +0300 | [diff] [blame] | 124 | - description: Configure salt adoptors on cfg01 |
| 125 | cmd: | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 126 | ln -s /usr/lib/python2.7/dist-packages/reclass/adapters/salt.py /usr/local/sbin/reclass-salt; |
Tatyana Leontovich | 14f6a1a | 2017-04-04 17:30:58 +0300 | [diff] [blame] | 127 | chmod +x /usr/lib/python2.7/dist-packages/reclass/adapters/salt.py |
| 128 | node_name: {{ HOSTNAME_CFG01 }} |
| 129 | retry: {count: 1, delay: 1} |
| 130 | skip_fail: false |
| 131 | |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 132 | - description: Restart services |
| 133 | cmd: | |
| 134 | systemctl restart salt-master; |
| 135 | systemctl restart salt-minion; |
| 136 | echo "Showing system info and metadata ..."; |
| 137 | salt-call --no-color grains.items; |
| 138 | salt-call --no-color pillar.data; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 139 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 140 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 141 | skip_fail: false |
| 142 | |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 143 | # Prepare salt services and nodes settings |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 144 | - description: Run 'linux' formula on cfg01 |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 145 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 146 | -C 'I@salt:master' state.sls linux; |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 147 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 148 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 149 | skip_fail: false |
| 150 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 151 | - description: Run 'openssh' formula on cfg01 |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 152 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 153 | -C 'I@salt:master' state.sls openssh; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 154 | salt --hard-crash --state-output=mixed --state-verbose=False |
| 155 | -C 'I@salt:master' cmd.run "sed -i 's/PasswordAuthentication no/PasswordAuthentication |
| 156 | yes/' /etc/ssh/sshd_config && service ssh restart"; |
| 157 | node_name: {{ HOSTNAME_CFG01 }} |
| 158 | retry: {count: 3, delay: 5} |
| 159 | skip_fail: false |
| 160 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 161 | - description: '*Workaround* of the bug https://mirantis.jira.com/browse/PROD-7962' |
| 162 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 163 | '*' cmd.run "echo ' StrictHostKeyChecking no' >> /root/.ssh/config" |
| 164 | node_name: {{ HOSTNAME_CFG01 }} |
| 165 | retry: {count: 1, delay: 1} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 166 | skip_fail: false |
| 167 | |
Tatyana Leontovich | 30a9db1 | 2017-04-06 14:28:39 +0300 | [diff] [blame] | 168 | - description: Run 'reclass' formula on cfg01 |
| 169 | cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False |
| 170 | -C 'I@salt:master' reclass; |
| 171 | salt-call --no-color state.sls salt.master; |
| 172 | node_name: {{ HOSTNAME_CFG01 }} |
| 173 | retry: {count: 1, delay: 5} |
| 174 | skip_fail: true |
| 175 | |
| 176 | |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 177 | - description: Run 'salt' formula on cfg01 |
| 178 | cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 179 | -C 'I@salt:master' state.sls salt.master.service; |
Tatyana Leontovich | 30a9db1 | 2017-04-06 14:28:39 +0300 | [diff] [blame] | 180 | salt-call --no-color state.sls salt.master,salt.api,salt.minion.ca; |
| 181 | systemctl restart salt-minion; |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 182 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 183 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 184 | skip_fail: true |
| 185 | |
| 186 | - description: Accept salt keys from all the nodes |
| 187 | cmd: salt-key -A -y |
| 188 | node_name: {{ HOSTNAME_CFG01 }} |
| 189 | retry: {count: 1, delay: 5} |
| 190 | skip_fail: false |
| 191 | |
| 192 | - description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated |
| 193 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 194 | -C 'I@salt:master' state.sls reclass |
| 195 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 196 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 197 | skip_fail: false |
| 198 | |
| 199 | - description: Refresh pillars on all minions |
| 200 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 201 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 202 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 203 | skip_fail: false |
| 204 | |
| 205 | - description: Sync all salt resources |
| 206 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all |
| 207 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 208 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 209 | skip_fail: false |
| 210 | |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 211 | - description: Show reclass-salt --top |
Tatyana Leontovich | 30a9db1 | 2017-04-06 14:28:39 +0300 | [diff] [blame] | 212 | cmd: reclass-salt --top; salt-call --no-color state.sls salt.minion.cert -l info; |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 213 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 214 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 2dde4aa | 2017-04-04 13:06:10 +0300 | [diff] [blame] | 215 | skip_fail: false |
| 216 | |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 217 | |
| 218 | # Bootstrap all nodes |
| 219 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 220 | - description: Configure linux on controllers |
| 221 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' state.sls |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 222 | linux |
| 223 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 224 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 225 | skip_fail: false |
| 226 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 227 | - description: Configure linux on proxy |
| 228 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'prx*' state.sls |
| 229 | linux |
| 230 | node_name: {{ HOSTNAME_CFG01 }} |
| 231 | retry: {count: 1, delay: 5} |
| 232 | skip_fail: false |
| 233 | |
| 234 | - description: Configure linux on gtw |
| 235 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'gtw*' state.sls |
| 236 | linux |
| 237 | node_name: {{ HOSTNAME_CFG01 }} |
| 238 | retry: {count: 3, delay: 20} |
| 239 | skip_fail: false |
| 240 | |
| 241 | - description: Configure linux on cmp |
| 242 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.sls |
| 243 | linux |
| 244 | node_name: {{ HOSTNAME_CFG01 }} |
| 245 | retry: {count: 3, delay: 20} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 246 | skip_fail: false |
| 247 | |
| 248 | - description: Configure openssh on all nodes |
| 249 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not |
| 250 | cfg*' state.sls openssh;salt --hard-crash --state-output=mixed --state-verbose=False |
| 251 | -C '* and not cfg*' cmd.run "sed -i 's/PasswordAuthentication no/PasswordAuthentication |
| 252 | yes/' /etc/ssh/sshd_config && service ssh restart" |
| 253 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 254 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 255 | skip_fail: false |
| 256 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 257 | - description: Configure salt.minion on ctl |
| 258 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' state.sls salt.minion |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 259 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 260 | retry: {count: 3, delay: 5} |
| 261 | skip_fail: false |
| 262 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 263 | - description: Configure salt.minion on prx |
| 264 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'prx*' state.sls salt.minion |
| 265 | node_name: {{ HOSTNAME_CFG01 }} |
| 266 | retry: {count: 3, delay: 5} |
| 267 | skip_fail: false |
| 268 | |
| 269 | |
| 270 | - description: Configure salt.minion on gtw |
| 271 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'gtw*' state.sls salt.minion |
| 272 | node_name: {{ HOSTNAME_CFG01 }} |
| 273 | retry: {count: 3, delay: 5} |
| 274 | skip_fail: false |
| 275 | |
| 276 | - description: Configure salt.minion on cmp |
| 277 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.sls salt.minion |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 278 | node_name: {{ HOSTNAME_CFG01 }} |
| 279 | retry: {count: 3, delay: 5} |
| 280 | skip_fail: false |
| 281 | |
| 282 | - description: Check salt minion versions on slaves |
| 283 | cmd: salt '*' test.version |
| 284 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 285 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 286 | skip_fail: false |
| 287 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 288 | - description: Check salt top states on nodes |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 289 | cmd: salt '*' state.show_top |
| 290 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 291 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 292 | skip_fail: false |
| 293 | |
Tatyana Leontovich | db84b99 | 2017-04-05 21:12:52 +0300 | [diff] [blame] | 294 | - description: Configure ntp and rsyslog on nodes |
| 295 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls ntp,rsyslog |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 296 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 8112841 | 2017-04-05 18:46:29 +0300 | [diff] [blame] | 297 | retry: {count: 1, delay: 10} |
Tatyana Leontovich | 055b506 | 2017-04-03 13:17:25 +0300 | [diff] [blame] | 298 | skip_fail: false |
| 299 | |
Tatyana Leontovich | 4d0d894 | 2017-04-06 19:10:56 +0300 | [diff] [blame] | 300 | - description: Hack gtw node |
| 301 | cmd: salt 'gtw*' cmd.run "ip addr del 172.16.10.110/24 dev ens4; ip addr flush dev ens4"; |
| 302 | node_name: {{ HOSTNAME_CFG01 }} |
| 303 | retry: {count: 1, delay: 10} |
| 304 | skip_fail: false |
| 305 | |
| 306 | - description: Hack cmp01 node |
| 307 | cmd: salt 'cmp01*' cmd.run "ip addr del 172.16.10.105/24 dev ens4; ip addr flush dev ens4"; |
| 308 | node_name: {{ HOSTNAME_CFG01 }} |
| 309 | retry: {count: 1, delay: 10} |
| 310 | skip_fail: false |
| 311 | |
| 312 | - description: Hack cmp02 node |
| 313 | cmd: salt 'cmp02*' cmd.run "ip addr del 172.16.10.106/24 dev ens4; ip addr flush dev ens4"; |
| 314 | node_name: {{ HOSTNAME_CFG01 }} |
| 315 | retry: {count: 1, delay: 10} |
| 316 | skip_fail: false |
| 317 | |