1
votes

I started to use puppet recently, and i'm trying to deploy a web server using gce_compute and apache-tomcat. To deploy the web server i install the modules puppetlabs-java and puppetlabs-tomcat, and to create an instance of apache-tomcat i'm using the code provided by puppet :

class { 'java': }
class { 'tomcat': }
class { 'epel': }->
tomcat::instance { 'default':
  install_from_source => false,
  package_name        => 'tomcat',
}->
tomcat::service { 'default':
  use_jsvc     => false,
  use_init     => true,
  service_name => 'tomcat',
}

But when my agent pulls the manifest i'm getting this error:

Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install tomcat' returned 100: Reading package lists...

puppet-agent[3302]: Building dependency tree...

puppet-agent[3302]: Reading state information...

puppet-agent[3302]: E: Unable to locate package tomcat

Can you help me to figure out why this happens and how i fix this error. Thanks in advance.

2

2 Answers

1
votes

That error comes from apt-get. Puppet uses a package manager available on the system it is running on. In the case of Debian, it uses apt.

If you ran apt-get install tomcat you would get the same error, because there is no package named simply tomcat. Perhaps you mean tomcat6 or tomcat7?

0
votes

Puppet uses the autoloader (https://docs.puppetlabs.com/puppet/latest/reference/lang_namespaces.html) to find that class, which it is doing correctly since it's running apt to download the package.

The best way to troubleshoot this is to run apt-get install on the version of tomcat you want. You might find you get the same output as you saw from stdout in the puppet output from your agent run. If that's the case, make sure you can reach your apt repos and you have the correct configuration in /etc/apt *.d directories.