We're still seeing apt-key failed to import gpg keys these days during the images building in the gate jobs, the problem is keys.gnupg.net and keyserver.ubuntu.com are both not stable according to [1] and [2], it's better to adopt pool.sks-keyservers.net instead and with simple retries. To reduce code duplication, this common apt-key importing function is also moved to ubuntu-guest as an environment snippet. [1] https://www.gnupg.org/faq/gnupg-faq.html#new_user_default_keyserver [2] https://sks-keyservers.net/overview-of-pools.php Closes-Bug: #1579094 Change-Id: I0fe200d140f6f9c4d423dd498797a225e3295a71 Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
42 lines
1.0 KiB
Bash
Executable File
42 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
|
# PURPOSE: Install controller base required packages
|
|
|
|
set -e
|
|
set -o xtrace
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
# NOTE(vkmc): Using MariaDB repositories is required
|
|
# https://mariadb.com/kb/en/mariadb/installing-mariadb-deb-files/
|
|
apt-get -y install software-properties-common
|
|
|
|
get_key_robust 0xF1656F24C74CD1D8
|
|
|
|
add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu xenial main'
|
|
|
|
# Pin MariaDB repository
|
|
sudo echo -e "Package: *\nPin: origin ftp.osuosl.org\nPin-Priority: 1000" > /etc/apt/preferences.d/mariadb.pref
|
|
|
|
apt-get -y update
|
|
apt-get -y install socat percona-xtrabackup
|
|
apt-get -y install libmariadbclient18 mariadb-server
|
|
|
|
cat >/etc/mysql/conf.d/no_perf_schema.cnf <<_EOF_
|
|
[mysqld]
|
|
performance_schema = off
|
|
_EOF_
|
|
|
|
mv /etc/mysql/my.cnf.fallback /etc/mysql/my.cnf
|
|
chown mysql:mysql /etc/mysql/my.cnf
|
|
cat >/etc/mysql/my.cnf <<_EOF_
|
|
[mysql]
|
|
|
|
!includedir /etc/mysql/conf.d/
|
|
_EOF_
|
|
|
|
rm /etc/init.d/mysql
|
|
systemctl daemon-reload
|
|
systemctl enable mariadb
|