Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 1 | package com.mirantis.mk |
| 2 | /** |
| 3 | * Orchestration functions |
| 4 | * |
| 5 | */ |
| 6 | |
| 7 | def validateFoundationInfra(master) { |
| 8 | def salt = new com.mirantis.mk.Salt() |
| 9 | salt.runSaltProcessStep(master, 'I@salt:master', 'cmd.run', ['salt-key']) |
| 10 | salt.runSaltProcessStep(master, 'I@salt:minion', 'test.version') |
| 11 | salt.runSaltProcessStep(master, 'I@salt:master', 'cmd.run', ['reclass-salt --top']) |
| 12 | salt.runSaltProcessStep(master, 'I@reclass:storage', 'reclass.inventory') |
| 13 | salt.runSaltProcessStep(master, 'I@salt:minion', 'state.show_top') |
| 14 | } |
| 15 | |
| 16 | |
| 17 | def installFoundationInfra(master) { |
| 18 | def salt = new com.mirantis.mk.Salt() |
| 19 | salt.runSaltProcessStep(master, 'I@salt:master', 'state.sls', ['salt.master,reclass']) |
Bartosz Kupidura | b295698 | 2017-03-29 12:35:23 +0200 | [diff] [blame] | 20 | salt.runSaltProcessStep(master, '*', 'saltutil.refresh_pillar') |
| 21 | salt.runSaltProcessStep(master, '*', 'saltutil.sync_all') |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 22 | salt.runSaltProcessStep(master, 'I@linux:system', 'state.sls', ['linux,openssh,salt.minion,ntp']) |
| 23 | } |
| 24 | |
Tomáš Kukrál | 8d2be5a | 2017-02-28 11:22:29 +0100 | [diff] [blame] | 25 | def installInfraKvm(master) { |
| 26 | def salt = new com.mirantis.mk.Salt() |
| 27 | salt.runSaltProcessStep(master, 'I@linux:system', 'saltutil.refresh_pillar') |
| 28 | salt.runSaltProcessStep(master, 'I@linux:system', 'saltutil.sync_all') |
| 29 | |
| 30 | salt.runSaltProcessStep(master, 'I@salt:control', 'state.sls', ['salt.minion,linux.system,linux.network,ntp']) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 31 | salt.enforceState(master, 'I@salt:control', 'libvirt', true) |
| 32 | salt.enforceState(master, 'I@salt:control', 'salt.control', true) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 33 | |
Tomáš Kukrál | adf8395 | 2017-03-01 18:10:50 +0100 | [diff] [blame] | 34 | sleep(300) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 35 | |
Tomáš Kukrál | adf8395 | 2017-03-01 18:10:50 +0100 | [diff] [blame] | 36 | salt.runSaltProcessStep(master, '* and not kvm*', 'saltutil.refresh_pillar') |
| 37 | salt.runSaltProcessStep(master, '* and not kvm*', 'saltutil.sync_all') |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 38 | |
Tomáš Kukrál | 926e633 | 2017-03-02 09:23:03 +0100 | [diff] [blame] | 39 | // workaround - install apt-transport-https |
| 40 | salt.runSaltProcessStep(master, '* and not kvm*', 'pkg.install', ['apt-transport-https']) |
| 41 | |
| 42 | salt.runSaltProcessStep(master, '* and not kvm*', 'state.sls', ['linux,openssh,salt.minion,ntp']) |
Tomáš Kukrál | 8d2be5a | 2017-02-28 11:22:29 +0100 | [diff] [blame] | 43 | } |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 44 | |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 45 | def installOpenstackMkInfra(master, physical = "false") { |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 46 | def salt = new com.mirantis.mk.Salt() |
| 47 | // Install keepaliveds |
| 48 | //runSaltProcessStep(master, 'I@keepalived:cluster', 'state.sls', ['keepalived'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 49 | salt.enforceState(master, 'ctl01*', 'keepalived', true) |
| 50 | salt.enforceState(master, 'I@keepalived:cluster', 'keepalived', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 51 | // Check the keepalived VIPs |
| 52 | salt.runSaltProcessStep(master, 'I@keepalived:cluster', 'cmd.run', ['ip a | grep 172.16.10.2']) |
| 53 | // Install glusterfs |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 54 | salt.enforceState(master, 'I@glusterfs:server', 'glusterfs.server.service', true) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 55 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 56 | //runSaltProcessStep(master, 'I@glusterfs:server', 'state.sls', ['glusterfs.server.setup'], 1) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 57 | if (physical.equals("false")) { |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 58 | salt.enforceState(master, 'ctl01*', 'glusterfs.server.setup', true) |
| 59 | salt.enforceState(master, 'ctl02*', 'glusterfs.server.setup', true) |
| 60 | salt.enforceState(master, 'ctl03*', 'glusterfs.server.setup', true) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 61 | } else { |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 62 | salt.enforceState(master, 'kvm01*', 'glusterfs.server.setup', true) |
| 63 | salt.enforceState(master, 'kvm02*', 'glusterfs.server.setup', true) |
| 64 | salt.enforceState(master, 'kvm03*', 'glusterfs.server.setup', true) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 65 | } |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 66 | salt.runSaltProcessStep(master, 'I@glusterfs:server', 'cmd.run', ['gluster peer status']) |
| 67 | salt.runSaltProcessStep(master, 'I@glusterfs:server', 'cmd.run', ['gluster volume status']) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 68 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 69 | // Install rabbitmq |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 70 | salt.enforceState(master, 'I@rabbitmq:server', 'rabbitmq', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 71 | // Check the rabbitmq status |
| 72 | salt.runSaltProcessStep(master, 'I@rabbitmq:server', 'cmd.run', ['rabbitmqctl cluster_status']) |
| 73 | // Install galera |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 74 | salt.enforceState(master, 'I@galera:master', 'galera', true) |
| 75 | salt.enforceState(master, 'I@galera:slave', 'galera', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 76 | // Check galera status |
| 77 | salt.runSaltProcessStep(master, 'I@galera:master', 'mysql.status') |
| 78 | salt.runSaltProcessStep(master, 'I@galera:slave', 'mysql.status') |
| 79 | // Install haproxy |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 80 | salt.enforceState(master, 'I@haproxy:proxy', 'haproxy', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 81 | salt.runSaltProcessStep(master, 'I@haproxy:proxy', 'service.status', ['haproxy']) |
| 82 | salt.runSaltProcessStep(master, 'I@haproxy:proxy', 'service.restart', ['rsyslog']) |
| 83 | // Install memcached |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 84 | salt.enforceState(master, 'I@memcached:server', 'memcached', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | |
| 88 | def installOpenstackMkControl(master) { |
| 89 | def salt = new com.mirantis.mk.Salt() |
| 90 | // setup keystone service |
| 91 | //runSaltProcessStep(master, 'I@keystone:server', 'state.sls', ['keystone.server'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 92 | salt.enforceState(master, 'ctl01*', 'keystone.server', true) |
| 93 | salt.enforceState(master, 'I@keystone:server', 'keystone.server', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 94 | // populate keystone services/tenants/roles/users |
Tomáš Kukrál | 926e633 | 2017-03-02 09:23:03 +0100 | [diff] [blame] | 95 | |
| 96 | // keystone:client must be called locally |
| 97 | salt.runSaltProcessStep(master, 'I@keystone:client', 'cmd.run', ['salt-call state.sls keystone.client']) |
| 98 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 99 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; keystone service-list']) |
| 100 | // Install glance and ensure glusterfs clusters |
| 101 | //runSaltProcessStep(master, 'I@glance:server', 'state.sls', ['glance.server'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 102 | salt.enforceState(master, 'ctl01*', 'glance.server', true) |
| 103 | salt.enforceState(master, 'I@glance:server', 'glance.server', true) |
| 104 | salt.enforceState(master, 'I@glance:server', 'glusterfs.client', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 105 | // Update fernet tokens before doing request on keystone server |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 106 | salt.enforceState(master, 'I@keystone:server', 'keystone.server', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 107 | // Check glance service |
| 108 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; glance image-list']) |
| 109 | // Install and check nova service |
| 110 | //runSaltProcessStep(master, 'I@nova:controller', 'state.sls', ['nova'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 111 | salt.enforceState(master, 'ctl01*', 'nova', true) |
| 112 | salt.enforceState(master, 'I@nova:controller', 'nova', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 113 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova service-list']) |
| 114 | // Install and check cinder service |
| 115 | //runSaltProcessStep(master, 'I@cinder:controller', 'state.sls', ['cinder'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 116 | salt.enforceState(master, 'ctl01*', 'cinder', true) |
| 117 | salt.enforceState(master, 'I@cinder:controller', 'cinder', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 118 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; cinder list']) |
| 119 | // Install neutron service |
| 120 | //runSaltProcessStep(master, 'I@neutron:server', 'state.sls', ['neutron'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 121 | salt.enforceState(master, 'ctl01*', 'neutron', true) |
| 122 | salt.enforceState(master, 'I@neutron:server', 'neutron', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 123 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron agent-list']) |
| 124 | // Install heat service |
| 125 | //runSaltProcessStep(master, 'I@heat:server', 'state.sls', ['heat'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 126 | salt.enforceState(master, 'ctl01*', 'heat', true) |
| 127 | salt.enforceState(master, 'I@heat:server', 'heat', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 128 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; heat resource-type-list']) |
| 129 | // Install horizon dashboard |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 130 | salt.enforceState(master, 'I@horizon:server', 'horizon', true) |
| 131 | salt.enforceState(master, 'I@nginx:server', 'nginx', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 135 | def installOpenstackMkNetwork(master, physical = "false") { |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 136 | def salt = new com.mirantis.mk.Salt() |
| 137 | // Install opencontrail database services |
| 138 | //runSaltProcessStep(master, 'I@opencontrail:database', 'state.sls', ['opencontrail.database'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 139 | salt.enforceState(master, 'ntw01*', 'opencontrail.database', true) |
| 140 | salt.enforceState(master, 'I@opencontrail:database', 'opencontrail.database', true) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 141 | // Install opencontrail control services |
| 142 | //runSaltProcessStep(master, 'I@opencontrail:control', 'state.sls', ['opencontrail'], 1) |
Tomáš Kukrál | 0abdde5 | 2017-03-01 21:57:23 +0100 | [diff] [blame] | 143 | salt.enforceState(master, 'ntw01*', 'opencontrail', true) |
| 144 | salt.enforceState(master, 'I@opencontrail:control', 'opencontrail', true) |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 145 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 146 | // Provision opencontrail control services |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 147 | if (physical.equals("false")) { |
| 148 | salt.runSaltProcessStep(master, 'I@opencontrail:control:id:1', 'cmd.run', ['/usr/share/contrail-utils/provision_control.py --api_server_ip 172.16.10.254 --api_server_port 8082 --host_name ctl01 --host_ip 172.16.10.101 --router_asn 64512 --admin_password workshop --admin_user admin --admin_tenant_name admin --oper add']) |
| 149 | salt.runSaltProcessStep(master, 'I@opencontrail:control:id:1', 'cmd.run', ['/usr/share/contrail-utils/provision_control.py --api_server_ip 172.16.10.254 --api_server_port 8082 --host_name ctl02 --host_ip 172.16.10.102 --router_asn 64512 --admin_password workshop --admin_user admin --admin_tenant_name admin --oper add']) |
| 150 | salt.runSaltProcessStep(master, 'I@opencontrail:control:id:1', 'cmd.run', ['/usr/share/contrail-utils/provision_control.py --api_server_ip 172.16.10.254 --api_server_port 8082 --host_name ctl03 --host_ip 172.16.10.103 --router_asn 64512 --admin_password workshop --admin_user admin --admin_tenant_name admin --oper add']) |
| 151 | } |
| 152 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 153 | // Test opencontrail |
| 154 | salt.runSaltProcessStep(master, 'I@opencontrail:control', 'cmd.run', ['contrail-status']) |
| 155 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron net-list']) |
| 156 | salt.runSaltProcessStep(master, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova net-list']) |
| 157 | } |
| 158 | |
| 159 | |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 160 | def installOpenstackMkCompute(master, physical = "false") { |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 161 | def salt = new com.mirantis.mk.Salt() |
| 162 | // Configure compute nodes |
| 163 | salt.runSaltProcessStep(master, 'I@nova:compute', 'state.apply') |
| 164 | salt.runSaltProcessStep(master, 'I@nova:compute', 'state.apply') |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 165 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 166 | // Provision opencontrail virtual routers |
Tomáš Kukrál | b8e9711 | 2017-03-01 16:03:16 +0100 | [diff] [blame] | 167 | if (physical.equals("false")) { |
| 168 | salt.runSaltProcessStep(master, 'I@opencontrail:control:id:1', 'cmd.run', ['/usr/share/contrail-utils/provision_vrouter.py --host_name cmp01 --host_ip 172.16.10.105 --api_server_ip 172.16.10.254 --oper add --admin_user admin --admin_password workshop --admin_tenant_name admin']) |
| 169 | } |
| 170 | |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 171 | salt.runSaltProcessStep(master, 'I@nova:compute', 'system.reboot') |
| 172 | } |
| 173 | |
| 174 | |
| 175 | def installOpenstackMcpInfra(master) { |
| 176 | def salt = new com.mirantis.mk.Salt() |
| 177 | // Comment nameserver |
| 178 | salt.runSaltProcessStep(master, 'I@kubernetes:master', 'cmd.run', ["sed -i 's/nameserver 10.254.0.10/#nameserver 10.254.0.10/g' /etc/resolv.conf"]) |
| 179 | // Install glusterfs |
| 180 | salt.runSaltProcessStep(master, 'I@glusterfs:server', 'state.sls', ['glusterfs.server.service']) |
| 181 | // Install keepalived |
| 182 | salt.runSaltProcessStep(master, 'ctl01*', 'state.sls', ['keepalived']) |
| 183 | salt.runSaltProcessStep(master, 'I@keepalived:cluster', 'state.sls', ['keepalived']) |
| 184 | // Check the keepalived VIPs |
| 185 | salt.runSaltProcessStep(master, 'I@keepalived:cluster', 'cmd.run', ['ip a | grep 172.16.10.2']) |
| 186 | // Setup glusterfs |
| 187 | salt.runSaltProcessStep(master, 'ctl01*', 'state.sls', ['glusterfs.server.setup']) |
| 188 | salt.runSaltProcessStep(master, 'ctl02*', 'state.sls', ['glusterfs.server.setup']) |
| 189 | salt.runSaltProcessStep(master, 'ctl03*', 'state.sls', ['glusterfs.server.setup']) |
| 190 | salt.runSaltProcessStep(master, 'I@glusterfs:server', 'cmd.run', ['gluster peer status']) |
| 191 | salt.runSaltProcessStep(master, 'I@glusterfs:server', 'cmd.run', ['gluster volume status']) |
| 192 | // Install haproxy |
| 193 | salt.runSaltProcessStep(master, 'I@haproxy:proxy', 'state.sls', ['haproxy']) |
| 194 | salt.runSaltProcessStep(master, 'I@haproxy:proxy', 'service.status', ['haproxy']) |
| 195 | // Install docker |
| 196 | salt.runSaltProcessStep(master, 'I@docker:host', 'state.sls', ['docker.host']) |
| 197 | salt.runSaltProcessStep(master, 'I@docker:host', 'cmd.run', ['docker ps']) |
| 198 | // Install bird |
| 199 | salt.runSaltProcessStep(master, 'I@bird:server', 'state.sls', ['bird']) |
| 200 | // Install etcd |
Tomáš Kukrál | c59f4c5 | 2017-03-10 23:03:48 +0100 | [diff] [blame] | 201 | salt.runSaltProcessStep(master, 'I@etcd:server', 'state.sls', ['salt.minion.cert,etcd.server.service']) |
Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 202 | salt.runSaltProcessStep(master, 'I@etcd:server', 'cmd.run', ['etcdctl cluster-health']) |
| 203 | } |
| 204 | |
| 205 | |
| 206 | def installOpenstackMcpControl(master) { |
| 207 | def salt = new com.mirantis.mk.Salt() |
| 208 | // Install Kubernetes pool and Calico |
| 209 | salt.runSaltProcessStep(master, 'I@kubernetes:pool', 'state.sls', ['kubernetes.pool']) |
| 210 | salt.runSaltProcessStep(master, 'I@kubernetes:pool', 'cmd.run', ['calicoctl node status']) |
| 211 | |
| 212 | // Setup etcd server |
| 213 | salt.runSaltProcessStep(master, 'I@kubernetes:master', 'state.sls', ['etcd.server.setup']) |
| 214 | |
| 215 | // Run k8s without master.setup |
| 216 | salt.runSaltProcessStep(master, 'I@kubernetes:master', 'state.sls', ['kubernetes', 'exclude=kubernetes.master.setup']) |
| 217 | |
| 218 | // Run k8s master setup |
| 219 | salt.runSaltProcessStep(master, 'ctl01*', 'state.sls', ['kubernetes.master.setup']) |
| 220 | |
| 221 | // Revert comment nameserver |
| 222 | salt.runSaltProcessStep(master, 'I@kubernetes:master', 'cmd.run', ["sed -i 's/nameserver 10.254.0.10/#nameserver 10.254.0.10/g' /etc/resolv.conf"]) |
| 223 | |
| 224 | // Set route |
| 225 | salt.runSaltProcessStep(master, 'I@kubernetes:pool', 'cmd.run', ['ip r a 10.254.0.0/16 dev ens4']) |
| 226 | |
| 227 | // Restart kubelet |
| 228 | salt.runSaltProcessStep(master, 'I@kubernetes:pool', 'service.restart', ['kubelet']) |
| 229 | } |
| 230 | |
| 231 | |
| 232 | def installOpenstackMcpCompute(master) { |
| 233 | def salt = new com.mirantis.mk.Salt(); |
| 234 | // Install opencontrail |
| 235 | salt.runSaltProcessStep(master, 'I@opencontrail:compute', 'state.sls', ['opencontrail']) |
| 236 | // Reboot compute nodes |
| 237 | salt.runSaltProcessStep(master, 'I@opencontrail:compute', 'system.reboot') |
| 238 | } |
| 239 | |
| 240 | |
| 241 | def installStacklightControl(master) { |
| 242 | def salt = new com.mirantis.mk.Salt(); |
| 243 | salt.runSaltProcessStep(master, 'I@elasticsearch:server', 'state.sls', ['elasticsearch.server']) |
| 244 | salt.runSaltProcessStep(master, 'I@influxdb:server', 'state.sls', ['influxdb']) |
| 245 | salt.runSaltProcessStep(master, 'I@kibana:server', 'state.sls', ['kibana.server']) |
| 246 | salt.runSaltProcessStep(master, 'I@grafana:server', 'state.sls', ['grafana']) |
| 247 | salt.runSaltProcessStep(master, 'I@nagios:server', 'state.sls', ['nagios']) |
| 248 | salt.runSaltProcessStep(master, 'I@elasticsearch:client', 'state.sls', ['elasticsearch.client']) |
| 249 | salt.runSaltProcessStep(master, 'I@kibana:client', 'state.sls', ['kibana.client']) |
Tomáš Kukrál | f06ca0f | 2017-02-27 15:18:50 +0100 | [diff] [blame] | 250 | } |