Merge "Run migrations from only the bootstrap host"
This commit is contained in:
commit
e2cd5fa267
@ -1,49 +1,34 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
RUN_DB_SYNC=${1:-""}
|
||||
function run_db_sync() {
|
||||
[ -n "$RUN_DB_SYNC" ]
|
||||
}
|
||||
|
||||
db_pass=$(os-apply-config --key db-password)
|
||||
|
||||
PATH=/usr/local/bin:$PATH
|
||||
|
||||
os-db-create keystone keystone $db_pass
|
||||
run_db_sync && keystone-manage db_sync
|
||||
|
||||
if which cinder-manage 1>/dev/null 2>&1; then
|
||||
os-db-create cinder cinder $db_pass
|
||||
run_db_sync && cinder-manage db sync
|
||||
fi
|
||||
|
||||
if which ironic-dbsync 1>/dev/null 2>&1; then
|
||||
os-db-create ironic ironic $db_pass
|
||||
run_db_sync && ironic-dbsync --config-file /etc/ironic/ironic.conf
|
||||
fi
|
||||
|
||||
if which tuskar-dbsync 1>/dev/null 2>&1; then
|
||||
os-db-create tuskar tuskar $db_pass
|
||||
run_db_sync && tuskar-dbsync --config-file /etc/tuskar/tuskar.conf
|
||||
fi
|
||||
|
||||
if which ceilometer-dbsync 1>/dev/null 2>&1; then
|
||||
os-db-create ceilometer ceilometer $db_pass
|
||||
run_db_sync && ceilometer-dbsync --config-file /etc/ceilometer/ceilometer.conf
|
||||
fi
|
||||
|
||||
os-db-create nova nova $db_pass
|
||||
run_db_sync && nova-manage db sync
|
||||
|
||||
os-db-create nova_bm nova $db_pass
|
||||
run_db_sync && nova-baremetal-manage db sync
|
||||
|
||||
os-db-create glance glance $db_pass
|
||||
run_db_sync && glance-manage db_sync
|
||||
|
||||
os-db-create heat heat $db_pass
|
||||
run_db_sync && heat-manage db_sync
|
||||
|
||||
os-db-create ovs_neutron neutron $db_pass
|
||||
neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
|
||||
|
@ -1,4 +1,5 @@
|
||||
ceilometer
|
||||
iptables
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
|
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
ceilometer-dbsync --config-file /etc/ceilometer/ceilometer.conf
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
ceilometer-dbsync --config-file /etc/ceilometer/ceilometer.conf
|
||||
|
||||
os-svc-enable -n ceilometer-api
|
||||
|
||||
[ -d /mnt/state/var/lib/ceilometer ] || install -d -D -m 0770 -o ceilometer -g ceilometer /mnt/state/var/lib/ceilometer
|
||||
|
@ -1,4 +1,5 @@
|
||||
cinder
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
source-repositories
|
||||
|
6
elements/cinder-api/os-refresh-config/configure.d/90-cinder-db-sync
Executable file
6
elements/cinder-api/os-refresh-config/configure.d/90-cinder-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
cinder-manage db sync
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
cinder-manage db sync
|
||||
|
||||
os-svc-enable -n cinder-api
|
||||
os-svc-enable -n cinder-scheduler
|
||||
os-svc-restart -n cinder-api
|
||||
|
@ -1,5 +1,6 @@
|
||||
iptables
|
||||
os-apply-config
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
selinux
|
||||
|
6
elements/glance/os-refresh-config/configure.d/90-glance-db-sync
Executable file
6
elements/glance/os-refresh-config/configure.d/90-glance-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
glance-manage db sync
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
glance-manage db_sync
|
||||
|
||||
os-svc-enable -n glance-api
|
||||
os-svc-enable -n glance-reg
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
heat
|
||||
os-apply-config
|
||||
os-is-bootstrap-host
|
||||
|
6
elements/heat-engine/os-refresh-config/configure.d/90-heat-db-sync
Executable file
6
elements/heat-engine/os-refresh-config/configure.d/90-heat-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
heat-manage db_sync
|
||||
fi
|
@ -2,8 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
heat-manage db_sync
|
||||
|
||||
os-svc-enable -n heat-engine
|
||||
|
||||
os-svc-restart -n heat-engine
|
||||
|
@ -1,4 +1,5 @@
|
||||
iptables
|
||||
ironic
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
|
6
elements/ironic-api/os-refresh-config/configure.d/90-ironic-db-sync
Executable file
6
elements/ironic-api/os-refresh-config/configure.d/90-ironic-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
ironic-dbsync --config-file /etc/ironic/ironic.conf
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
ironic-dbsync --config-file /etc/ironic/ironic.conf
|
||||
|
||||
os-svc-enable -n ironic-api
|
||||
|
||||
service ironic-api restart
|
||||
|
@ -1,5 +1,6 @@
|
||||
iptables
|
||||
os-apply-config
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
selinux
|
||||
|
6
elements/keystone/os-refresh-config/configure.d/90-keystone-db-sync
Executable file
6
elements/keystone/os-refresh-config/configure.d/90-keystone-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
keystone-manage db_sync
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
keystone-manage db_sync
|
||||
|
||||
os-svc-enable -n keystone
|
||||
|
||||
os-svc-restart -n keystone
|
||||
|
@ -1,5 +1,6 @@
|
||||
iptables
|
||||
os-apply-config
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
selinux
|
||||
|
6
elements/neutron/os-refresh-config/configure.d/90-neutron-db-sync
Executable file
6
elements/neutron/os-refresh-config/configure.d/90-neutron-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
|
||||
fi
|
@ -1,3 +1,4 @@
|
||||
iptables
|
||||
nova
|
||||
nova-novncproxy
|
||||
os-is-bootstrap-host
|
||||
|
6
elements/nova-api/os-refresh-config/configure.d/90-nova-db-sync
Executable file
6
elements/nova-api/os-refresh-config/configure.d/90-nova-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
nova-manage db sync
|
||||
fi
|
@ -9,8 +9,6 @@ chown -R nova:nova /var/run/openstack
|
||||
mkdir -p /var/run/nova
|
||||
chown -R nova:nova /var/run/nova
|
||||
|
||||
nova-manage db sync
|
||||
|
||||
os-svc-enable -n nova-conductor
|
||||
os-svc-enable -n nova-api
|
||||
os-svc-enable -n nova-cert
|
||||
|
@ -1,4 +1,5 @@
|
||||
iptables
|
||||
nova-compute
|
||||
os-apply-config
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
|
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
nova-baremetal-manage db sync
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
nova-baremetal-manage db sync
|
||||
|
||||
os-svc-enable -n nova-baremetal-deploy-helper
|
||||
|
||||
os-svc-restart -n nova-baremetal-deploy-helper
|
||||
|
@ -1,4 +1,5 @@
|
||||
os-apply-config
|
||||
os-is-bootstrap-host
|
||||
os-refresh-config
|
||||
os-svc-install
|
||||
source-repositories
|
||||
|
6
elements/tuskar/os-refresh-config/configure.d/90-tuskar-db-sync
Executable file
6
elements/tuskar/os-refresh-config/configure.d/90-tuskar-db-sync
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
if os-is-bootstrap-host ; then
|
||||
tuskar-dbsync --config-file /etc/tuskar/tuskar.conf
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
tuskar-dbsync --config-file /etc/tuskar/tuskar.conf
|
||||
|
||||
os-svc-enable -n tuskar-api
|
||||
|
||||
service tuskar-api restart
|
||||
|
Loading…
Reference in New Issue
Block a user