Ask Your Question
0

Pruning databases with puppetlabs-mysql

asked 2014-03-27 09:49:09 -0500

mzandstra gravatar image

Hello,

I have a site.pp defining databases thusly:

  mysql::db { 'testdb':
    user     => 'testuser',
    password => 'testpass',
    host     => '%',
    grant    => ['ALL'],
  }

How can I ensure the database is purged when the above block is removed from the manifest? My application is managing the site.pp, and removes the mysql::db block when the corresponding application record is removed.

As a separate note, host => '%' doesn't seem to work, while host => 'a%' does.

Ubuntu 13.10x64

edit retag flag offensive close merge delete

Comments

ensure => absent for like an hour , just to be sure that the client will update the catalog and then remove doesn't work?

Renan Vicente gravatar imageRenan Vicente ( 2014-03-27 11:25:07 -0500 )edit

Yeah! That would work, but then I have to implement a soft delete system in my application. I'd rather just have the client purge anything that's not in ...(more)

mzandstra gravatar imagemzandstra ( 2014-03-27 11:56:06 -0500 )edit

Sorry, If it's exist I really don't know.

Renan Vicente gravatar imageRenan Vicente ( 2014-03-27 13:04:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-03 18:26:28 -0500

updated 2015-04-04 09:15:37 -0500

I guess.

  resources {'rm_unmanaged_mysqldb':
    name  => 'mysql::db', # (namevar)
    purge => true,
  }
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-03-27 09:49:09 -0500

Seen: 133 times

Last updated: Apr 04 '15