Puppet Class: jira::facts
- Inherits:
- jira::params
- Defined in:
- manifests/facts.pp
Overview
Class: jira::facts
Class to add some facts for JIRA. They have been added as an external fact because we do not want to distrubute these facts to all systems.
Parameters
- port
-
port that jira listens on.
- uri
-
ip that jira is listening on, defaults to localhost.
Examples
class { ‘jira::facts’: }
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'manifests/facts.pp', line 17
class jira::facts (
$ensure = 'present',
$port = $jira::tomcat_port,
$contextpath = $jira::contextpath,
$json_packages = $jira::params::json_packages,
# lint:ignore:parameter_order
$uri = $jira::tomcat_address ? {
undef => '127.0.0.1',
default => $jira::tomcat_address,
},
# lint:endignore
) inherits jira::params {
# Puppet Enterprise supplies its own ruby version if your using it.
# A modern ruby version is required to run the executable fact
if $facts['puppetversion'] =~ /Puppet Enterprise/ {
$ruby_bin = '/opt/puppet/bin/ruby'
$dir = 'puppetlabs/'
} else {
$ruby_bin = '/usr/bin/env ruby'
$dir = ''
}
if !defined(File["/etc/${dir}facter"]) {
file { "/etc/${dir}facter":
ensure => directory,
}
}
if !defined(File["/etc/${dir}facter/facts.d"]) {
file { "/etc/${dir}facter/facts.d":
ensure => directory,
}
}
if $facts['osfamily'] == 'RedHat' and $facts['puppetversion'] !~ /Puppet Enterprise/ {
ensure_packages ($json_packages, { ensure => present })
}
file { "/etc/${dir}facter/facts.d/jira_facts.rb":
ensure => $ensure,
content => template('jira/facts.rb.erb'),
mode => '0500',
}
}
|