puppet-mysql
puppet-mysql copied to clipboard
mysql::grant variable 'ensure => absent' doesn't work
If I declare to remove mysql grants something like
mysql::grant { 'testme_db1':
ensure => absent,
mysql_user => 'testme',
mysql_db => 'db1',
mysql_create_db => true,
mysql_host => '127.0.%',
mysql_privileges => 'ALL',
mysql_password => 'secret',
}
The puppet run makes nothing. Puppet version: 3.7.3 Module version: example42/puppet-mysql git-tag: v2.1.4
Uhm, strange, it should use the revoke template, as n https://github.com/example42/puppet-mysql/blob/master/manifests/grant.pp#L82 Try to place absent in single quotes :
ensure => 'absent',
I found the reason. In version 2.1.4 it is no variable $ensure in the define type declaration at top (https://github.com/example42/puppet-mysql/blob/v2.1.4/manifests/grant.pp#L35). It exists in branch master and version 2.1.3 (git tag).
It seems the version in puppet forge is newer as the repository code state.
puppet module install --modulepath=./ example42-mysql
Notice: Preparing to install into /home/example/tmp ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/home/example/tmp
└─┬ example42-mysql (v2.1.4)
├── example42-puppi (v2.1.10)
└── puppetlabs-stdlib (v4.5.1)