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