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 %} |
Sergii Golovatiuk | 57bb8e7 | 2017-05-16 19:49:49 +0200 | [diff] [blame] | 2 | |
| 3 | # Install support services |
| 4 | - description: Create and distribute SSL certificates for services using salt state |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' |
| 6 | state.sls salt.minion.cert |
Sergii Golovatiuk | 57bb8e7 | 2017-05-16 19:49:49 +0200 | [diff] [blame] | 7 | node_name: {{ HOSTNAME_CFG01 }} |
| 8 | retry: {count: 1, delay: 10} |
| 9 | skip_fail: true |
| 10 | |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 11 | - description: Install docker |
Sergii Golovatiuk | 57bb8e7 | 2017-05-16 19:49:49 +0200 | [diff] [blame] | 12 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 13 | -C 'I@docker:host' state.sls docker.host |
| 14 | node_name: {{ HOSTNAME_CFG01 }} |
| 15 | retry: {count: 3, delay: 5} |
| 16 | skip_fail: false |
| 17 | |
| 18 | - description: Check docker |
| 19 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 20 | -C 'I@docker:host' cmd.run 'docker ps' |
| 21 | node_name: {{ HOSTNAME_CFG01 }} |
| 22 | retry: {count: 1, delay: 5} |
| 23 | skip_fail: false |
| 24 | |
| 25 | - description: Install keepalived on first node |
| 26 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 27 | -C 'I@keepalived:cluster and *01*' state.sls keepalived |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 1, delay: 10} |
| 30 | skip_fail: true |
| 31 | |
| 32 | - description: Install keepalived on whole cluster |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 34 | -C 'I@keepalived:cluster' state.sls keepalived |
Sergii Golovatiuk | 57bb8e7 | 2017-05-16 19:49:49 +0200 | [diff] [blame] | 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 10} |
| 37 | skip_fail: true |
| 38 | |
Sergii Golovatiuk | 57bb8e7 | 2017-05-16 19:49:49 +0200 | [diff] [blame] | 39 | - description: Install haproxy |
| 40 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 41 | -C 'I@haproxy:proxy' state.sls haproxy |
| 42 | node_name: {{ HOSTNAME_CFG01 }} |
| 43 | retry: {count: 1, delay: 5} |
| 44 | skip_fail: false |
| 45 | |
| 46 | - description: Install haproxy.service |
| 47 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 48 | -C 'I@haproxy:proxy' service.status haproxy |
| 49 | node_name: {{ HOSTNAME_CFG01 }} |
| 50 | retry: {count: 1, delay: 5} |
| 51 | skip_fail: false |
| 52 | |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 53 | # Isntall SL core services |
Dennis Dmitriev | 4f552f2 | 2017-09-13 12:26:46 +0300 | [diff] [blame] | 54 | #- description: Install glusterfs |
| 55 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 56 | # -C 'I@glusterfs:server' state.sls glusterfs.server.service |
| 57 | # node_name: {{ HOSTNAME_CFG01 }} |
| 58 | # retry: {count: 1, delay: 5} |
| 59 | # skip_fail: false |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 60 | |
Dennis Dmitriev | 4f552f2 | 2017-09-13 12:26:46 +0300 | [diff] [blame] | 61 | #- description: Setup glusterfs on primary controller |
| 62 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 63 | # -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1 |
| 64 | # node_name: {{ HOSTNAME_CFG01 }} |
Dennis Dmitriev | a95a6d4 | 2017-10-24 15:09:04 +0300 | [diff] [blame] | 65 | # retry: {count: 2, delay: 5} |
Dennis Dmitriev | 4f552f2 | 2017-09-13 12:26:46 +0300 | [diff] [blame] | 66 | # skip_fail: false |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 67 | |
Dennis Dmitriev | 4f552f2 | 2017-09-13 12:26:46 +0300 | [diff] [blame] | 68 | #- description: Check the gluster status |
| 69 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 70 | # -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1 |
| 71 | # node_name: {{ HOSTNAME_CFG01 }} |
| 72 | # retry: {count: 1, delay: 5} |
| 73 | # skip_fail: false |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 74 | |
Dennis Dmitriev | 4f552f2 | 2017-09-13 12:26:46 +0300 | [diff] [blame] | 75 | #- description: Install gluserfs client |
| 76 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 77 | # -C 'I@glusterfs:client' state.sls glusterfs.client |
| 78 | # node_name: {{ HOSTNAME_CFG01 }} |
| 79 | # retry: {count: 1, delay: 5} |
| 80 | # skip_fail: false |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 81 | |
| 82 | - description: Install Galera on first server |
| 83 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 84 | -C 'I@galera:master' state.sls galera |
| 85 | node_name: {{ HOSTNAME_CFG01 }} |
| 86 | retry: {count: 1, delay: 5} |
| 87 | skip_fail: false |
| 88 | |
| 89 | - description: Install Galera on other servers |
| 90 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Dennis Dmitriev | c6f858c | 2018-03-13 22:45:22 +0200 | [diff] [blame] | 91 | -C 'I@galera:slave' state.sls galera -b 1 |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 92 | node_name: {{ HOSTNAME_CFG01 }} |
| 93 | retry: {count: 1, delay: 5} |
| 94 | skip_fail: false |
| 95 | |
| 96 | - description: Check mysql status |
| 97 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 98 | -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size" |
| 99 | node_name: {{ HOSTNAME_CFG01 }} |
| 100 | retry: {count: 1, delay: 5} |
| 101 | skip_fail: false |
| 102 | |
| 103 | - description: Install nginx |
| 104 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 105 | -C 'I@nginx:server' state.sls nginx |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 5} |
Dmitry Kalashnik | 2d6b89c | 2018-04-06 15:43:17 +0400 | [diff] [blame] | 108 | skip_fail: false |
| 109 | |
| 110 | - description: Restart rsyslog for haproxy logs |
| 111 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 112 | -C 'I@haproxy:proxy' service.restart rsyslog |
| 113 | node_name: {{ HOSTNAME_CFG01 }} |
| 114 | retry: {count: 1, delay: 5} |
| 115 | skip_fail: false |