Skip to content

Commit

Permalink
Merge pull request #358 from traylenator/SupplementaryGroups
Browse files Browse the repository at this point in the history
Allow SupplementaryGroups and DynamicUser
  • Loading branch information
traylenator authored Jul 3, 2023
2 parents 4b01a51 + 1d59b15 commit 85f8845
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,8 @@ Struct[{
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
Optional['User'] => String[1],
Optional['Group'] => String[1],
Optional['DynamicUser'] => Boolean,
Optional['SupplementaryGroups'] => Variant[String[0],Array[String[0],1]],
Optional['WorkingDirectory'] => String[0],
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
Optional['ExitType'] => Enum['main', 'cgroup'],
Expand Down
11 changes: 11 additions & 0 deletions spec/type_aliases/systemd_unit_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
it { is_expected.to allow_value({ 'StandardOutput' => 'null' }) }
it { is_expected.to allow_value({ 'StandardError' => 'null' }) }

it { is_expected.to allow_value({ 'DynamicUser' => false }) }
it { is_expected.to allow_value({ 'DynamicUser' => true }) }
it { is_expected.not_to allow_value({ 'DynamicUser' => 'maybe' }) }

it { is_expected.to allow_value({ 'SupplementaryGroups' => 'one' }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => %w[one two] }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => '' }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => [''] }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => ['', 'reset'] }) }
it { is_expected.not_to allow_value({ 'SupplementaryGroups' => [] }) }

it { is_expected.to allow_value({ 'WorkingDirectory' => '/var/lib/here' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '-/var/lib/here' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '~' }) }
Expand Down
2 changes: 2 additions & 0 deletions types/unit/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
Optional['User'] => String[1],
Optional['Group'] => String[1],
Optional['DynamicUser'] => Boolean,
Optional['SupplementaryGroups'] => Variant[String[0],Array[String[0],1]],
Optional['WorkingDirectory'] => String[0],
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
Optional['ExitType'] => Enum['main', 'cgroup'],
Expand Down

0 comments on commit 85f8845

Please sign in to comment.