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