openstack tests/site.pp fails to apply - Error: Duplicate declaration: Database_user[@localhost] is already declared

Bug #1269988 reported by snowch
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
puppet-openstack
New
Undecided
Unassigned

Bug Description

I'm following the instructions on https://forge.puppetlabs.com/puppetlabs/openstack

$ yum -y install puppet

$ puppet module install puppetlabs/keystone
$ puppet module install puppetlabs/openstack

# apply the fix from https://bugs.launchpad.net/puppet-openstack/+bug/1263292

$ puppet apply /etc/puppet/modules/openstack/tests/site.pp --certname openstack_all

The error I get is as follows:

Error: Duplicate declaration: Database_user[@localhost] is already declared in file /etc/puppet/modules/mysql/manifests/server/account_security.pp at line 13; cannot redeclare on node openstack_all
Error: Duplicate declaration: Database_user[@localhost] is already declared in file /etc/puppet/modules/mysql/manifests/server/account_security.pp at line 13; cannot redeclare on node openstack_all

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-ceilometer (v3.0.0-rc2)
├── 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-openstack (v3.0.0)
├── 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/puppet/modules (no modules installed)

snowch (snowch)
description: updated
Revision history for this message
Arx Cruz (arxcruz) wrote :

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', '@%' ]:
    ensure => 'absent',
    require => Class['mysql::config'],
  }
  if ($::fqdn != $::hostname) {
    database_user { ["root@${::hostname}", "@${::hostname}"]:
      ensure => 'absent',
      require => Class['mysql::config'],
    }
  }

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.