Showing with 212 additions and 117 deletions.
  1. +1 −1 .gitlab-ci.yml
  2. +1 −0 .rubocop.yml
  3. +3 −0 .sync.yml
  4. +1 −0 .travis.yml
  5. +14 −0 CHANGELOG.md
  6. +2 −0 README.md
  7. +11 −2 REFERENCE.md
  8. +1 −0 appveyor.yml
  9. +7 −7 manifests/dropin_file.pp
  10. +6 −2 manifests/init.pp
  11. +4 −5 manifests/journald.pp
  12. +14 −5 manifests/logind.pp
  13. +1 −2 manifests/network.pp
  14. +2 −3 manifests/networkd.pp
  15. +10 −12 manifests/resolved.pp
  16. +1 −2 manifests/service_limits.pp
  17. +1 −2 manifests/system.pp
  18. +2 −2 manifests/timer.pp
  19. +4 −5 manifests/timesyncd.pp
  20. +1 −1 manifests/tmpfile.pp
  21. +0 −1 manifests/tmpfiles.pp
  22. +1 −1 manifests/unit_file.pp
  23. +1 −1 metadata.json
  24. +2 −1 spec/acceptance/nodesets/centos-5-x86_64-docker.yml
  25. +2 −1 spec/acceptance/nodesets/centos-5.yml
  26. +2 −1 spec/acceptance/nodesets/centos-6-x86_64-docker.yml
  27. +2 −1 spec/acceptance/nodesets/centos-6-x86_64-openstack.yml
  28. +3 −2 spec/acceptance/nodesets/centos-6-x86_64-vagrant.yml
  29. +2 −1 spec/acceptance/nodesets/centos-6.yml
  30. +2 −1 spec/acceptance/nodesets/centos-7-x86_64-docker.yml
  31. +2 −1 spec/acceptance/nodesets/centos-7-x86_64-openstack.yml
  32. +3 −2 spec/acceptance/nodesets/centos-7-x86_64-vagrant.yml
  33. +2 −1 spec/acceptance/nodesets/centos-7.yml
  34. +2 −1 spec/acceptance/nodesets/debian-6-x86_64-docker.yml
  35. +2 −1 spec/acceptance/nodesets/debian-6-x86_64-openstack.yml
  36. +3 −2 spec/acceptance/nodesets/debian-6-x86_64-vagrant.yml
  37. +2 −1 spec/acceptance/nodesets/debian-6.yml
  38. +2 −1 spec/acceptance/nodesets/debian-7-x86_64-docker.yml
  39. +2 −1 spec/acceptance/nodesets/debian-7-x86_64-openstack.yml
  40. +3 −2 spec/acceptance/nodesets/debian-7-x86_64-vagrant.yml
  41. +2 −1 spec/acceptance/nodesets/debian-7.yml
  42. +2 −1 spec/acceptance/nodesets/debian-8-x86_64-docker.yml
  43. +2 −1 spec/acceptance/nodesets/debian-8-x86_64-openstack.yml
  44. +3 −2 spec/acceptance/nodesets/debian-8-x86_64-vagrant.yml
  45. +2 −1 spec/acceptance/nodesets/debian-8.yml
  46. +2 −1 spec/acceptance/nodesets/opensuse-15.1.yml
  47. +2 −1 spec/acceptance/nodesets/opensuse-15.2.yml
  48. +2 −1 spec/acceptance/nodesets/opensuse-15.yml
  49. +4 −2 spec/acceptance/nodesets/ubuntu-10.04-x86_64-docker.yml
  50. +2 −1 spec/acceptance/nodesets/ubuntu-12.04-x86_64-docker.yml
  51. +2 −1 spec/acceptance/nodesets/ubuntu-12.04-x86_64-openstack.yml
  52. +2 −1 spec/acceptance/nodesets/ubuntu-12.04.yml
  53. +2 −1 spec/acceptance/nodesets/ubuntu-14.04-x86_64-docker.yml
  54. +2 −1 spec/acceptance/nodesets/ubuntu-14.04-x86_64-openstack.yml
  55. +3 −2 spec/acceptance/nodesets/ubuntu-14.04-x86_64-vagrant.yml
  56. +2 −1 spec/acceptance/nodesets/ubuntu-14.04.yml
  57. +2 −1 spec/acceptance/nodesets/ubuntu-14.10-x86_64-docker.yml
  58. +2 −1 spec/acceptance/nodesets/ubuntu-14.10-x86_64-openstack.yml
  59. +2 −1 spec/acceptance/nodesets/ubuntu-14.10.yml
  60. +2 −1 spec/acceptance/nodesets/ubuntu-15.04-x86_64-docker.yml
  61. +2 −1 spec/acceptance/nodesets/ubuntu-15.04-x86_64-openstack.yml
  62. +2 −1 spec/acceptance/nodesets/ubuntu-15.04.yml
  63. +2 −1 spec/acceptance/nodesets/ubuntu-15.10.yml
  64. +2 −1 spec/acceptance/nodesets/ubuntu-16.04.yml
  65. +14 −1 spec/classes/init_spec.rb
  66. +1 −1 spec/defines/dropin_file_spec.rb
  67. +4 −0 spec/spec_helper.rb
  68. +0 −2 spec/spec_helper_local.rb
  69. +3 −3 spec/unit/facter/systemd_spec.rb
  70. +4 −5 spec/unit/facter/systemd_version_spec.rb
  71. +2 −0 types/journaldsettings.pp
  72. +1 −1 types/journaldsettings/ensure.pp
  73. +2 −0 types/logindsettings.pp
  74. +1 −1 types/logindsettings/ensure.pp
  75. +1 −1 types/servicelimits.pp
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# yamllint disable rule:line-length rule:truthy
stages:
- syntax
- unit
Expand Down Expand Up @@ -41,4 +42,3 @@ parallel_spec-Ruby 2.4.5-Puppet ~> 5:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 5'

1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# yamllint disable rule:line-length rule:indentation
require:
- rubocop-rspec
- rubocop-i18n
Expand Down
3 changes: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# yamllint disable rule:line-length
.travis.yml:
user: camptocamp
secure: "ASTRdmLjJNa1NvHy2LRGvmvUeth6W3Fh/alYWvcvI8nDDsdkweHk0iXhcXZwtMQReb0NI5vJiRNXNy7a3XySC4+SP3hfHuDU58H2FqC4Ff0EHRPRHTEiXf7xmN53RxXYXZQvrFfqUb6tIsBNVKVmsYWNe01k8NVKPyYDfQB75PQ="
Expand All @@ -14,3 +15,5 @@ Gemfile:
- gem: 'github_changelog_generator'
Rakefile:
changelog_version_tag_pattern: '%s'
spec/spec_helper.rb:
mock_with: :rspec
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# yamllint disable rule:line-length rule:truthy
os: linux
dist: xenial
language: ruby
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [2.11.0](https://github.com/camptocamp/puppet-systemd/tree/2.11.0) (2021-01-19)

[Full Changelog](https://github.com/camptocamp/puppet-systemd/compare/2.10.0...2.11.0)

### Added

- Permit using arrays to make extending lists easier [\#164](https://github.com/camptocamp/puppet-systemd/pull/164) ([jcpunk](https://github.com/jcpunk))
- Add parameter for ENCs to make loginctl\_users easily [\#163](https://github.com/camptocamp/puppet-systemd/pull/163) ([jcpunk](https://github.com/jcpunk))
- Add ability to specify supported option 'infinity' for LimitNPROC [\#152](https://github.com/camptocamp/puppet-systemd/pull/152) ([hdeheer](https://github.com/hdeheer))

### Fixed

- Fix tests with rspec-puppet 2.8.0 [\#174](https://github.com/camptocamp/puppet-systemd/pull/174) ([raphink](https://github.com/raphink))

## [2.10.0](https://github.com/camptocamp/puppet-systemd/tree/2.10.0) (2020-08-21)

[Full Changelog](https://github.com/camptocamp/puppet-systemd/compare/2.9.0...2.10.0)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,5 @@ loginctl_user { 'foo':
linger => enabled,
}
```

or as a hash via the `systemd::loginctl_users` parameter.
13 changes: 11 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ Data type: `Systemd::LogindSettings`

Config Hash that is used to configure settings in logind.conf

##### `loginctl_users`

Data type: `Hash`

Config Hash that is used to generate instances of our type
`loginctl_user`.

Default value: `{}`

##### `dropin_files`

Data type: `Hash`
Expand Down Expand Up @@ -912,7 +921,7 @@ Alias of `Struct[{

The Systemd::JournaldSettings::Ensure data type.

Alias of `Struct[{'ensure' => Enum['present','absent']}]`
Alias of `Struct[{ 'ensure' => Enum['present','absent'] }]`

### `Systemd::LogindSettings`

Expand Down Expand Up @@ -949,7 +958,7 @@ Alias of `Struct[{

The Systemd::LogindSettings::Ensure data type.

Alias of `Struct[{'ensure' => Enum['present','absent']}]`
Alias of `Struct[{ 'ensure' => Enum['present','absent'] }]`

### `Systemd::ServiceLimits`

Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# yamllint disable rule:line-length rule:truthy
version: 1.1.x.{build}
branches:
only:
Expand Down
14 changes: 7 additions & 7 deletions manifests/dropin_file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# Useful if the daemon needs to be reloaded before a service is refreshed.
# May cause multiple daemon reloads.
#
define systemd::dropin_file(
define systemd::dropin_file (
Systemd::Unit $unit,
Systemd::Dropin $filename = $name,
Enum['present', 'absent', 'file'] $ensure = 'present',
Expand Down Expand Up @@ -75,12 +75,12 @@

if $ensure != 'absent' {
ensure_resource('file', "${path}/${unit}.d", {
ensure => directory,
owner => 'root',
group => 'root',
recurse => $::systemd::purge_dropin_dirs,
purge => $::systemd::purge_dropin_dirs,
selinux_ignore_defaults => $selinux_ignore_defaults,
ensure => directory,
owner => 'root',
group => 'root',
recurse => $systemd::purge_dropin_dirs,
purge => $systemd::purge_dropin_dirs,
selinux_ignore_defaults => $selinux_ignore_defaults,
})
}

Expand Down
8 changes: 6 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
# @param logind_settings
# Config Hash that is used to configure settings in logind.conf
#
# @param loginctl_users
# Config Hash that is used to generate instances of our type
# `loginctl_user`.
#
# @param dropin_files
# Configure dropin files via hiera with factory pattern
class systemd (
Expand Down Expand Up @@ -110,9 +114,9 @@
Systemd::JournaldSettings $journald_settings,
Boolean $manage_logind,
Systemd::LogindSettings $logind_settings,
Hash $loginctl_users = {},
Hash $dropin_files = {},
){

) {
contain systemd::systemctl::daemon_reload

create_resources('systemd::service_limits', $service_limits)
Expand Down
9 changes: 4 additions & 5 deletions manifests/journald.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@
#
# https://www.freedesktop.org/software/systemd/man/journald.conf.html
class systemd::journald {

assert_private()

service{'systemd-journald':
service { 'systemd-journald':
ensure => running,
}
$systemd::journald_settings.each |$option, $value| {
ini_setting{
ini_setting {
$option:
path => '/etc/systemd/journald.conf',
section => 'Journal',
setting => $option,
notify => Service['systemd-journald'],
}
if $value =~ Hash {
Ini_setting[$option]{
Ini_setting[$option] {
* => $value,
}
} else {
Ini_setting[$option]{
Ini_setting[$option] {
value => $value,
}
}
Expand Down
19 changes: 14 additions & 5 deletions manifests/logind.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,37 @@
#
# https://www.freedesktop.org/software/systemd/man/logind.conf.html
class systemd::logind {

assert_private()

service{'systemd-logind':
service { 'systemd-logind':
ensure => running,
}
$systemd::logind_settings.each |$option, $value| {
ini_setting{
ini_setting {
$option:
path => '/etc/systemd/logind.conf',
section => 'Login',
setting => $option,
notify => Service['systemd-logind'],
}
if $value =~ Hash {
Ini_setting[$option]{
Ini_setting[$option] {
* => $value,
}
} elsif $value =~ Array {
Ini_setting[$option] {
value => join($value, ' '),
}
} else {
Ini_setting[$option]{
Ini_setting[$option] {
value => $value,
}
}
}

$systemd::loginctl_users.each |$loginctl_name, $loginctl_settings| {
loginctl_user { $loginctl_name:
* => $loginctl_settings,
}
}
}
3 changes: 1 addition & 2 deletions manifests/network.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
String $mode = '0444',
Boolean $show_diff = true,
Boolean $restart_service = true,
){

) {
include systemd

if $restart_service and $systemd::manage_networkd {
Expand Down
5 changes: 2 additions & 3 deletions manifests/networkd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
#
class systemd::networkd (
Enum['stopped','running'] $ensure = $systemd::networkd_ensure,
){

) {
assert_private()

$_enable_networkd = $ensure ? {
Expand All @@ -17,7 +16,7 @@
default => $ensure,
}

service{ 'systemd-networkd':
service { 'systemd-networkd':
ensure => $ensure,
enable => $_enable_networkd,
}
Expand Down
22 changes: 10 additions & 12 deletions manifests/resolved.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
Optional[Variant[Boolean,Enum['no-negative']]] $cache = $systemd::cache,
Optional[Variant[Boolean,Enum['udp', 'tcp']]] $dns_stub_listener = $systemd::dns_stub_listener,
Boolean $use_stub_resolver = $systemd::use_stub_resolver,
){

) {
assert_private()

$_enable_resolved = $ensure ? {
Expand Down Expand Up @@ -87,7 +86,7 @@
} else {
$_dns = join($dns, ' ')
}
ini_setting{ 'dns':
ini_setting { 'dns':
ensure => 'present',
value => $_dns,
setting => 'DNS',
Expand All @@ -103,7 +102,7 @@
} else {
$_fallback_dns = join($fallback_dns, ' ')
}
ini_setting{ 'fallback_dns':
ini_setting { 'fallback_dns':
ensure => 'present',
value => $_fallback_dns,
setting => 'FallbackDNS',
Expand All @@ -119,7 +118,7 @@
} else {
$_domains = join($domains, ' ')
}
ini_setting{ 'domains':
ini_setting { 'domains':
ensure => 'present',
value => $_domains,
setting => 'Domains',
Expand All @@ -136,7 +135,7 @@
}

if $_llmnr {
ini_setting{ 'llmnr':
ini_setting { 'llmnr':
ensure => 'present',
value => $_llmnr,
setting => 'LLMNR',
Expand All @@ -153,7 +152,7 @@
}

if $_multicast_dns {
ini_setting{ 'multicast_dns':
ini_setting { 'multicast_dns':
ensure => 'present',
value => $_multicast_dns,
setting => 'MulticastDNS',
Expand All @@ -170,7 +169,7 @@
}

if $_dnssec {
ini_setting{ 'dnssec':
ini_setting { 'dnssec':
ensure => 'present',
value => $_dnssec,
setting => 'DNSSEC',
Expand All @@ -187,7 +186,7 @@
}

if $_dnsovertls {
ini_setting{ 'dnsovertls':
ini_setting { 'dnsovertls':
ensure => 'present',
value => $_dnsovertls,
setting => 'DNSOverTLS',
Expand All @@ -204,7 +203,7 @@
}

if $cache {
ini_setting{ 'cache':
ini_setting { 'cache':
ensure => 'present',
value => $_cache,
setting => 'Cache',
Expand All @@ -221,7 +220,7 @@
}

if $_dns_stub_listener {
ini_setting{ 'dns_stub_listener':
ini_setting { 'dns_stub_listener':
ensure => 'present',
value => $_dns_stub_listener,
setting => 'DNSStubListener',
Expand All @@ -230,5 +229,4 @@
notify => Service['systemd-resolved'],
}
}

}
3 changes: 1 addition & 2 deletions manifests/service_limits.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
# @param restart_service
# Restart the managed service after setting the limits
#
define systemd::service_limits(
define systemd::service_limits (
Enum['present', 'absent', 'file'] $ensure = 'present',
Stdlib::Absolutepath $path = '/etc/systemd/system',
Optional[Boolean] $selinux_ignore_defaults = false,
Optional[Systemd::ServiceLimits] $limits = undef,
Optional[String] $source = undef,
Boolean $restart_service = true
) {

include systemd

if $name !~ Pattern['^.+\.(service|socket|mount|swap)$'] {
Expand Down
3 changes: 1 addition & 2 deletions manifests/system.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
# This class provides a solution to enable accounting
#
class systemd::system {

assert_private()

$systemd::accounting.each |$option, $value| {
ini_setting{$option:
ini_setting { $option:
ensure => 'present',
path => '/etc/systemd/system.conf',
section => 'Manager',
Expand Down
Loading