Ask Your Question

puppetlabs-tomcat staging issue

asked 2016-06-12 11:03:55 -0600

xaz gravatar image

updated 2016-06-16 04:13:16 -0600

My working environment needs to deploy latest tomcat along with latest java version. I am trying to use puppetlabs-tomcat to accomplish them. However, I ran into an issue. puppetlabs-tomcat depends on nanliu-staging module. When I ran a test modules coming from staging module, I got the below error:

# puppet apply --test --debug /home/xinhuan/puppet/staging/tests/file.pp
Error: Cannot alias File[/tmp/staging/] to ["/tmp/staging"] at /home/xinhuan/puppet/staging/manifests/file.pp:39; resource ["File", "/tmp/staging"] already declared at /home/xinhuan/puppet/staging/manifests/init.pp:23

Here is my environment:

  • CentOS 6.7
  • puppet-agent-1.5.0-1.el6.x86_64
  • nanliu-staging: 1.0.3
  • puppetlabs-tomcat: 1.5.0
  • puppet: 4.5.0
  • facter: 3.2.0
  • hiera: 3.2.0
  • ruby: ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]

If staging module does not work, how come puppetlabs-tomcat module work? Do I need to subclass staging module to work around the duplicate resource declaration?


edit retag flag offensive close merge delete


You'll need to update the post showing the actual code you wrote.

Alex Harvey gravatar imageAlex Harvey ( 2016-06-16 04:13:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-16 12:33:17 -0600

xaz gravatar image

The file.pp is from the staging/tests/file.pp. I posted the content here:

$callermodulename = 'demo'

class { 'staging': path => '/tmp/staging', }

staging::file { 'sample': source => 'puppet:///modules/staging/sample', }

staging::file { 'passwd': source => '/etc/passwd', }

staging::file { 'manpage.html': source => '', }

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

1 follower


Asked: 2016-06-12 11:03:55 -0600

Seen: 87 times

Last updated: Jun 16 '16