Installing glassfish with puppet

There are two major problems with installing glassfish through puppet in default configuration of puppetmaster:

* The jar file of glassfish is too big
* You have to accept sun lisense during the installation

The cause of first problem is that by default puppetmasterd uses WEBRICK as it web-server. It would be probably not a problem if it was not using at the same time xmlrpc calls. The consequence of such configuration is that big files timeouts to be transfered. The workaround I found to solve this is to use apache (or any other webserver) to serve files, and, instead of using File default definition, use Exec that executes curl, that fetches file from puppet server.

Second problem is also well-known from installation of sun JDK, so I just extend this solution, that people can find by googling “puppet install java”: the main idea is to provide answers to the accept license questions. The code for acceptance looks approx like below: