From 841494767100e6abebde6e800796cf19e1f797e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 21 Mar 2023 15:23:28 +0100 Subject: Basically rewrote everything. --- .puppet-lint.rc | 1 + .rubocop.yml | 519 ++++++++++++++++++++++++++++++++++++++++++++++ Gemfile | 63 ++++++ Gemfile.lock | 511 +++++++++++++++++++++++++++++++++++++++++++++ files/header | 7 + manifests/hook.pp | 54 +++-- manifests/init.pp | 62 ++++-- manifests/makepkg.pp | 55 ++++- manifests/repo.pp | 72 +++++-- metadata.json | 19 +- pdk.yaml | 2 + templates/hook.epp | 8 +- templates/pacman.conf.epp | 43 ++++ templates/repo.epp | 13 ++ types/buildenv.pp | 10 +- types/packageoptions.pp | 18 +- types/trigger.pp | 7 +- 17 files changed, 1366 insertions(+), 98 deletions(-) create mode 100644 .puppet-lint.rc create mode 100644 .rubocop.yml create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 files/header create mode 100644 pdk.yaml create mode 100644 templates/pacman.conf.epp create mode 100644 templates/repo.epp diff --git a/.puppet-lint.rc b/.puppet-lint.rc new file mode 100644 index 0000000..cc96ece --- /dev/null +++ b/.puppet-lint.rc @@ -0,0 +1 @@ +--relative diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..31e8248 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,519 @@ +--- +require: +- rubocop-performance +- rubocop-rspec +AllCops: + DisplayCopNames: true + TargetRubyVersion: '2.5' + Include: + - "**/*.rb" + Exclude: + - bin/* + - ".vendor/**/*" + - "**/Gemfile" + - "**/Rakefile" + - pkg/**/* + - spec/fixtures/**/* + - vendor/**/* + - "**/Puppetfile" + - "**/Vagrantfile" + - "**/Guardfile" +Layout/LineLength: + Description: People have wide screens, use them. + Max: 200 +RSpec/BeforeAfterAll: + Description: Beware of using after(:all) as it may cause state to leak between tests. + A necessary evil in acceptance testing. + Exclude: + - spec/acceptance/**/*.rb +RSpec/HookArgument: + Description: Prefer explicit :each argument, matching existing module's style + EnforcedStyle: each +RSpec/DescribeSymbol: + Exclude: + - spec/unit/facter/**/*.rb +Style/BlockDelimiters: + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to + be consistent then. + EnforcedStyle: braces_for_chaining +Style/ClassAndModuleChildren: + Description: Compact style reduces the required amount of indentation. + EnforcedStyle: compact +Style/EmptyElse: + Description: Enforce against empty else clauses, but allow `nil` for clarity. + EnforcedStyle: empty +Style/FormatString: + Description: Following the main puppet project's style, prefer the % format format. + EnforcedStyle: percent +Style/FormatStringToken: + Description: Following the main puppet project's style, prefer the simpler template + tokens over annotated ones. + EnforcedStyle: template +Style/Lambda: + Description: Prefer the keyword for easier discoverability. + EnforcedStyle: literal +Style/RegexpLiteral: + Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 + EnforcedStyle: percent_r +Style/TernaryParentheses: + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses + on complex expressions for better readability, but seriously consider breaking + it up. + EnforcedStyle: require_parentheses_when_complex +Style/TrailingCommaInArguments: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/TrailingCommaInArrayLiteral: + Description: Prefer always trailing comma on multiline literals. This makes diffs, + and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/SymbolArray: + Description: Using percent style obscures symbolic intent of array's contents. + EnforcedStyle: brackets +RSpec/MessageSpies: + EnforcedStyle: receive +Style/Documentation: + Exclude: + - lib/puppet/parser/functions/**/* + - spec/**/* +Style/WordArray: + EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/Sum: + Enabled: true +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/StringMethods: + Enabled: true +Bundler/InsecureProtocolSource: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/BlockNesting: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/CurrentPathExpectation: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/Capybara/VisibilityMatcher: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MissingExampleGroupArgument: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false +RSpec/NestedGroups: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/AsciiComments: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NilLambda: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..fc28658 --- /dev/null +++ b/Gemfile @@ -0,0 +1,63 @@ +source ENV['GEM_SOURCE'] || 'https://rubygems.org' + +def location_for(place_or_version, fake_version = nil) + git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} + file_url_regex = %r{\Afile:\/\/(?.*)} + + if place_or_version && (git_url = place_or_version.match(git_url_regex)) + [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) + ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] + else + [place_or_version, { require: false }] + end +end + +ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments +minor_version = ruby_version_segments[0..1].join('.') + +group :development do + gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] + 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 +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 + +puppet_version = ENV['PUPPET_GEM_VERSION'] +facter_version = ENV['FACTER_GEM_VERSION'] +hiera_version = ENV['HIERA_GEM_VERSION'] + +gems = {} + +gems['puppet'] = location_for(puppet_version) + +# If facter or hiera versions have been specified via the environment +# variables + +gems['facter'] = location_for(facter_version) if facter_version +gems['hiera'] = location_for(hiera_version) if hiera_version + +gems.each do |gem_name, gem_params| + gem gem_name, *gem_params +end + +# Evaluate Gemfile.local and ~/.gemfile if they exist +extra_gemfiles = [ + "#{__FILE__}.local", + File.join(Dir.home, '.gemfile'), +] + +extra_gemfiles.each do |gemfile| + if File.file?(gemfile) && File.readable?(gemfile) + eval(File.read(gemfile), binding) + end +end +# vim: syntax=ruby diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..e9e1ffd --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,511 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.6) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + ansi (1.5.0) + ast (2.4.2) + awesome_print (1.9.2) + aws-eventstream (1.2.0) + aws-partitions (1.591.0) + aws-sdk-core (3.131.1) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.525.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1, >= 1.6.1) + aws-sdk-ec2 (1.316.0) + aws-sdk-core (~> 3, >= 3.127.0) + aws-sigv4 (~> 1.1) + aws-sigv4 (1.5.0) + aws-eventstream (~> 1, >= 1.0.2) + bcrypt_pbkdf (1.1.0) + bindata (2.4.10) + bolt (3.22.1) + CFPropertyList (~> 2.2) + addressable (~> 2.5) + aws-sdk-ec2 (~> 1) + concurrent-ruby (~> 1.0) + ffi (>= 1.9.25, < 2.0.0) + hiera-eyaml (~> 3) + jwt (~> 2.2) + logging (~> 2.2) + minitar (~> 0.6) + net-scp (~> 1.2) + net-ssh (>= 4.0) + net-ssh-krb (~> 0.5) + orchestrator_client (~> 0.5) + puppet (>= 6.18.0) + puppet-resource_api (>= 1.8.1) + puppet-strings (~> 2.3) + puppetfile-resolver (~> 0.5) + r10k (~> 3.10) + ruby_smb (~> 1.0) + terminal-table (~> 3.0) + winrm (~> 2.0) + winrm-fs (~> 1.3) + builder (3.2.4) + codecov (0.6.0) + simplecov (>= 0.15, < 0.22) + coderay (1.1.3) + colored2 (3.1.2) + concurrent-ruby (1.1.10) + connection_pool (2.2.5) + cri (2.15.11) + deep_merge (1.2.2) + dependency_checker (0.3.0) + parallel + puppet_forge (>= 2.2, < 4.0) + rake (~> 13.0) + semantic_puppet (~> 1.0) + diff-lcs (1.5.0) + docile (1.4.0) + docker-api (2.2.0) + excon (>= 0.47.0) + multi_json + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + ed25519 (1.3.0) + erubi (1.10.0) + excon (0.92.3) + facter (4.2.9) + hocon (~> 1.3) + thor (>= 1.0.1, < 2.0) + facterdb (1.16.1) + facter (< 5.0.0) + jgrep + faraday (1.10.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fast_gettext (1.1.2) + ffi (1.15.5) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) + rake + forwardable (1.3.2) + gettext (3.4.3) + erubi + locale (>= 2.0.5) + prime + text (>= 1.3.0) + gettext-setup (0.31) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) + locale + gssapi (1.3.1) + ffi (>= 1.0.1) + gyoku (1.4.0) + builder (>= 2.1.2) + rexml (~> 3.0) + hiera (3.9.0) + hiera-eyaml (3.3.0) + highline + optimist + highline (2.0.3) + hirb (0.7.3) + hocon (1.3.1) + honeycomb-beeline (2.10.0) + libhoney (>= 1.14.2) + http (5.0.4) + addressable (~> 2.8) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.4.0) + http-accept (1.7.0) + http-cookie (1.0.4) + domain_name (~> 0.5) + http-form_data (2.3.0) + httpclient (2.8.3) + jgrep (1.5.4) + jmespath (1.6.1) + json (2.3.0) + json-schema (3.0.0) + addressable (>= 2.8) + jwt (2.2.3) + libhoney (2.2.0) + addressable (~> 2.0) + excon + http (>= 2.0, < 6.0) + little-plugger (1.1.4) + llhttp-ffi (0.4.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) + locale (2.1.3) + log4r (1.1.10) + logging (2.3.1) + little-plugger (~> 1.1) + multi_json (~> 1.14) + metaclass (0.0.4) + metadata-json-lint (3.0.2) + json-schema (>= 2.8, < 4.0) + spdx-licenses (~> 1.0) + method_source (1.0.0) + mime-types (3.4.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2022.0105) + minitar (0.9) + mocha (1.1.0) + metaclass (~> 0.0.1) + molinillo (0.8.0) + multi_json (1.15.0) + multipart-post (2.1.1) + net-http-persistent (4.0.1) + connection_pool (~> 2.2) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (6.1.0) + net-ssh-krb (0.5.1) + gssapi (~> 1.3.0) + net-ssh (>= 2.0) + net-telnet (0.1.1) + netrc (0.11.0) + nori (2.6.0) + optimist (3.0.1) + orchestrator_client (0.5.3) + faraday + net-http-persistent + parallel (1.22.1) + parallel_tests (3.10.1) + parallel + parser (3.1.2.0) + ast (~> 2.4.1) + pathspec (1.0.0) + pluginator (1.5.0) + prime (0.1.2) + forwardable + singleton + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.7) + puppet (7.16.0) + concurrent-ruby (~> 1.0) + deep_merge (~> 1.0) + facter (> 2.0.1, < 5) + fast_gettext (>= 1.1, < 3) + hiera (>= 3.2.1, < 4) + locale (~> 2.1) + multi_json (~> 1.10) + puppet-resource_api (~> 1.5) + scanf (~> 1.0) + semantic_puppet (~> 1.0) + puppet-blacksmith (6.1.1) + puppet-modulebuilder (~> 0.2) + rest-client (~> 2.0) + puppet-debugger (1.2.0) + awesome_print (~> 1.7) + bundler + facterdb (>= 0.4.0) + pluginator (~> 1.5.0) + puppet (>= 5.5) + rb-readline (>= 0.5.5) + table_print (>= 1.0.0) + tty-pager (~> 0.13.0) + puppet-lint (2.5.2) + puppet-lint-absolute_classname-check (3.0.1) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-anchor-check (1.0.1) + puppet-lint (>= 1.1, < 3.0) + puppet-lint-classes_and_types_beginning_with_digits-check (1.0.0) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-file_ensure-check (1.0.0) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-leading_zero-check (1.0.0) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-legacy_facts-check (1.0.4) + puppet-lint (~> 2.4) + puppet-lint-lookup_in_parameter-check (1.0.0) + puppet-lint (~> 2.0) + puppet-lint-manifest_whitespace-check (0.1.17) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-optional_default-check (1.0.0) + puppet-lint (>= 2.1, < 3.0) + puppet-lint-param-docs (1.7.5) + puppet-lint (>= 1.1, < 3.0) + puppet-lint-param-types (0.0.1) + puppet-lint (>= 1.1, < 3.0) + puppet-lint-params_empty_string-check (1.0.0) + puppet-lint (~> 2.5) + puppet-lint-resource_reference_syntax (1.1.0) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-strict_indent-check (2.0.8) + puppet-lint (> 1.0) + puppet-lint-top_scope_facts-check (1.0.1) + puppet-lint (~> 2.0) + puppet-lint-topscope-variable-check (1.0.1) + puppet-lint (~> 2.0) + puppet-lint-trailing_comma-check (0.4.2) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-unquoted_string-check (2.1.0) + puppet-lint (>= 2.1, < 3.0) + puppet-lint-variable_contains_upcase (1.2.0) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-version_comparison-check (1.0.0) + puppet-lint (>= 1.0, < 3.0) + puppet-module-posix-default-r2.7 (1.1.1) + puppet-module-posix-dev-r2.7 (1.1.1) + bcrypt_pbkdf (~> 1.0) + codecov (~> 0.2) + concurrent-ruby (!= 1.1.6) + dependency_checker (~> 0.2) + ed25519 (~> 1.2) + facterdb (>= 0.8.1, < 2.0.0) + metadata-json-lint (>= 2.0.2, < 4.0.0) + mocha (>= 1.0.0, < 1.2.0) + parallel_tests (~> 3.4) + pry (~> 0.10) + puppet-blacksmith (~> 6.0) + puppet-debugger (~> 1.0) + puppet-lint (>= 2.3.0, < 3.0.0) + puppet-resource_api (~> 1.8) + puppet-strings (~> 2.0) + puppet-syntax (~> 3.0) + puppetlabs_spec_helper (>= 2.9.0, < 4.0.0) + rainbow (~> 2.0) + rspec-puppet (>= 2.3.2, < 3.0.0) + rspec-puppet-facts (>= 1.10.0, < 3) + rspec_junit_formatter (~> 0.2) + rubocop (= 1.6.1) + rubocop-performance (= 1.9.1) + rubocop-rspec (= 2.0.1) + serverspec (~> 2.41) + simplecov (< 0.19.0) + simplecov-console (~> 0.4.2) + specinfra (= 2.82.2) + puppet-module-posix-system-r2.7 (1.1.1) + puppet_litmus (~> 0.20) + puppet-modulebuilder (0.3.0) + minitar (~> 0.9) + pathspec (>= 0.2.1, < 2.0.0) + puppet-resource_api (1.8.14) + hocon (>= 1.0) + puppet-strings (2.9.0) + rgen + yard (~> 0.9.5) + puppet-syntax (3.2.1) + puppet (>= 5) + rake + puppet_forge (3.2.0) + faraday (~> 1.3) + faraday_middleware (~> 1.0) + minitar + semantic_puppet (~> 1.0) + puppet_litmus (0.33.2) + bolt (>= 2.0.1, < 4.0.0) + docker-api (>= 1.34, < 3.0.0) + honeycomb-beeline + parallel + puppet-modulebuilder (>= 0.2.1, < 1.0.0) + retryable (~> 3.0) + rspec + rspec_honeycomb_formatter + tty-spinner (>= 0.5.0, < 1.0.0) + puppetfile-resolver (0.5.0) + molinillo (~> 0.6) + semantic_puppet (~> 1.0) + puppetlabs_spec_helper (3.0.0) + mocha (~> 1.0) + pathspec (>= 0.2.1, < 1.1.0) + puppet-lint (~> 2.0) + puppet-syntax (>= 2.0, < 4) + rspec-puppet (~> 2.0) + r10k (3.15.0) + colored2 (= 3.1.2) + cri (>= 2.15.10) + fast_gettext (>= 1.1.0, < 3.0.0) + gettext (>= 3.0.2, < 4.0.0) + gettext-setup (~> 0.24) + jwt (~> 2.2.3) + log4r (= 1.1.10) + minitar (~> 0.9) + multi_json (~> 1.10) + puppet_forge (>= 2.3.0) + rainbow (2.2.2) + rake + rake (13.0.6) + rb-readline (0.5.5) + regexp_parser (2.4.0) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + retryable (3.0.5) + rexml (3.2.5) + rgen (0.9.0) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-its (1.3.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-puppet (2.11.1) + rspec + rspec-puppet-facts (2.0.5) + facter + facterdb (>= 0.5.0) + puppet + rspec-support (3.11.0) + rspec_honeycomb_formatter (0.2.1) + honeycomb-beeline + rspec-core (~> 3.0) + rspec_junit_formatter (0.5.1) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.6.1) + parallel (~> 1.10) + parser (>= 2.7.1.5) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.2.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (1.18.0) + parser (>= 3.1.1.0) + rubocop-performance (1.9.1) + rubocop (>= 0.90.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-rspec (2.0.1) + rubocop (~> 1.0) + rubocop-ast (>= 1.1.0) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + ruby_smb (1.1.0) + bindata + rubyntlm + windows_error + rubyntlm (0.6.3) + rubyzip (2.3.2) + scanf (1.0.0) + semantic_puppet (1.0.4) + serverspec (2.42.0) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.72) + sfl (2.3) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-console (0.4.2) + ansi + hirb + simplecov + simplecov-html (0.12.3) + singleton (0.1.1) + spdx-licenses (1.3.0) + specinfra (2.82.2) + net-scp + net-ssh (>= 2.7) + net-telnet (= 0.1.1) + sfl + strings (0.1.8) + strings-ansi (~> 0.1) + unicode-display_width (~> 1.5) + unicode_utils (~> 1.4) + strings-ansi (0.2.0) + table_print (1.5.7) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + text (1.3.1) + thor (1.2.1) + tty-cursor (0.7.1) + tty-pager (0.13.0) + strings (~> 0.1.8) + tty-screen (~> 0.8) + tty-screen (0.8.1) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.1) + unicode-display_width (1.8.0) + unicode_utils (1.4.0) + voxpupuli-puppet-lint-plugins (3.0.0) + puppet-lint (>= 2.5.0) + puppet-lint-absolute_classname-check (>= 2.0.0) + puppet-lint-anchor-check + puppet-lint-classes_and_types_beginning_with_digits-check + puppet-lint-file_ensure-check + puppet-lint-leading_zero-check + puppet-lint-legacy_facts-check + puppet-lint-lookup_in_parameter-check + puppet-lint-manifest_whitespace-check + puppet-lint-optional_default-check + puppet-lint-param-docs + puppet-lint-param-types + puppet-lint-params_empty_string-check + puppet-lint-resource_reference_syntax + puppet-lint-strict_indent-check + puppet-lint-top_scope_facts-check + puppet-lint-topscope-variable-check + puppet-lint-trailing_comma-check + puppet-lint-unquoted_string-check + puppet-lint-variable_contains_upcase + puppet-lint-version_comparison-check + webrick (1.7.0) + windows_error (0.1.4) + winrm (2.3.6) + builder (>= 2.1.2) + erubi (~> 1.8) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (>= 1.6.1, < 3.0) + nori (~> 2.0) + rubyntlm (~> 0.6.0, >= 0.6.3) + winrm-fs (1.3.5) + erubi (~> 1.8) + logging (>= 1.6.1, < 3.0) + rubyzip (~> 2.0) + winrm (~> 2.0) + yard (0.9.27) + webrick (~> 1.7.0) + +PLATFORMS + ruby + +DEPENDENCIES + json (= 2.3.0) + puppet (= 7.16.0) + puppet-module-posix-default-r2.7 (~> 1.0) + puppet-module-posix-dev-r2.7 (~> 1.0) + puppet-module-posix-system-r2.7 (~> 1.0) + puppet-module-win-default-r2.7 (~> 1.0) + puppet-module-win-dev-r2.7 (~> 1.0) + puppet-module-win-system-r2.7 (~> 1.0) + voxpupuli-puppet-lint-plugins (>= 3.0) + +BUNDLED WITH + 2.1.4 diff --git a/files/header b/files/header new file mode 100644 index 0000000..59d3871 --- /dev/null +++ b/files/header @@ -0,0 +1,7 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives +# +# File managed by PUPPET. Local changes WILL be overwritten. + diff --git a/manifests/hook.pp b/manifests/hook.pp index c71b6c5..a1fda6e 100644 --- a/manifests/hook.pp +++ b/manifests/hook.pp @@ -1,25 +1,35 @@ +# @summary A Pacman hook + +# @param ensure +# @param priority +# @param description +# @param when +# @param exec +# @param depends +# @param abort_on_fail +# @param needs_targets +# @param trigger define pacman::hook ( + Enum['PreTransation', 'PostTransaction'] $when, + String $exec, + Variant[Pacman::Trigger, Array[Pacman::Trigger, 1]] $trigger, Enum['present', 'absent'] $ensure = 'present', Integer $priority = 50, Optional[String] $description = undef, - Enum['PreTransation', 'PostTransaction'] $when, - String $exec, Optional[Variant[String, Array[String, 1]]] $depends = undef, - Boolean $abortOnFail = false, # only for PreTransation - Boolean $needsTargets = false, - Variant[Pacman::Trigger, Array[Pacman::Trigger, 1]] $trigger, + Boolean $abort_on_fail = false, # only for PreTransation + Boolean $needs_targets = false, ) { + require pacman - require ::pacman - - if ($abortOnFail and $when != 'PreTransation') { - fail('abortOnFail only valid when "when" => "PreTransation"') + if ($abort_on_fail and $when != 'PreTransation') { + fail('abort_on_fail only valid when "when" => "PreTransation"') } # Normalize triggers to list $triggers = ($trigger ? { - Array => $trigger, - default => [$trigger], + Array => $trigger, + default => [$trigger], }).map |$trigger| { # Normalize contents of each trigger, making { @@ -46,17 +56,17 @@ define pacman::hook ( } $str = epp('pacman/hook.epp', { - description => $description, - depends => $depends ? { - Optional => [], - Array => $depends, - default => [$depends], - }, - triggers => $triggers, - exec => $exec, - when => $when, - abortOnFail => $abortOnFail, - needsTargets => $needsTargets, + description => $description, + depends => $depends ? { + Optional => [], + Array => $depends, + default => [$depends], + }, + triggers => $triggers, + exec => $exec, + when => $when, + abort_on_fail => $abort_on_fail, + needs_targets => $needs_targets, }) $chksum = $str.md5() diff --git a/manifests/init.pp b/manifests/init.pp index fb23328..4deaf9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,33 +1,54 @@ +# @summary Configures the Pacman package manager +# @param hooks_path +# Path for puppet added hooks +# @param conf_path +# Path for pacman configuration +# @param ilovecandy +# It's a secret to everybody. +# @param parallel_downloads +# @param mirrorlist +# @param update +# Should 'pacman -Sy' be run after changes to the configuration? class pacman ( String $hooks_path = '/etc/pacman.d/hooks-puppet', String $conf_path = '/etc/pacman.conf', Boolean $ilovecandy = false, + Optional[Integer] $parallel_downloads = undef, + String $mirrorlist = "puppet:///modules/${module_name}/mirrorlist", + Boolean $update = false, ) { + $hooks_ = [$hooks_path] + $parallel_downloads_ = if versioncmp($facts['pacman-version'], '6.0.0') != -1 { + $parallel_downloads + } else { + false + } - ini_setting { 'Pacman HookDir': - path => $conf_path, - section => 'options', - setting => 'HookDir', - value => $hooks_path, + concat { $conf_path: + ensure => present, + order => 'numeric', + backup => true, + } + if $update { + exec { 'pacman -Sy': + command => ['pacman', '-Sy'], + path => ['/bin', '/usr/bin'], + refreshonly => true, + subscribe => Concat[$conf_path], + } } - ini_setting { 'Pacman ILoveCandy': - ensure => if ($ilovecandy) { present } else { absent }, - path => '/etc/pacman.conf', - section => 'options', - setting => 'ILoveCandy', - key_val_separator => '', - value => '', + concat::fragment { 'pacman.conf header': + target => $conf_path, + source => "puppet:///modules/${module_name}/header", + order => 0, } - if versioncmp($facts['pacman-version'], '6.0.0') >= 0 { - ini_setting { 'Pacman parallel downloads': - path => '/etc/pacman.conf', - section => 'options', - setting => 'ParallelDownloads', - value => 8, - } + concat::fragment { 'pacman.conf options': + target => $conf_path, + order => 1, + content => epp("${module_name}/pacman.conf.epp"), } file { $hooks_path: @@ -37,8 +58,7 @@ class pacman ( } file { '/etc/pacman.d/mirrorlist': - ensure => present, backup => true, - source => 'puppet:///modules/pacman/mirrorlist', + source => $mirrorlist, } } diff --git a/manifests/makepkg.pp b/manifests/makepkg.pp index 789298a..2761caf 100644 --- a/manifests/makepkg.pp +++ b/manifests/makepkg.pp @@ -1,3 +1,50 @@ +# @summary Arch makepkg configuration +# +# Complete configuration of makepkg.conf(5) +# +# @param dlagents +# @param vcsclients +# @param carch +# @param chost +# @param cppflags +# @param cflags +# @param cxxflags +# @param ldflags +# @param rustflags +# @param makeflags +# @param debug_cflags +# @param debug_cxxflags +# @param debug_rustflags +# @param buildenv +# @param distcc_hosts +# @param builddir +# @param options +# @param integrity_check +# @param strip_binaries +# @param strip_shared +# @param strip_static +# @param man_dirs +# @param doc_dirs +# @param purge_targets +# @param dbgsrcdir +# @param pkgdest +# @param srcdest +# @param srcpkgdest +# @param logdest +# @param packager +# @param gpgkey +# @param compressgz +# @param compressbz2 +# @param compressxz +# @param compresszst +# @param compresslrz +# @param compresslzo +# @param compressz +# @param compresslz4 +# @param compresslz +# @param pkgext +# @param srcext +# @param pacman_auth class pacman::makepkg ( # protocol: agent Hash[String, String] $dlagents = { @@ -49,13 +96,13 @@ class pacman::makepkg ( debug => false, lto => false, # This is fairly new... }, - Array[Pacman::ChecksumTypes] $integrity_check = [ 'sha256' ], + Array[Pacman::ChecksumTypes] $integrity_check = ['sha256'], String $strip_binaries = '--strip-all', String $strip_shared = '--strip-unneeded', String $strip_static = '--strip-debug', - Array[String] $man_dirs = [ '{usr{,/local}{,/share},opt/*}/{man,info}' ], - Array[String] $doc_dirs = [ 'usr/{,local/}{,share/}{doc,gtk-doc}', 'opt/*/{doc,gtk-doc}' ], - Array[String] $purge_targets = [ 'usr/{,share}/info/dir', '.packlist', '*.pod' ], + Array[String] $man_dirs = ['{usr{,/local}{,/share},opt/*}/{man,info}'], + Array[String] $doc_dirs = ['usr/{,local/}{,share/}{doc,gtk-doc}', 'opt/*/{doc,gtk-doc}'], + Array[String] $purge_targets = ['usr/{,share}/info/dir', '.packlist', '*.pod'], String $dbgsrcdir = '/usr/src/debug', Optional[String] $pkgdest = undef, # /home/packages Optional[String] $srcdest = undef, # /home/soruces diff --git a/manifests/repo.pp b/manifests/repo.pp index 9d62417..8607853 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,29 +1,59 @@ +# @summary A Pacman repo +# +# @param ensure +# @param repo_name +# Name of repo, exposed to mirrorlists as $repo +# @param siglevel +# @param usage +# @param include +# A repolist to include, mutually exclusive with $server and $source +# @param server +# A direct server to use, mutually exclusive with $include and $source +# @param source +# A complete list of sources to pull from. +# Should be a list of strings on the form "Include = ${include}" or +# "Server = ${server}". Where include is a path to a mirrorlist, and +# server is a direct url. +# +# Mutually exclusive with $include and $server. define pacman::repo ( Enum['present', 'absent'] $ensure = 'present', String $repo_name = $name, - # String $include, - String $server, - String $sig_level, + Optional[Enum['Never', 'Optional', 'Required']] $siglevel = undef, + Optional[Enum['Sync', 'Search', 'Install', 'Upgrade', 'All']] $usage = undef, + Optional[String] $include = undef, + Optional[String] $server = undef, + Optional[Array[String,1]] $source = undef, ) { - require ::pacman + require pacman - # NOTE we don't trigger a package database refresh here, since - # 'pacman -Sy' is strongly discouraged, while - # 'pacman -Syu' does to much. + if $repo_name == 'local' { + fail('Repo name "local" is reserved by Pacman') + } + + # Check that at mots one of the following are defined + # At least one is required, but that is checked bellow. + if [$include, $server, $source].filter |$x| { $x =~ NotUndef }.length > 1 { + fail('$include, $server, and $source mutually exclusive') + } + + $source_ = if $source { + $source + } elsif $server { + ["Server = ${server}"] + } elsif $include { + ["Include = ${include}"] + } else { + fail('$source, $include, or $server required') + } - ini_setting { - default: - ensure => $ensure, - path => $::pacman::conf_path, - section => $repo_name , - ; - "Pacman repo [${repo_name}] server": - setting => 'Server', - value => $server , - ; - "Pacman repo [${repo_name}] SigLevel": - setting => 'SigLevel', - value => $sig_level , - ; + concat::fragment { "pacman.conf - repo - ${repo_name}": + target => $pacman::conf_path, + content => epp("${module_name}/repo.epp", { + 'name' => $repo_name, + 'siglevel' => $siglevel, + 'usage' => $usage, + 'source' => $source_, + }), } } diff --git a/metadata.json b/metadata.json index ed83793..a069fb1 100644 --- a/metadata.json +++ b/metadata.json @@ -1,20 +1,23 @@ { "name": "HugoNikanor-pacman", - "version": "0.1.0", + "version": "0.1.1", "author": "Hugo Hörnquist", "license": "None", "summary": "Interface with Arch Linux's package manager.", "source": "https://git.hornquist.se/puppet/pacman", - "dependencies": [ - { - "name": "puppetlabs/inifile", - "version_requirement": ">= 5.0.0 < 6.0.0" - } - ], + "dependencies": [ + { + "name": "puppetlabs/concat", + "version_requirement": ">= 7.2.0 < 8.0.0" + } + ], "operatingsystem_support": [ { "operatingsystem": "Archlinux" } - ] + ], + "pdk-version": "2.5.0", + "template-url": "pdk-default#2.5.0", + "template-ref": "tags/2.5.0-0-g369d483" } diff --git a/pdk.yaml b/pdk.yaml new file mode 100644 index 0000000..4bef4bd --- /dev/null +++ b/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: [] diff --git a/templates/hook.epp b/templates/hook.epp index 08377d9..bdc4c15 100644 --- a/templates/hook.epp +++ b/templates/hook.epp @@ -3,8 +3,8 @@ String $exec, Enum['PreTransation', 'PostTransaction'] $when, Array[String] $depends, - Boolean $abortOnFail, - Boolean $needsTargets, + Boolean $abort_on_fail, + Boolean $needs_targets, | -%> # Managed by Puppet @@ -27,5 +27,5 @@ When = <%= $when %> <%- $depends.each |$depend| { -%> Depends = <%= $depend %> <%- } -%> -<%- if ($abortOnFail) { -%>AbortOnFail<% } %> -<%- if ($needsTargets) { -%>NeedsTargets<% } %> +<%- if ($abort_on_fail) { -%>AbortOnFail<% } %> +<%- if ($needs_targets) { -%>NeedsTargets<% } %> diff --git a/templates/pacman.conf.epp b/templates/pacman.conf.epp new file mode 100644 index 0000000..ee68a80 --- /dev/null +++ b/templates/pacman.conf.epp @@ -0,0 +1,43 @@ +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HookDir = <%= $pacman::hooks_.join(' ') %> +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto +<% if $pacman::ilovecandy { %>ILoveCandy<% } %> + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#NoProgressBar +CheckSpace +#VerbosePkgLists +<% if $pacman::parallel_downloads_ { -%> +ParallelDownloads = <%= $pacman::parallel_downloads_ %> +<%- } %> + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + diff --git a/templates/repo.epp b/templates/repo.epp new file mode 100644 index 0000000..a988cf2 --- /dev/null +++ b/templates/repo.epp @@ -0,0 +1,13 @@ +<%- | String $name, + Optional[String] $siglevel = undef, + Optional[String] $usage = undef, + Array[String] $source | -%> + +[<%= $name %>] +<%= $source.join('\n') %> +<% if $siglevel { %> +SigLevel = <%= $siglevel %> +<% } %> +<% if $usage { %> +Usage = <%= $usage %> +<% } %> diff --git a/types/buildenv.pp b/types/buildenv.pp index 0967535..d70c8d1 100644 --- a/types/buildenv.pp +++ b/types/buildenv.pp @@ -1,7 +1,7 @@ type Pacman::Buildenv = Struct[{ - distcc => Boolean, - color => Boolean, - ccache => Boolean, - check => Boolean, - sign => Boolean, + distcc => Boolean, + color => Boolean, + ccache => Boolean, + check => Boolean, + sign => Boolean, }] diff --git a/types/packageoptions.pp b/types/packageoptions.pp index c1f54c4..45eaff3 100644 --- a/types/packageoptions.pp +++ b/types/packageoptions.pp @@ -1,11 +1,11 @@ type Pacman::PackageOptions = Struct[{ - string => Boolean, - docs => Boolean, - libtool => Boolean, - staticlibs => Boolean, - emptydirs => Boolean, - zipman => Boolean, - purge => Boolean, - debug => Boolean, - lto => Boolean, + string => Boolean, + docs => Boolean, + libtool => Boolean, + staticlibs => Boolean, + emptydirs => Boolean, + zipman => Boolean, + purge => Boolean, + debug => Boolean, + lto => Boolean, }] diff --git a/types/trigger.pp b/types/trigger.pp index 38a9b97..c80bac0 100644 --- a/types/trigger.pp +++ b/types/trigger.pp @@ -1,6 +1,5 @@ type Pacman::Trigger = Struct[{ - type => Enum['Path', 'Package'], - operation => Variant[Pacman::Operation, Array[Pacman::Operation, 1]], - target => Variant[String, Array[String, 1]], + type => Enum['Path', 'Package'], + operation => Variant[Pacman::Operation, Array[Pacman::Operation, 1]], + target => Variant[String, Array[String, 1]], }] - -- cgit v1.2.3