简体   繁体   中英

Puppet: unable to locate package tomcat

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.

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM