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