Ask Your Question

Error: Failed to apply catalog: Duplicate declaration

asked 2015-05-07 07:49:48 -0600

kemra102 gravatar image

updated 2015-05-07 17:17:45 -0600

ramindk gravatar image

I am using the puppetlabs/apache module to create some vhosts on a server using Hiera to provide the actual vhost data itself. I get the following error when trying apply the catalogue:

# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for
Error: Failed to apply catalog: Duplicate declaration: File[/var/www/html/magentocore/bigstore] is already declared in file /etc/puppet/modules/apache/manifests/vhost.pp:261; cannot redeclare at /etc/puppet/modules/apache/manifests/vhost.pp:261

Here are what are probably the relevant parts from Hiera:

    ip: "{ipaddress_eth1}"
    port: '80'
    add_listen: false
    override: ['all']
    docroot: '/var/www/html/magentocore/bigstore/'
  ' ssl':
    servername: ''
    ip: "{ipaddress_eth1}"
    port: '443'
    ssl: true
    add_listen: false
    override: [all]
    docroot: '/var/www/html/magentocore/bigstore'

I can see clearly that the docroot is in there twice but according to the puppetlabs/apache documentation this is OK as per the sections entitled 'Set up a mix of SSL and non-SSL vhosts at the same domain'.

Any ideas what is going on here and how to fix?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-05-07 12:29:18 -0600

JohnsonEarls gravatar image

One of your docroot entries has a / at the end, the other doesn't. Make them consistent and it should work.

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



Asked: 2015-05-07 07:49:48 -0600

Seen: 645 times

Last updated: May 07 '15