Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp11-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 2 | |
| 3 | # Install support services |
Tatyana Leontovich | a523021 | 2017-09-27 14:43:06 +0300 | [diff] [blame] | 4 | - description: sync time |
| 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 6 | 'service ntp stop; ntpd -gq; service ntp start' |
| 7 | node_name: {{ HOSTNAME_CFG01 }} |
| 8 | retry: {count: 1, delay: 30} |
Tatyana Leontovich | 5cab58b | 2017-09-27 16:22:48 +0300 | [diff] [blame] | 9 | skip_fail: true |
Tatyana Leontovich | a523021 | 2017-09-27 14:43:06 +0300 | [diff] [blame] | 10 | |
Tatyana Leontovich | fc976b8 | 2017-04-25 20:46:13 +0300 | [diff] [blame] | 11 | - description: Install keepalived on ctl01 |
| 12 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 13 | -C 'I@keepalived:cluster and *01*' state.sls keepalived |
| 14 | node_name: {{ HOSTNAME_CFG01 }} |
| 15 | retry: {count: 1, delay: 10} |
| 16 | skip_fail: true |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 17 | |
| 18 | - description: Install keepalived |
| 19 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | fc976b8 | 2017-04-25 20:46:13 +0300 | [diff] [blame] | 20 | -C 'I@keepalived:cluster' state.sls keepalived |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 21 | node_name: {{ HOSTNAME_CFG01 }} |
| 22 | retry: {count: 1, delay: 10} |
| 23 | skip_fail: true |
| 24 | |
| 25 | - description: Check the VIP |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 26 | cmd: | |
| 27 | OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`; |
| 28 | echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}"; |
| 29 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keepalived:cluster' cmd.run "ip a | grep ${OPENSTACK_CONTROL_ADDRESS}" | grep -B1 ${OPENSTACK_CONTROL_ADDRESS} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 30 | node_name: {{ HOSTNAME_CFG01 }} |
| 31 | retry: {count: 1, delay: 5} |
| 32 | skip_fail: false |
| 33 | |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 34 | - description: Install glusterfs |
| 35 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 36 | -C 'I@glusterfs:server' state.sls glusterfs.server.service |
| 37 | node_name: {{ HOSTNAME_CFG01 }} |
| 38 | retry: {count: 1, delay: 5} |
| 39 | skip_fail: false |
| 40 | |
| 41 | - description: Setup glusterfs on primary controller |
| 42 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 43 | -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1 |
| 44 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | c3b7d72 | 2017-09-27 15:07:16 +0300 | [diff] [blame] | 45 | retry: {count: 2, delay: 20} |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 46 | skip_fail: false |
| 47 | |
| 48 | - description: Check the gluster status |
| 49 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 50 | -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1 |
| 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 5} |
| 53 | skip_fail: false |
| 54 | |
Tatyana Leontovich | 86851a2 | 2017-04-25 21:25:26 +0300 | [diff] [blame] | 55 | - description: Install RabbitMQ on ctl01 |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 57 | -C 'I@rabbitmq:server and *01*' state.sls rabbitmq |
| 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 1, delay: 5} |
| 60 | skip_fail: false |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 61 | |
| 62 | - description: Install RabbitMQ |
| 63 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 86851a2 | 2017-04-25 21:25:26 +0300 | [diff] [blame] | 64 | -C 'I@rabbitmq:server' state.sls rabbitmq |
Tatyana Leontovich | d8bf14f | 2017-04-19 12:20:50 +0300 | [diff] [blame] | 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 1, delay: 5} |
| 67 | skip_fail: false |
| 68 | |
| 69 | - description: Check the rabbitmq status |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 71 | -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status' |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 5} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Install Galera on first server |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 78 | -C 'I@galera:master' state.sls galera |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 5} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Install Galera on other servers |
| 84 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 85 | -C 'I@galera:slave' state.sls galera |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 5} |
| 88 | skip_fail: false |
| 89 | |
| 90 | - description: Check mysql status |
| 91 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 92 | -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size" |
| 93 | node_name: {{ HOSTNAME_CFG01 }} |
| 94 | retry: {count: 1, delay: 5} |
| 95 | skip_fail: true |
| 96 | |
| 97 | |
| 98 | - description: Install haproxy |
| 99 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 100 | -C 'I@haproxy:proxy' state.sls haproxy |
| 101 | node_name: {{ HOSTNAME_CFG01 }} |
| 102 | retry: {count: 1, delay: 5} |
| 103 | skip_fail: false |
| 104 | |
| 105 | - description: Check haproxy status |
| 106 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 107 | -C 'I@haproxy:proxy' service.status haproxy |
| 108 | node_name: {{ HOSTNAME_CFG01 }} |
| 109 | retry: {count: 1, delay: 5} |
| 110 | skip_fail: false |
| 111 | |
| 112 | - description: Restart rsyslog |
| 113 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 114 | -C 'I@haproxy:proxy' service.restart rsyslog |
| 115 | node_name: {{ HOSTNAME_CFG01 }} |
| 116 | retry: {count: 1, delay: 5} |
| 117 | skip_fail: false |
| 118 | |
| 119 | - description: Install memcached on all controllers |
| 120 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 121 | -C 'I@memcached:server' state.sls memcached |
| 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 1, delay: 5} |
| 124 | skip_fail: false |