puppet-mysql icon indicating copy to clipboard operation
puppet-mysql copied to clipboard

mysql::grant variable 'ensure => absent' doesn't work

Open bionix opened this issue 10 years ago • 3 comments

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

bionix avatar Jan 20 '15 12:01 bionix

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',

alvagante avatar Jan 21 '15 14:01 alvagante

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).

bionix avatar Jan 21 '15 15:01 bionix

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)

bionix avatar Jan 21 '15 15:01 bionix