openstack tests/site.pp fails to apply - Error: Duplicate declaration: Database_user[@localhost] is already declared
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
puppet-openstack |
New
|
Undecided
|
Unassigned |
Bug Description
I'm following the instructions on https:/
$ yum -y install puppet
$ puppet module install puppetlabs/keystone
$ puppet module install puppetlabs/
# apply the fix from https:/
$ puppet apply /etc/puppet/
The error I get is as follows:
Error: Duplicate declaration: Database_
Error: Duplicate declaration: Database_
The module version that I have installed:
[root@localhost ~]# puppet module list
/etc/puppet/modules
├── dprince-qpid (v1.0.2)
├── duritong-sysctl (v0.0.2)
├── puppetlabs-apache (v0.10.0)
├── puppetlabs-apt (v1.4.0)
├── puppetlabs-
├── puppetlabs-cinder (v3.0.0)
├── puppetlabs-concat (v1.1.0-rc1)
├── puppetlabs-glance (v3.0.0)
├── puppetlabs-heat (v3.0.0-rc2)
├── puppetlabs-horizon (v3.0.0-rc3)
├── puppetlabs-inifile (v1.0.0)
├── puppetlabs-keystone (v3.0.0-rc3)
├── puppetlabs-mysql (v0.9.0)
├── puppetlabs-neutron (v3.0.0)
├── puppetlabs-nova (v3.0.0)
├── puppetlabs-
├── puppetlabs-rabbitmq (v2.1.0)
├── puppetlabs-rsync (v0.1.0)
├── puppetlabs-stdlib (v4.1.0)
├── puppetlabs-swift (v3.0.0-rc3)
├── puppetlabs-vswitch (v0.2.0)
├── puppetlabs-xinetd (v1.2.0)
├── saz-memcached (v2.2.4)
└── saz-ssh (v1.2.0)
/usr/share/
Here's the problem:
The problem isn't in openstack. It's on puppetlabs-mysql.
my machine fqdn is localhost. localdomain and hostname is localhost
In puppetlabs-mysql you have the following code in account_ security. pp:
database_user { [ "root@${::fqdn}", 'root@127.0.0.1', 'root@::1',
" @${::fqdn} ", '@localhost', '@%' ]: mysql:: config' ], ${::hostname} ", "@${::hostname}"]: mysql:: config' ],
ensure => 'absent',
require => Class['
}
if ($::fqdn != $::hostname) {
database_user { ["root@
ensure => 'absent',
require => Class['
}
}
So, in database_user { ...} he's adding @localhost, and in the if, he's adding @${::hostname} which is also localhost.
Possible solutions:
1: change install_modules.sh to switch back to 0.5.0 version (by the way, latest version is 2.1!!!
2: change your hostname to something else than localhost
3: alter the if ($::fqdn != $::hostname) to something like if ($::fqdn != $::hostname && $::hostname != 'localhost')