Skip to content

Instantly share code, notes, and snippets.

@larstobi
Created November 22, 2012 12:25
Show Gist options
  • Select an option

  • Save larstobi/4130912 to your computer and use it in GitHub Desktop.

Select an option

Save larstobi/4130912 to your computer and use it in GitHub Desktop.
class jboss (
$java_opts = hiera('jboss_java_opts', ''),
$db_connection_url = hiera('db_connection_url'),
) {
file {
'/etc/jboss/jboss.conf':
ensure => present,
content => template('jboss/jboss.conf.erb');
'/opt/jbossas/standalone/configuration/standalone.xml':
ensure => present,
content => template('jboss/standalone.xml.erb');
}
}
class jboss (
$java_opts = hiera('jboss_java_opts', ''),
$db_connection_url = hiera('db_connection_url'),
) {
class {
'jboss::config':
db_connection_url => $db_connection_url,
java_opts => $java_opts;
}
}
JAVA_OPTS="<%= java_opts %>"
<connection-url><%= db_connection_url %></connection-url>
---
app_host: '10.0.2.15'
jboss_java_opts: "-Djboss.bind.address=%{app_host}"
db_host: '10.0.2.16'
db_connection_url: "jdbc:postgresql://%{db_host}:5432/mydb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment