Mysql quick init (#26)

* Preseed mysql data dir with something useful

* Configure fernet keys on first install

* Update overlay

* Ensure image is synced
This commit is contained in:
James Page 2018-11-11 21:29:27 +00:00 committed by Pete Vander Giessen
parent 1edeff78d8
commit 0c955d6e2c
3 changed files with 31 additions and 7 deletions

Binary file not shown.

22
snap/hooks/configure vendored
View File

@ -1,12 +1,5 @@
#!/bin/bash -e
# Install conf.d configuration from snap for db etc
echo "Installing configuration for OpenStack Services"
for project in neutron nova keystone glance; do
mkdir -p ${SNAP_COMMON}/etc/${project}/${project}.conf.d
cp -r ${SNAP}/etc/${project}/${project}.conf.d/* ${SNAP_COMMON}/etc/${project}/${project}.conf.d
done
# Create all of the databases
echo "Creating OpenStack Databases"
@ -43,3 +36,18 @@ ovs-vsctl --retry --may-exist add-br br-ex
# Configure br-ex
ip address add 10.20.20.1/24 dev br-ex || :
ip link set br-ex up || :
while ! nc -z localhost 9292; do sleep 0.1; done;
sleep 5
openstack image show cirros || {
[ -f $HOME/images/cirros-0.3.5-x86_64-disk.img ] || {
mkdir -p $HOME/images
wget \
http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img \
-O ${HOME}/images/cirros-0.3.5-x86_64-disk.img
}
openstack image create --file ${HOME}/images/cirros-0.3.5-x86_64-disk.img \
--public --container-format=bare --disk-format=qcow2 cirros
}

View File

@ -3,3 +3,19 @@ set -e
install -D $SNAP/var/snap/microstack/common/libvirt/libvirtd.conf $SNAP_COMMON/libvirt/libvirtd.conf
sed -i 's/unix_sock_group = "libvirtd"/unix_sock_group = "sudo"/' $SNAP_COMMON/libvirt/libvirtd.conf
# MySQL snapshot for speedy install
# snapshot is a mysql data dir with
# rocky keystone,nova,glance,neutron dbs.
mkdir -p ${SNAP_COMMON}/lib
tar -xJf ${SNAP}/data/mysql.tar.xz -C ${SNAP_COMMON}/lib
# Install conf.d configuration from snap for db etc
echo "Installing configuration for OpenStack Services"
for project in neutron nova keystone glance; do
mkdir -p ${SNAP_COMMON}/etc/${project}/${project}.conf.d
cp -r ${SNAP}/etc/${project}/${project}.conf.d/* ${SNAP_COMMON}/etc/${project}/${project}.conf.d
done
# Configure Keystone Fernet Keys
snap-openstack keystone-manage fernet_setup --keystone-user root --keystone-group root