# Class which defines a Company Foreman server
class profile::foreman {
$admin_pass = hiera('foreman.admin_password')
$foreman_url = hiera('foreman.foreman_url')
$foreman_db = hiera('foreman.db_host')
$foreman_db_password = hiera('user_cred.foreman_user.password')
$memcache_server = hiera('foreman.plugin.memcache.hosts')
$company_chain = hiera('company_chain')
$foreman_public_key_location = hiera('foreman.ssl_cert.location')
$foreman_public_key = hiera('foreman.ssl_cert.content')
$foreman_private_key_location = hiera('foreman.ssl_key.location')
$foreman_private_key = hiera('foreman.ssl_key.content')
file { 'company_chain':
path => '/etc/pki/tls/certs/companychain.crt',
ensure => 'present',
content => $company_chain,
mode => '0664'
}
file { 'public_key':
path => $foreman_public_key_location,
ensure => 'present',
content => $foreman_public_key,
mode => '0664'
}
file { 'private_key':
path => $foreman_private_key_location,
ensure => 'present',
content => $foreman_private_key,
mode => '0600'
}
class { 'foreman':
admin_username => 'admin',
admin_password => $admin_pass,
admin_first_name => 'Company',
admin_last_name => 'Automation',
db_manage => false,
db_type => 'postgresql',
email_delivery_method => 'smtp',
email_smtp_port => 25,
email_smtp_authentication => 'none',
locations_enabled => true,
organizations_enabled => true,
puppetrun => false,
foreman_url => $foreman_url,
unattended => true,
authentication => true,
passenger => true,
use_vhost => true,
serveraliases => [ $foreman_url, 'foreman' ],
ssl => true,
custom_repo => true,
repo => '1.14',
configure_epel_repo => false,
configure_scl_repo => false,
version => 'present',
plugin_version => 'present',
db_adapter => 'postgresql',
db_host => $foreman_db,
db_port => 9999,
db_database => 'foreman',
db_username => 'foreman_dbuser',
db_password => $foreman_db_password,
db_pool => 5,
db_manage_rake => true,
user_groups => [],
server_ssl_chain => '/etc/pki/tls/certs/companychain.crt',
server_ssl_cert => $foreman_public_key_location,
server_ssl_key => $foreman_private_key_location,
oauth_active => true,
oauth_map_users => false,
oauth_consumer_key => 'abababababababababababababab',
oauth_consumer_secret => 'abababababababababababababab'
}
class { 'foreman::plugin::memcache':
compress => true,
expires_in => 86400,
hosts => $memcache_server,
namespace => 'foreman'
}
}
The only thing done outside of our module was to follow the instructions.
Any help is appreciated greatly thank you.
Jason