Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp10-ovs/map.jinja' import HOSTNAME_CFG01 with context %} |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 2 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 3 | ################### Install OpenStack infra ########################## |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 4 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 5 | # salt.enforceState(saltMaster, 'I@glusterfs:server', 'glusterfs.server.service', true) |
| 6 | - description: Install and run GlusterFS |
| 7 | do: enforceState |
| 8 | target: I@glusterfs:server |
| 9 | state: glusterfs.server.service |
| 10 | |
| 11 | # // Install keepaliveds |
| 12 | # //runSaltProcessStep(master, 'I@keepalived:cluster', 'state.sls', ['keepalived'], 1) |
| 13 | # salt.enforceState(saltMaster, 'I@keepalived:cluster and *01*', 'keepalived', true) |
| 14 | # salt.enforceState(saltMaster, 'I@keepalived:cluster', 'keepalived', true) |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 15 | - description: Install keepalived |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 16 | do: enforceState |
| 17 | target: I@keepalived:cluster and *01* |
| 18 | state: keepalived |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 19 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 20 | - description: Re run installation of keepalived |
| 21 | do: enforceState |
| 22 | target: I@keepalived:cluster |
| 23 | state: keepalived |
| 24 | |
| 25 | # // Check the keepalived VIPs |
| 26 | # salt.runSaltProcessStep(saltMaster, 'I@keepalived:cluster', 'cmd.run', ['ip a | grep 172.16.10.2']) |
| 27 | # salt.enforceState(saltMaster, 'I@glusterfs:server and *01*', 'glusterfs.server.setup', true) |
| 28 | # salt.runSaltProcessStep(saltMaster, 'I@glusterfs:server', 'cmd.run', ['gluster peer status'], null, true) |
| 29 | # salt.runSaltProcessStep(saltMaster, 'I@glusterfs:server', 'cmd.run', ['gluster volume status'], null, true) |
| 30 | |
| 31 | - description: Show VIPs |
| 32 | do: runState |
| 33 | target: I@keepalived:cluster |
| 34 | state: cmd.run |
| 35 | args: ['ip a | grep 172.16.10.2'] |
| 36 | |
| 37 | - description: Re run Gluster sertver setup |
| 38 | do: enforceState |
| 39 | target: I@glusterfs:server and *01* |
| 40 | state: glusterfs.server.setup |
| 41 | |
| 42 | - description: Show Gluster peer status |
| 43 | do: runState |
| 44 | target: I@glusterfs:server |
| 45 | state: cmd.run |
| 46 | args: ['gluster peer status'] |
| 47 | |
| 48 | - description: Show Gluster volumes status |
| 49 | do: runState |
| 50 | target: I@glusterfs:server |
| 51 | state: cmd.run |
| 52 | args: ['gluster volume status'] |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 53 | |
| 54 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 55 | # // Install rabbitmq |
| 56 | # withEnv(['ASK_ON_ERROR=false']){ |
| 57 | # retry(2) { |
| 58 | # salt.enforceState(saltMaster, 'I@rabbitmq:server', 'rabbitmq', true) |
| 59 | # } |
| 60 | # } |
| 61 | # // Check the rabbitmq status |
| 62 | # salt.runSaltProcessStep(saltMaster, 'I@rabbitmq:server', 'cmd.run', ['rabbitmqctl cluster_status']) |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 63 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 64 | - description: Install rabbitmq |
| 65 | do: enforceState |
| 66 | target: I@rabbitmq:server |
| 67 | state: rabbitmq |
| 68 | retry: {count: 2, delay: 5} |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 69 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 70 | - description: Show rabbitmq status |
| 71 | do: runState |
| 72 | target: I@glusterfs:server |
| 73 | state: cmd.run |
| 74 | args: ['rabbitmqctl cluster_status'] |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 75 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 76 | # // Install galera |
| 77 | # withEnv(['ASK_ON_ERROR=false']){ |
| 78 | # retry(2) { |
| 79 | # salt.enforceState(saltMaster, 'I@galera:master', 'galera', true) |
| 80 | # } |
| 81 | # } |
| 82 | # salt.enforceState(saltMaster, 'I@galera:slave', 'galera', true) |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 83 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 84 | # // Check galera status |
| 85 | # salt.runSaltProcessStep(saltMaster, 'I@galera:master', 'mysql.status') |
| 86 | # salt.runSaltProcessStep(saltMaster, 'I@galera:slave', 'mysql.status') |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 87 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 88 | # // // Setup mysql client |
| 89 | # // salt.enforceState(saltMaster, 'I@mysql:client', 'mysql.client', true) |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 90 | |
| 91 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 92 | - description: Install Galera (master) |
| 93 | do: enforceState |
| 94 | target: I@galera:master |
| 95 | state: galera |
| 96 | retry: {count: 2, delay: 5} |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 97 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 98 | - description: Install Galera (slaves) |
| 99 | do: enforceState |
| 100 | target: I@galera:slave |
| 101 | state: galera |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 102 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 103 | - description: Show master galera status |
| 104 | do: runState |
| 105 | target: I@galera:master |
| 106 | state: mysql.status |
Tatyana Leontovich | 78b8348 | 2017-04-11 18:57:11 +0300 | [diff] [blame] | 107 | |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 108 | - description: Show master galera status |
| 109 | do: runState |
| 110 | target: I@galera:master |
| 111 | state: mysql.status |
| 112 | |
| 113 | # - description: Install mysql client |
| 114 | # do: enforceState |
| 115 | # target: I@mysql:client |
| 116 | # state: mysql.client |
| 117 | |
| 118 | |
| 119 | # // Install haproxy |
| 120 | # salt.enforceState(saltMaster, 'I@haproxy:proxy', 'haproxy', true) |
| 121 | # salt.runSaltProcessStep(saltMaster, 'I@haproxy:proxy', 'service.status', ['haproxy']) |
| 122 | # salt.runSaltProcessStep(saltMaster, 'I@haproxy:proxy', 'service.restart', ['rsyslog']) |
| 123 | |
| 124 | |
| 125 | - description: Install HAProxy |
| 126 | do: enforceState |
| 127 | target: I@haproxy:proxy |
| 128 | state: haproxy |
| 129 | |
| 130 | - description: Show HAProxy service status |
| 131 | do: runState |
| 132 | target: I@haproxy:proxy |
| 133 | state: service.status |
| 134 | args: ['haproxy'] |
| 135 | |
| 136 | - description: Restart HAProxy service |
| 137 | do: runState |
| 138 | target: I@haproxy:proxy |
| 139 | state: service.restart |
| 140 | args: ['haproxy'] |
| 141 | |
| 142 | # // Install memcached |
| 143 | # salt.enforceState(saltMaster, 'I@memcached:server', 'memcached', true) |
| 144 | - description: Install Memcached |
| 145 | do: enforceState |
| 146 | target: I@memcached:server |
| 147 | state: memcached |