Ask Your Question
0

Error: Failed to apply catalog: Duplicate declaration

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

kemra102 gravatar image

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

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 web.hosting.co.uk
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:

apache_vhosts:
  'customer.company.com':
    ip: "{ipaddress_eth1}"
    port: '80'
    add_listen: false
    override: ['all']
    docroot: '/var/www/html/magentocore/bigstore/'
  'customer.company.com ssl':
    servername: 'customer.company.com'
    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
2

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

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

2 followers

Stats

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

Seen: 539 times

Last updated: May 07 '15