Browse Source

Mysql quick init (#26)

* Preseed mysql data dir with something useful

* Configure fernet keys on first install

* Update overlay

* Ensure image is synced
configure-hook
James Page 3 years ago
committed by Pete Vander Giessen
parent
commit
0c955d6e2c
  1. BIN
      snap-overlay/data/mysql.tar.xz
  2. 22
      snap/hooks/configure
  3. 16
      snap/hooks/install

BIN
snap-overlay/data/mysql.tar.xz

22
snap/hooks/configure

@ -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
}

16
snap/hooks/install

@ -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
Loading…
Cancel
Save