Open ghost opened 9 years ago
I am wondering if it would be better to use the 'title' instead of dbname here;
https://github.com/example42/puppet-mysql/blob/master/manifests/grant.pp#L77
I am trying todo something like this:
if exists($backup_file_guard_with_fqdn) {
mysql::query { $supported_ejbca_dbname:
mysql_query => "DROP DATABASE IF EXISTS ${supported_ejbca_dbname};",
mysql_user => $supported_ejbca_username,
mysql_password => $supported_ejbca_password,
require => Class['mysql'],
before => Service['jboss']
} ->
mysql::grant { "revoke-${supported_ejbca_dbname}":
ensure => 'absent',
mysql_db => $supported_ejbca_dbname,
mysql_user => $supported_ejbca_username,
mysql_password => $supported_ejbca_password,
require => Class['mysql'],
before => Service['jboss']
} ->
mysql::grant { "create-${supported_ejbca_dbname}":
ensure => 'present',
mysql_db => $supported_ejbca_dbname,
mysql_user => $supported_ejbca_username,
mysql_password => $supported_ejbca_password,
mysql_db_init_query_file => $backup_file_name_with_fqdn,
require => Class['mysql'],
before => Service['jboss']
}
} else {
mysql::grant { "create-${supported_ejbca_dbname}":
ensure => 'present',
mysql_db => $supported_ejbca_dbname,
mysql_user => $supported_ejbca_username,
mysql_password => $supported_ejbca_password,
require => Class['mysql'],
before => Service['jboss']
}
}
Hi,
I am trying to run the same puppet apply on the same instance and gets this issue second time round, could this resource not be more unique?