Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do the right thing when fqdn==localhost #637

Merged
merged 1 commit into from Jan 22, 2015

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Jan 10, 2015

Make sure not to declare root@localhost and @localhost if the fqdn is 'localhost'

Error: Duplicate declaration: Mysql_user[root@localhost] is already declared in file /etc/puppet/modules/mysql/manifests/server/root_password.pp:11; cannot redeclare at /etc/puppet/modules/mysql/manifests/server/account_security.pp:11 on node localhost
Error: Duplicate declaration: Mysql_user[root@localhost] is already declared in file /etc/puppet/modules/mysql/manifests/server/root_password.pp:11; cannot redeclare at /etc/puppet/modules/mysql/manifests/server/account_security.pp:11 on node localhost

Also remove root@localhost.localdomain and @localhost.localdomain in that case

'@%']:
ensure => 'absent',
require => Anchor['mysql::server::end'],
}
if ($::fqdn != 'localhost') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if fqdn is localhost.localdomain? It would create duplicates in that case.

@hunner
Copy link
Contributor

hunner commented Jan 15, 2015

Could you squash this, update as per comments, and add rspec-puppet tests for the cases of fqdn being localhost, localhost.localdomain, and neither? Thanks!

This is because the root@localhost account is already
defined.

Remove localdomain accounts if fqdn is localhost
@dveeden
Copy link
Contributor Author

dveeden commented Jan 18, 2015

I've added some tests. Please check them as I'm not too familiar with rspec.

tphoney added a commit that referenced this pull request Jan 22, 2015
Do the right thing when fqdn==localhost
@tphoney tphoney merged commit 1a87bae into puppetlabs:master Jan 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants