Merge "Optionally give mysql user all global privs."
This commit is contained in:
commit
880924a621
modules
jenkins/manifests
openstack_project
files/nodepool/scripts
manifests
@ -6,7 +6,8 @@ class jenkins::slave(
|
||||
$bare = false,
|
||||
$user = true,
|
||||
$python3 = false,
|
||||
$include_pypy = false
|
||||
$include_pypy = false,
|
||||
$all_mysql_privs = false,
|
||||
) {
|
||||
|
||||
include pip
|
||||
@ -303,10 +304,12 @@ class jenkins::slave(
|
||||
require => Database_user['openstack_citest@localhost'],
|
||||
}
|
||||
|
||||
database_grant { 'openstack_citest@localhost':
|
||||
privileges => ['CREATE_PRIV', 'DROP_PRIV'],
|
||||
provider => 'mysql',
|
||||
require => Database_user['openstack_citest@localhost'],
|
||||
if ($all_mysql_privs == true) {
|
||||
database_grant { 'openstack_citest@localhost':
|
||||
privileges => ['all'],
|
||||
provider => 'mysql',
|
||||
require => Database_user['openstack_citest@localhost'],
|
||||
}
|
||||
}
|
||||
|
||||
# The puppetlabs postgres module does not manage the postgres user
|
||||
|
@ -21,6 +21,7 @@ SUDO=$2
|
||||
BARE=$3
|
||||
PYTHON3=${4:-false}
|
||||
PYPY=${5:-false}
|
||||
ALL_MYSQL_PRIVS=${6:-false}
|
||||
|
||||
sudo hostname $HOSTNAME
|
||||
wget https://git.openstack.org/cgit/openstack-infra/config/plain/install_puppet.sh
|
||||
@ -30,10 +31,10 @@ sudo git clone --depth=1 git://git.openstack.org/openstack-infra/config.git \
|
||||
sudo /bin/bash /root/config/install_modules.sh
|
||||
if [ -z "$NODEPOOL_SSH_KEY" ] ; then
|
||||
sudo puppet apply --modulepath=/root/config/modules:/etc/puppet/modules \
|
||||
-e "class {'openstack_project::single_use_slave': sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, }"
|
||||
-e "class {'openstack_project::single_use_slave': sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, all_mysql_privs => $ALL_MYSQL_PRIVS, }"
|
||||
else
|
||||
sudo puppet apply --modulepath=/root/config/modules:/etc/puppet/modules \
|
||||
-e "class {'openstack_project::single_use_slave': install_users => false, sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, ssh_key => '$NODEPOOL_SSH_KEY', }"
|
||||
-e "class {'openstack_project::single_use_slave': install_users => false, sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, all_mysql_privs => $ALL_MYSQL_PRIVS, ssh_key => '$NODEPOOL_SSH_KEY', }"
|
||||
fi
|
||||
|
||||
sudo mkdir -p /opt/git
|
||||
|
@ -19,8 +19,11 @@
|
||||
HOSTNAME=$1
|
||||
SUDO='false'
|
||||
BARE='false'
|
||||
PYTHON3='false'
|
||||
PYPY='false'
|
||||
ALL_MYSQL_PRIVS='true'
|
||||
|
||||
./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE"
|
||||
./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" "$PYTHON3" "$PYPY" "$ALL_MYSQL_PRIVS"
|
||||
|
||||
sync
|
||||
sleep 5
|
||||
|
@ -21,5 +21,6 @@ SUDO='false'
|
||||
BARE='false'
|
||||
PYTHON3='true'
|
||||
PYPY='true'
|
||||
ALL_MYSQL_PRIVS='true'
|
||||
|
||||
./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" "$PYTHON3" "$PYPY"
|
||||
./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" "$PYTHON3" "$PYPY" "$ALL_MYSQL_PRIVS"
|
||||
|
@ -14,6 +14,7 @@ class openstack_project::single_use_slave (
|
||||
$python3 = false,
|
||||
$include_pypy = false,
|
||||
$automatic_upgrades = false,
|
||||
$all_mysql_privs = false,
|
||||
$ssh_key = $openstack_project::jenkins_ssh_key
|
||||
) inherits openstack_project {
|
||||
class { 'openstack_project::template':
|
||||
@ -26,10 +27,11 @@ class openstack_project::single_use_slave (
|
||||
['-p tcp --dport 8000 -s 172.24.4.0/24 -j ACCEPT'],
|
||||
}
|
||||
class { 'jenkins::slave':
|
||||
ssh_key => $ssh_key,
|
||||
sudo => $sudo,
|
||||
bare => $bare,
|
||||
python3 => $python3,
|
||||
include_pypy => $include_pypy,
|
||||
ssh_key => $ssh_key,
|
||||
sudo => $sudo,
|
||||
bare => $bare,
|
||||
python3 => $python3,
|
||||
include_pypy => $include_pypy,
|
||||
all_mysql_privs => $all_mysql_privs,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user