Skip to content

Commit

Permalink
update pdk + pdk templates
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeier committed Oct 17, 2022
1 parent 7b5c464 commit 83110a0
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require:
- rubocop-rspec
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.4'
TargetRubyVersion: '2.5'
Include:
- "**/*.rb"
Exclude:
Expand Down
39 changes: 0 additions & 39 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ Gemfile:
- gem: 'github_changelog_generator'
version: '~> 1.15'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
- gem: 'puppet-lint-file_ensure-check'
require: false
- gem: 'puppet-lint-manifest_whitespace-check'
require: false
- gem: 'puppet-lint-trailing_comma-check'
require: false
- gem: 'puppet-lint-optional_default-check'
require: false
':test':
- gem: 'puppet_metadata'
version: '~> 1.0'
Expand All @@ -47,34 +39,3 @@ spec/spec_helper.rb:
- 'RSpec.configure do |c|'
- ' c.facter_implementation = :rspec'
- 'end'
.puppet-lint.rc:
enabled_lint_checks:
- 140chars
- 2sp_soft_tabs
- arrow_alignment
- class_inherits_from_params_class
- double_quoted_strings
- duplicate_params
- file_ensure
- file_mode
- hard_tabs
- leading_zero
- manifest_whitespace_opening_brace_after
- nested_classes_or_defines
- only_variable_string
- optional_default
- parameter_documentation
- parameter_order
- parameter_types
- quoted_booleans
- right_to_left_relationship
- slash_comments
- star_comments
# - strict_indent
- trailing_comma
- trailing_whitespace
- unquoted_file_mode
- variable_contains_dash
- variable_is_lowercase
- variable_scope
- variables_not_enclosed
8 changes: 1 addition & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,13 @@ group :development do
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false
gem "github_changelog_generator", '~> 1.15', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')
gem "puppet-lint-file_ensure-check", require: false
gem "puppet-lint-manifest_whitespace-check", require: false
gem "puppet-lint-trailing_comma-check", require: false
gem "puppet-lint-optional_default-check", require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end
group :test do
gem "puppet_metadata", '~> 1.0', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
Expand Down
2 changes: 1 addition & 1 deletion manifests/audisp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
group => $config_group,
mode => $config_mode,
content => epp('auditd/audisp.conf.epp', {
config => $config,
config => $config,
}),
}
}
Expand Down
8 changes: 4 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
target => $auditd::rules_file,
order => '01',
content => epp('auditd/audit-rules-begin.fragment.epp', {
buffer_size => $auditd::buffer_size,
failure_mode => $auditd::failure_mode,
buffer_size => $auditd::buffer_size,
failure_mode => $auditd::failure_mode,
}),
}

concat::fragment { 'auditd_rules_end':
target => $auditd::rules_file,
order => '99',
content => epp('auditd/audit-rules-end.fragment.epp', {
immutable => $auditd::immutable,
immutable => $auditd::immutable,
}),
}

Expand All @@ -56,7 +56,7 @@
group => $auditd::config_group,
mode => $auditd::config_mode,
content => epp('auditd/auditd.conf.epp', {
config => $auditd::config,
config => $auditd::config,
}),
notify => Service['auditd'],
}
Expand Down
12 changes: 6 additions & 6 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
owner => $owner,
group => $group,
content => epp('auditd/plugin.conf.epp', {
active => $active,
direction => $direction,
path => $path,
type => $type,
args => $args,
format => $format,
active => $active,
direction => $direction,
path => $path,
type => $type,
args => $args,
format => $format,
}),
notify => Service['auditd'],
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/rule.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# The rule priority order (between 1 and 100)
#
define auditd::rule (
String $content = '',
Integer[1, 100] $order = 10,
Optional[String] $content = undef,
Integer[1, 100] $order = 10,
) {
$rule_content = ($content == undef or $content == '') ? {
true => sprintf("%s\n\n", $name),
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"audispd",
"audisp"
],
"pdk-version": "2.4.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#2.4.0",
"template-ref": "tags/2.4.0-0-gfa6b6d2"
"pdk-version": "2.5.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#2.5.0",
"template-ref": "tags/2.5.0-0-g369d483"
}
104 changes: 97 additions & 7 deletions types/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,103 @@
Optional['log_format'] => Enum['raw', 'RAW', 'enriched', 'ENRICHED'],
Optional['log_group'] => Variant[Integer, String[1]],
Optional['priority_boost'] => Integer[0],
Optional['flush'] => Enum['none', 'NONE', 'incremental', 'INCREMENTAL', 'incremental_async', 'INCREMENTAL_ASYNC', 'data', 'DATA', 'sync', 'SYNC'],
Optional['flush'] => Enum[
'none',
'NONE',
'incremental',
'INCREMENTAL',
'incremental_async',
'INCREMENTAL_ASYNC',
'data',
'DATA',
'sync',
'SYNC',
],
Optional['freq'] => Integer[0],
Optional['dispatcher'] => String,
Optional['disp_qos'] => Enum['lossy', 'LOSSY', 'lossless', 'LOSSLESS'],
Optional['num_logs'] => Integer[0, 999],
Optional['name_format'] => Enum['none', 'NONE', 'hostname', 'HOSTNAME', 'fqd', 'FQD', 'numeric', 'NUMERIC', 'user', 'USER'],
Optional['name'] => String,
Optional['max_log_file'] => Integer,
Optional['max_log_file_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'suspend', 'SUSPEND', 'rotate', 'ROTATE', 'keep_logs', 'KEEP_LOGS'],
Optional['max_log_file_action'] => Enum[
'ignore',
'IGNORE',
'syslog',
'SYSLOG',
'suspend',
'SUSPEND',
'rotate',
'ROTATE',
'keep_logs',
'KEEP_LOGS'],
Optional['verify_email'] => Enum['yes', 'no'],
Optional['action_mail_acct'] => Variant[String, Stdlib::Email],
Optional['space_left'] => Integer,
Optional['space_left_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'rotate', 'ROTATE', 'email', 'EMAIL', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'],
Optional['space_left_action'] => Enum[
'ignore',
'IGNORE',
'syslog',
'SYSLOG',
'rotate',
'ROTATE',
'email',
'EMAIL',
'exec',
'EXEC',
'suspend',
'SUSPEND',
'single',
'SINGLE',
'halt',
'HALT'],
Optional['admin_space_left'] => Variant[Integer, String],
Optional['admin_space_left_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'rotate', 'ROTATE', 'email', 'EMAIL', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'],
Optional['disk_full_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'rotate', 'ROTATE', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'],
Optional['disk_error_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'],
Optional['admin_space_left_action'] => Enum[
'ignore',
'IGNORE',
'syslog',
'SYSLOG',
'rotate',
'ROTATE',
'email',
'EMAIL',
'exec',
'EXEC',
'suspend',
'SUSPEND',
'single',
'SINGLE',
'halt',
'HALT',
],
Optional['disk_full_action'] => Enum['ignore',
'IGNORE',
'syslog',
'SYSLOG',
'rotate',
'ROTATE',
'exec',
'EXEC',
'suspend',
'SUSPEND',
'single',
'SINGLE',
'halt',
'HALT',
],
Optional['disk_error_action'] => Enum['ignore',
'IGNORE',
'syslog',
'SYSLOG',
'exec',
'EXEC',
'suspend',
'SUSPEND',
'single',
'SINGLE',
'halt',
'HALT',
],
Optional['tcp_listen_port'] => Integer[1,65535],
Optional['tcp_listen_queue'] => Integer,
Optional['tcp_max_per_addr'] => Integer[1,1024],
Expand All @@ -36,7 +116,17 @@
Optional['krb5_key_file'] => Stdlib::Absolutepath,
Optional['distribute_network'] => Enum['yes', 'no'],
Optional['q_depth'] => Integer,
Optional['overflow_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'],
Optional['overflow_action'] => Enum['ignore',
'IGNORE',
'syslog',
'SYSLOG',
'suspend',
'SUSPEND',
'single',
'SINGLE',
'halt',
'HALT',
],
Optional['max_restarts'] => Integer[0],
Optional['plugin_dir'] => Stdlib::Absolutepath,
Optional['end_of_event_timeout'] => Integer[0],
Expand Down

0 comments on commit 83110a0

Please sign in to comment.