diff --git a/.rubocop.yml b/.rubocop.yml index 8f782e7..31e8248 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.4' + TargetRubyVersion: '2.5' Include: - "**/*.rb" Exclude: diff --git a/.sync.yml b/.sync.yml index 3a82394..f29af45 100644 --- a/.sync.yml +++ b/.sync.yml @@ -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' @@ -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 diff --git a/Gemfile b/Gemfile index b79956a..85a7250 100644 --- a/Gemfile +++ b/Gemfile @@ -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'] diff --git a/manifests/audisp.pp b/manifests/audisp.pp index f1d5bd0..aa202aa 100644 --- a/manifests/audisp.pp +++ b/manifests/audisp.pp @@ -103,7 +103,7 @@ group => $config_group, mode => $config_mode, content => epp('auditd/audisp.conf.epp', { - config => $config, + config => $config, }), } } diff --git a/manifests/config.pp b/manifests/config.pp index c15e671..2c04cdc 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -37,8 +37,8 @@ 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, }), } @@ -46,7 +46,7 @@ target => $auditd::rules_file, order => '99', content => epp('auditd/audit-rules-end.fragment.epp', { - immutable => $auditd::immutable, + immutable => $auditd::immutable, }), } @@ -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'], } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4363c20..753f993 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -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'], } diff --git a/manifests/rule.pp b/manifests/rule.pp index a830341..200ec57 100644 --- a/manifests/rule.pp +++ b/manifests/rule.pp @@ -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), diff --git a/metadata.json b/metadata.json index a8be28d..b4ecd3c 100644 --- a/metadata.json +++ b/metadata.json @@ -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" } diff --git a/types/conf.pp b/types/conf.pp index 00913ea..d76257c 100644 --- a/types/conf.pp +++ b/types/conf.pp @@ -7,7 +7,18 @@ 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'], @@ -15,15 +26,84 @@ 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], @@ -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],