Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
2feb6150 Ewoud Kohl van Wijngaarden
# Configure foreman
8c974670 Ohad Levy
class foreman::config {
Cron {
4dc49816 Ivan Necas
require => User[$foreman::user],
user => $foreman::user,
environment => "RAILS_ENV=${foreman::environment}",
8c974670 Ohad Levy
}

1f332b9c Mickaël Canévet
concat_build {'foreman_settings':
order => ['*.yaml'],
}

concat_fragment {'foreman_settings+01-header.yaml':
827dbbe2 Jan Vansteenkiste
content => template('foreman/settings.yaml.erb'),
1f332b9c Mickaël Canévet
}

file {'/etc/foreman/settings.yaml':
source => concat_output('foreman_settings'),
568c5c47 Dominic Cleal
require => Concat_build['foreman_settings'],
827dbbe2 Jan Vansteenkiste
notify => Class['foreman::service'],
88e4c164 Dominic Cleal
owner => 'root',
e0591c1b lfisher47
group => $foreman::group,
mode => '0640',
88e4c164 Dominic Cleal
}

file { '/etc/foreman/database.yml':
owner => 'root',
group => $foreman::group,
2feb6150 Ewoud Kohl van Wijngaarden
mode => '0640',
88e4c164 Dominic Cleal
content => template('foreman/database.yml.erb'),
notify => Class['foreman::service'],
8c974670 Ohad Levy
}

5d82bc21 Dominic Cleal
case $::operatingsystem {
Debian,Ubuntu: {
081eb96a Jan Vansteenkiste
$init_config = '/etc/default/foreman'
$init_config_tmpl = 'foreman.default'
5d82bc21 Dominic Cleal
}
default: {
081eb96a Jan Vansteenkiste
$init_config = '/etc/sysconfig/foreman'
$init_config_tmpl = 'foreman.sysconfig'
5d82bc21 Dominic Cleal
}
}
file { $init_config:
ensure => present,
content => template("foreman/${init_config_tmpl}.erb"),
require => Class['foreman::install'],
before => Class['foreman::service'],
}

4dc49816 Ivan Necas
file { $foreman::app_root:
8c974670 Ohad Levy
ensure => directory,
}

4dc49816 Ivan Necas
user { $foreman::user:
827dbbe2 Jan Vansteenkiste
ensure => 'present',
shell => '/sbin/nologin',
comment => 'Foreman',
4dc49816 Ivan Necas
home => $foreman::app_root,
df3b6ffb Greg Sutcliffe
gid => $foreman::group,
groups => $foreman::user_groups,
827dbbe2 Jan Vansteenkiste
require => Class['foreman::install'],
8c974670 Ohad Levy
}
827dbbe2 Jan Vansteenkiste
14fce641 Dominic Cleal
# remove crons previously installed here, they've moved to the package's
# cron.d file
cron { ['clear_session_table', 'expire_old_reports', 'daily summary']:
db2dc7dd Dominic Cleal
ensure => absent,
8c974670 Ohad Levy
}

2a756241 Corey Osman
if $foreman::passenger {
c62fcb8a Ewoud Kohl van Wijngaarden
include foreman::config::passenger
2a756241 Corey Osman
}

8c974670 Ohad Levy
}