Skip to content

Commit

Permalink
Move ulimit management into the instance define
Browse files Browse the repository at this point in the history
This allows any service where the ulimit isn't in the service file to be
managed via a drop in.
  • Loading branch information
ekohl committed Apr 19, 2021
1 parent febaf13 commit 0f930aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 9 additions & 0 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@
mode => '0644',
content => template('redis/service_templates/redis.service.erb'),
}
} else {
if $ulimit_managed {
systemd::service_limits { "${service_name}.service":
limits => {
'LimitNOFILE' => $ulimit,
},
restart_service => false,
}
}
}

$_real_log_file = $log_file ? {
Expand Down
8 changes: 1 addition & 7 deletions manifests/ulimit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@
}
}

systemd::service_limits { "${redis::service_name}.service":
limits => {
'LimitNOFILE' => $redis::ulimit,
},
restart_service => false,
}

# Migrate from the old managed service
file { "/etc/systemd/system/${redis::service_name}.service.d/limit.conf":
ensure => absent,
}
Expand Down

0 comments on commit 0f930aa

Please sign in to comment.