Add DIB MySQL element
Change-Id: If6a3bf8bc2c00f90efca025df6e3c0d6be0635b0
This commit is contained in:
parent
fa750f5a0e
commit
14560d749c
2
elements/mysql/README.md
Normal file
2
elements/mysql/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
This element setups basic components of MySQL on Ubuntu and Fedora.
|
||||
It is light version of original MySQL element (https://github.com/openstack/tripleo-image-elements/tree/master/elements/mysql).
|
13
elements/mysql/install.d/10-mysql
Executable file
13
elements/mysql/install.d/10-mysql
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -o xtrace
|
||||
if [ $(lsb_release -is) = 'Fedora' ]; then
|
||||
install-packages community-mysql community-mysql-libs community-mysql-server mysql-connector-java
|
||||
mkdir -p /etc/mysql/conf.d
|
||||
elif [ $(lsb_release -is) = 'Ubuntu' ]; then
|
||||
install-packages mysql-server-5.5 mysql-client-5.5 libmysql-java
|
||||
else
|
||||
echo "Unknown distribution"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf /var/lib/mysql/ib_logfile*
|
16
elements/mysql/install.d/99-disable-mysql-on-boot
Executable file
16
elements/mysql/install.d/99-disable-mysql-on-boot
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Disable startup MySQL on boot in Ubuntu
|
||||
# Service mysqld dones't start on boot in Fedora
|
||||
|
||||
if [ $(lsb_release -is) = 'Ubuntu' ]; then
|
||||
if [ -e "/etc/init/mysql.conf" ]; then
|
||||
sed -i "s/start on runlevel \[.*\]/start on never runlevel [2345]/g" /etc/init/mysql.conf
|
||||
else
|
||||
update-rc.d -f mysql remove
|
||||
fi
|
||||
fi
|
||||
|
||||
# Script for starting mysql
|
||||
|
||||
install -D -g root -o root -m 0755 $(dirname $0)/start-mysql.sh /opt/start-mysql.sh
|
6
elements/mysql/install.d/start-mysql.sh
Normal file
6
elements/mysql/install.d/start-mysql.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
if [ $(lsb_release -is) = 'Ubuntu' ]; then
|
||||
sudo service mysql start
|
||||
elif [ $(lsb_release -is) = 'Fedora' ]; then
|
||||
sudo service mysqld start
|
||||
fi
|
Loading…
Reference in New Issue
Block a user