fuel-library/deployment/puppet/osnailyfacter/manifests/mysql_grant.pp
Oleksiy Molchanov 91d2429d59 Allow root mysql within environment
* Allow connections to mysql as root only
  from IP-addresses within environment
* Updated direct_networks function
* Provided and updated noop tests

Closes-Bug: 1471956
Change-Id: Ia873292d6b05f612642e055d1d0dc156a863bc34
2015-07-24 06:18:48 +00:00

18 lines
470 B
Puppet

# == Class definition osnailyfacter::mysql_grant
#
# Class for mysql grant permissions
#
# [*user*]
# Mysql username
#
# [*network*]
# Array of specific IPs or Networks or Hostnames
# to access the database with user
#
define osnailyfacter::mysql_grant ( $user = '',
$network = $name ) {
exec { "mysql_${user}_${network}":
command => "mysql -NBe \"grant all on *.* to \'${user}\'@\'${network}\' with grant option\"",
}
}