Skip to content

Commit

Permalink
allow puma/systemd deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 4, 2023
1 parent 72fe5f6 commit 451ebfd
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
2 changes: 1 addition & 1 deletion puppet/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod 'puppet/pbuilder', '1.0.0'
mod 'puppet/redis', '8.8.0'
mod 'puppet/rvm', '2.0.0'
mod 'puppet/selinux', '3.4.1'
mod 'puppet/systemd', '4.2.0'
mod 'puppet/systemd', '5.2.0'
mod 'puppet/unattended_upgrades', '7.1.0'
mod 'puppetlabs/apache', '8.6.0'
mod 'puppetlabs/apt', '9.0.2'
Expand Down
58 changes: 54 additions & 4 deletions puppet/modules/redmine/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
String $db_name = 'redmine',
String $db_password = extlib::cache_data('foreman_cache_data', 'db_password', extlib::random_password(32)),
Boolean $https = false,
String $deployment = 'passenger',
) {
# PostgreSQL tuning
$postgresql_settings = {
Expand Down Expand Up @@ -161,10 +162,59 @@
$docroot = "${app_root}/public"
$priority = '05'

$apache_backend_config = {
passenger_app_root => $app_root,
passenger_min_instances => 1,
passenger_start_timeout => 600,
if $deployment == 'passenger' {
$apache_backend_config = {
passenger_app_root => $app_root,
passenger_min_instances => 1,
passenger_start_timeout => 600,
}
} else {
systemd::manage_unit {'redmine.socket':
ensure => 'present',
unit_entry => {
'Description' => 'redmine socket',
},
socket_entry => {
'ListenStream' => 3000,
},
install_entry => {
'WantedBy' => 'sockets.target',
},
}

systemd::manage_unit{'redmine.service':
ensure => 'present',
enable => true,
active => true,
unit_entry => {
'Description' => 'redmine',
},
service_entry => {
'Type' => 'notify',
'User' => $username,
#'PrivateTmp' => true,
'WorkingDirectory' => $app_root,
'ExecStart' => "${app_root}/bin/rails server --environment production",
},
}

$apache_backend_config = {
'proxy_preserve_host' => true,
'proxy_add_headers' => true,
'request_headers' => ['set X_FORWARDED_PROTO "https"'],
'proxy_pass' => {
'no_proxy_uris' => ['/icons', '/server-status', '/assets', '/help', '/images', '/javascripts', '/plugin_assets', '/stylesheets', '/themes', '/favicon.ico'],
'path' => '/',
'url' => 'http://127.0.0.1:3000',
},
}

if $facts['os']['selinux']['enabled'] {
selboolean { 'httpd_can_network_connect':
persistent => true,
value => 'on',
}
}
}

apache::vhost { $servername:
Expand Down

0 comments on commit 451ebfd

Please sign in to comment.