Ask Your Question
0

Java not getting installed on puppet client from catalogue

asked 2017-06-29 16:42:47 -0500

Nanda gravatar image

updated 2017-07-28 20:35:03 -0500

ramindk gravatar image

I did write the following code in puppetmaster - /etc/puppet/manifests/site.pp file:

class { 'java' :
  package => 'java-1.8.0-openjdk-devel',
}
tomcat::install { '/opt/tomcat' :
  source_url => 'http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.0.M1/bin/apache-tomcat-9.0.0.M1.tar.gz',
}
tomcat::instance { 'default' :
  catalina_home => 'opt/tomcat',
}

On puppet agent, when I run the command "puppet agent -t", getting the following error. Also validated site.pp using puppet parser validate site.pp command and no errors.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'String'; expected ')' at /etc/puppet/modules/java/manifests/init.pp:49 on node puppetclient.demo.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Any help on resolving this issue is appreciated! Thanks

edit retag flag offensive close merge delete

Comments

please show your site.pp

c4f4t0r gravatar imagec4f4t0r ( 2017-07-03 04:17:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-07-19 01:16:24 -0500

solomon.s.b gravatar image

updated 2017-07-27 13:46:32 -0500

Quick fix Edit the file init.pp located (under Centos) here:
/etc/puppet/modules/java/manifests/init.pp
Remove all the comment in front of the variables starting at line 49 to line 55.

@@ -46,13 +46,13 @@
# Sample Usage:
#
class java(
- String $distribution = 'jdk',
- Pattern[/present|installed|latest|^[.+0-9a-zA-Z:~-]+$/] $version = 'present',
- Optional[String] $package = undef,
- Optional[Array] $package
options = undef,
- Optional[String] $javaalternative = undef,
- Optional[String] $java
alternativepath = undef,
- Optional[String] $java
home = undef
+ $distribution = 'jdk',
+ $version = 'present',
+ $package = undef,
+ $packageoptions = undef,
+ $java
alternative = undef,
+ $javaalternativepath = undef,
+ $java_home = undef
) {
include java::params

I've opened a pull request on github

EDIT:
Please don't use the above answer as a solution, as it appears that the problem is using the old Puppet 3 version with a newer module.

Quoting Hunner's answer from github:

"If you are getting syntax errors then you are probably still on puppet 3,
in which case you want the latest version of puppetlabs-java that still supports puppet 3 which is 1.6.0.
Puppet 3 reached EOL and support was dropped in the 2.0.0 release of this module."

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

Stats

Asked: 2017-06-29 16:42:47 -0500

Seen: 115 times

Last updated: Jul 28