Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cae09eb85b | ||
|
|
75751b60b3 | ||
| b535146112 | |||
| 9e682084c8 | |||
| 7004a193c9 | |||
| 21b5dc85e1 | |||
| cef80e551b | |||
| 4a3dcd0a8a | |||
| d1c83026bd | |||
| 186695438a | |||
| 6a5ec21a1e | |||
| 939f795d37 | |||
| 998f1716f3 | |||
| 0291282ee2 | |||
| f95631312f | |||
| 659e3af412 | |||
| 882df7423d | |||
| c830b8ebd0 | |||
| 1c7804128c | |||
| e5718d058e | |||
| dc3a3a9337 | |||
| e4df1583df | |||
|
|
0bc87f0cbf | ||
| c87ceb824b | |||
|
|
55da9601b0 | ||
|
|
c46c360eb0 | ||
| 9d89654211 | |||
| d8b9a1b4a5 | |||
| 9f8cc61cf1 | |||
| e962f31411 | |||
| 97c1cc97e6 | |||
| bd1fd54bbb | |||
| 3a4c1c85ad | |||
| 0c3db36c4d | |||
| 9115033d04 | |||
| cabc5c19ce | |||
| 7dca7dad51 | |||
| 53bbad2eb1 | |||
| 80644b6813 | |||
| 4020627a15 | |||
| a265caa979 | |||
| 7ce45a207f | |||
| 6d9b130f9d | |||
| f2565cccc1 | |||
| f4bdac2266 |
@@ -1,3 +0,0 @@
|
||||
---
|
||||
BUNDLE_PATH: vendor/bundle
|
||||
BUNDLE_DISABLE_SHARED_GEMS: true
|
||||
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
*.rb eol=lf
|
||||
*.erb eol=lf
|
||||
*.pp eol=lf
|
||||
*.sh eol=lf
|
||||
*.epp eol=lf
|
||||
29
.gitignore
vendored
29
.gitignore
vendored
@@ -1,2 +1,27 @@
|
||||
# blacksmith output directory
|
||||
pkg
|
||||
.git/
|
||||
.*.sw[op]
|
||||
.metadata
|
||||
.yardoc
|
||||
.yardwarns
|
||||
*.iml
|
||||
/.bundle/
|
||||
/.idea/
|
||||
/.vagrant/
|
||||
/coverage/
|
||||
/bin/
|
||||
/doc/
|
||||
/Gemfile.local
|
||||
/Gemfile.lock
|
||||
/junit/
|
||||
/log/
|
||||
/pkg/
|
||||
/spec/fixtures/manifests/
|
||||
/spec/fixtures/modules/
|
||||
/tmp/
|
||||
/vendor/
|
||||
/convert_report.txt
|
||||
/update_report.txt
|
||||
.DS_Store
|
||||
.project
|
||||
.envrc
|
||||
/inventory.yaml
|
||||
|
||||
41
.gitlab-ci.yml
Normal file
41
.gitlab-ci.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
stages:
|
||||
- syntax
|
||||
- unit
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- vendor/bundle
|
||||
|
||||
before_script:
|
||||
- bundle -v
|
||||
- rm Gemfile.lock || true
|
||||
- gem update --system $RUBYGEMS_VERSION
|
||||
- gem --version
|
||||
- bundle -v
|
||||
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
|
||||
|
||||
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.3-Puppet ~> 6:
|
||||
stage: syntax
|
||||
image: ruby:2.5.3
|
||||
script:
|
||||
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
|
||||
variables:
|
||||
PUPPET_GEM_VERSION: '~> 6'
|
||||
|
||||
parallel_spec-Ruby 2.5.3-Puppet ~> 6:
|
||||
stage: unit
|
||||
image: ruby:2.5.3
|
||||
script:
|
||||
- bundle exec rake parallel_spec
|
||||
variables:
|
||||
PUPPET_GEM_VERSION: '~> 6'
|
||||
|
||||
parallel_spec-Ruby 2.4.5-Puppet ~> 5:
|
||||
stage: unit
|
||||
image: ruby:2.4.5
|
||||
script:
|
||||
- bundle exec rake parallel_spec
|
||||
variables:
|
||||
PUPPET_GEM_VERSION: '~> 5'
|
||||
|
||||
43
.pdkignore
Normal file
43
.pdkignore
Normal file
@@ -0,0 +1,43 @@
|
||||
.git/
|
||||
.*.sw[op]
|
||||
.metadata
|
||||
.yardoc
|
||||
.yardwarns
|
||||
*.iml
|
||||
/.bundle/
|
||||
/.idea/
|
||||
/.vagrant/
|
||||
/coverage/
|
||||
/bin/
|
||||
/doc/
|
||||
/Gemfile.local
|
||||
/Gemfile.lock
|
||||
/junit/
|
||||
/log/
|
||||
/pkg/
|
||||
/spec/fixtures/manifests/
|
||||
/spec/fixtures/modules/
|
||||
/tmp/
|
||||
/vendor/
|
||||
/convert_report.txt
|
||||
/update_report.txt
|
||||
.DS_Store
|
||||
.project
|
||||
.envrc
|
||||
/inventory.yaml
|
||||
/appveyor.yml
|
||||
/.fixtures.yml
|
||||
/Gemfile
|
||||
/.gitattributes
|
||||
/.gitignore
|
||||
/.gitlab-ci.yml
|
||||
/.pdkignore
|
||||
/Rakefile
|
||||
/rakelib/
|
||||
/.rspec
|
||||
/.rubocop.yml
|
||||
/.travis.yml
|
||||
/.yardopts
|
||||
/spec/
|
||||
/.vscode/
|
||||
/circle.yml
|
||||
1
.puppet-lint.rc
Normal file
1
.puppet-lint.rc
Normal file
@@ -0,0 +1 @@
|
||||
--relative
|
||||
122
.rubocop.yml
Normal file
122
.rubocop.yml
Normal file
@@ -0,0 +1,122 @@
|
||||
---
|
||||
require: rubocop-rspec
|
||||
AllCops:
|
||||
DisplayCopNames: true
|
||||
TargetRubyVersion: '2.1'
|
||||
Include:
|
||||
- "./**/*.rb"
|
||||
Exclude:
|
||||
- bin/*
|
||||
- ".vendor/**/*"
|
||||
- "**/Gemfile"
|
||||
- "**/Rakefile"
|
||||
- pkg/**/*
|
||||
- spec/fixtures/**/*
|
||||
- vendor/**/*
|
||||
- "**/Puppetfile"
|
||||
- "**/Vagrantfile"
|
||||
- "**/Guardfile"
|
||||
Metrics/LineLength:
|
||||
Description: People have wide screens, use them.
|
||||
Max: 200
|
||||
GetText/DecorateString:
|
||||
Description: We don't want to decorate test output.
|
||||
Exclude:
|
||||
- spec/*
|
||||
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
|
||||
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/TrailingCommaInLiteral:
|
||||
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
|
||||
Style/CollectionMethods:
|
||||
Enabled: true
|
||||
Style/MethodCalledOnDoEndBlock:
|
||||
Enabled: true
|
||||
Style/StringMethods:
|
||||
Enabled: true
|
||||
Layout/EndOfLine:
|
||||
Enabled: false
|
||||
Layout/IndentHeredoc:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Enabled: false
|
||||
Metrics/BlockLength:
|
||||
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
|
||||
RSpec/DescribeClass:
|
||||
Enabled: false
|
||||
RSpec/ExampleLength:
|
||||
Enabled: false
|
||||
RSpec/MessageExpectation:
|
||||
Enabled: false
|
||||
RSpec/MultipleExpectations:
|
||||
Enabled: false
|
||||
RSpec/NestedGroups:
|
||||
Enabled: false
|
||||
Style/AsciiComments:
|
||||
Enabled: false
|
||||
Style/IfUnlessModifier:
|
||||
Enabled: false
|
||||
Style/SymbolProc:
|
||||
Enabled: false
|
||||
54
.travis.yml
Normal file
54
.travis.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
dist: trusty
|
||||
language: ruby
|
||||
cache: bundler
|
||||
before_install:
|
||||
- bundle -v
|
||||
- rm -f Gemfile.lock
|
||||
- gem update --system $RUBYGEMS_VERSION
|
||||
- gem --version
|
||||
- bundle -v
|
||||
script:
|
||||
- 'bundle exec rake $CHECK'
|
||||
bundler_args: --without system_tests
|
||||
rvm:
|
||||
- 2.5.3
|
||||
stages:
|
||||
- static
|
||||
- spec
|
||||
- acceptance
|
||||
-
|
||||
if: tag =~ ^v\d
|
||||
name: deploy
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
-
|
||||
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
|
||||
stage: static
|
||||
-
|
||||
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
|
||||
rvm: 2.4.5
|
||||
stage: spec
|
||||
-
|
||||
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
|
||||
rvm: 2.5.3
|
||||
stage: spec
|
||||
-
|
||||
env: DEPLOY_TO_FORGE=yes
|
||||
stage: deploy
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^v\d/
|
||||
notifications:
|
||||
email: false
|
||||
deploy:
|
||||
provider: puppetforge
|
||||
user: puppet
|
||||
password:
|
||||
secure: ""
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
condition: "$DEPLOY_TO_FORGE = yes"
|
||||
36
CHANGELOG.md
36
CHANGELOG.md
@@ -1,4 +1,38 @@
|
||||
## 2016-10-13 Release 0.1.1
|
||||
## 2-10-12-08 Release 0.6.1
|
||||
|
||||
- Improve parsing of package versions with respect to PMS v7 spec
|
||||
|
||||
## 2019-05-10 Release 0.6.0
|
||||
|
||||
- Adds `cleanup` task
|
||||
- Convert module to using PDK
|
||||
|
||||
|
||||
## 2018-10-14 Release 0.5.0
|
||||
|
||||
- Update package install error handling for compatbility with
|
||||
puppet 6
|
||||
- Add support for `pre_pre` package versions
|
||||
- Update build-time gems
|
||||
|
||||
## 2017-03-13 Release 0.4.0
|
||||
|
||||
- Replace operatingsystem.rb native fact with executable fact to workaround
|
||||
[https://tickets.puppetlabs.com/browse/FACT-1528](FACT-1528) (ace13)
|
||||
|
||||
## 2016-10-16 Release 0.3.0
|
||||
|
||||
- Add `entropy_repo` type to enable/disable repositories
|
||||
- Add `entropy_repos` fact
|
||||
|
||||
## 2016-10-13 Release 0.2.0
|
||||
|
||||
- Add `locale` fact
|
||||
- Remove obsolete `has_entropy` fact
|
||||
- Improve `entropy` package provider to set locale envvar directly
|
||||
and not shell out to a distributed script to set locale.
|
||||
|
||||
## 2016-10-13 Release 0.1.2
|
||||
|
||||
- Improved package regexes for valdiation and parsing
|
||||
(now following the Gentoo EAPI6 PMS document to ensure correctness)
|
||||
|
||||
82
Gemfile
82
Gemfile
@@ -1,19 +1,71 @@
|
||||
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
||||
|
||||
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3']
|
||||
gem 'metadata-json-lint'
|
||||
gem 'puppet', puppetversion
|
||||
gem 'puppetlabs_spec_helper', '>= 1.0.0'
|
||||
gem 'puppet-lint', '>= 1.0.0'
|
||||
gem 'facter', '>= 1.7.0'
|
||||
gem 'rspec-puppet'
|
||||
gem 'puppet-blacksmith'
|
||||
def location_for(place_or_version, fake_version = nil)
|
||||
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
|
||||
file_url_regex = %r{\Afile:\/\/(?<path>.*)}
|
||||
|
||||
# rspec must be v2 for ruby 1.8.7
|
||||
if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
|
||||
gem 'rspec', '~> 2.0'
|
||||
gem 'rake', '~> 10.0'
|
||||
else
|
||||
# rubocop requires ruby >= 1.9
|
||||
gem 'rubocop'
|
||||
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 "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
|
||||
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
|
||||
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
|
||||
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
|
||||
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 "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
|
||||
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
|
||||
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||
gem "puppet-module-win-dev-r#{minor_version}", 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
|
||||
|
||||
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
|
||||
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
|
||||
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
|
||||
gems['win32-dir'] = ['<= 0.4.9', require: false]
|
||||
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
|
||||
gems['win32-process'] = ['<= 0.7.5', require: false]
|
||||
gems['win32-security'] = ['<= 0.2.5', require: false]
|
||||
gems['win32-service'] = ['0.8.8', require: false]
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
91
Gemfile.lock
91
Gemfile.lock
@@ -1,91 +0,0 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (2.2.8)
|
||||
ast (2.3.0)
|
||||
diff-lcs (1.2.5)
|
||||
domain_name (0.5.20160826)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
facter (2.4.6)
|
||||
CFPropertyList (~> 2.2.6)
|
||||
hiera (3.2.1)
|
||||
http-cookie (1.0.3)
|
||||
domain_name (~> 0.5)
|
||||
json (2.0.2)
|
||||
json_pure (1.8.3)
|
||||
metaclass (0.0.4)
|
||||
metadata-json-lint (0.0.11)
|
||||
json
|
||||
spdx-licenses (~> 1.0)
|
||||
mime-types (2.99.3)
|
||||
mocha (1.2.0)
|
||||
metaclass (~> 0.0.1)
|
||||
netrc (0.11.0)
|
||||
parser (2.3.1.4)
|
||||
ast (~> 2.2)
|
||||
powerpack (0.1.1)
|
||||
puppet (4.7.0)
|
||||
CFPropertyList (~> 2.2.6)
|
||||
facter (> 2.0, < 4)
|
||||
hiera (>= 2.0, < 4)
|
||||
json_pure (~> 1.8)
|
||||
puppet-blacksmith (3.4.0)
|
||||
puppet (>= 2.7.16)
|
||||
rest-client (~> 1.8.0)
|
||||
puppet-lint (2.0.2)
|
||||
puppet-syntax (2.1.0)
|
||||
rake
|
||||
puppetlabs_spec_helper (1.2.2)
|
||||
mocha (~> 1.0)
|
||||
puppet-lint (~> 2.0)
|
||||
puppet-syntax (~> 2.0)
|
||||
rspec-puppet (~> 2.0)
|
||||
rainbow (2.1.0)
|
||||
rake (11.3.0)
|
||||
rest-client (1.8.0)
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 3.0)
|
||||
netrc (~> 0.7)
|
||||
rspec (3.5.0)
|
||||
rspec-core (~> 3.5.0)
|
||||
rspec-expectations (~> 3.5.0)
|
||||
rspec-mocks (~> 3.5.0)
|
||||
rspec-core (3.5.4)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-expectations (3.5.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-mocks (3.5.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-puppet (2.4.0)
|
||||
rspec
|
||||
rspec-support (3.5.0)
|
||||
rubocop (0.43.0)
|
||||
parser (>= 2.3.1.1, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
rainbow (>= 1.99.1, < 3.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||
ruby-progressbar (1.8.1)
|
||||
spdx-licenses (1.1.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.2)
|
||||
unicode-display_width (1.1.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
facter (>= 1.7.0)
|
||||
metadata-json-lint
|
||||
puppet (>= 3.3)
|
||||
puppet-blacksmith
|
||||
puppet-lint (>= 1.0.0)
|
||||
puppetlabs_spec_helper (>= 1.0.0)
|
||||
rspec-puppet
|
||||
rubocop
|
||||
|
||||
BUNDLED WITH
|
||||
1.12.5
|
||||
85
README.md
85
README.md
@@ -1,5 +1,7 @@
|
||||
# Sabayon
|
||||
|
||||
[](https://circleci.com/gh/Sabayon/puppet-sabayon)
|
||||
|
||||
#### Table of Contents
|
||||
|
||||
1. [Description](#description)
|
||||
@@ -18,7 +20,9 @@ This module extends puppet with support for the Sabayon Linux distribution.
|
||||
It adds support for:
|
||||
* The Entropy package manager
|
||||
* Managing `Sabayon Community Repository (SCR)` definitions using `enman`
|
||||
* Enabling and disabling entropy repositories
|
||||
* Entropy package masks and unmasks
|
||||
* Splitdebug installs for packages
|
||||
* Using systemd as the default service provider
|
||||
|
||||
## Setup
|
||||
@@ -35,6 +39,10 @@ It adds support for:
|
||||
This module overrides the default provider for `package` resources to
|
||||
force use of `entropy`
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* `sys-apps/lsb-release` is required for the operatingsystem fact to work
|
||||
|
||||
### Beginning with sabayon
|
||||
|
||||
The types and providers within this module can be used without any special
|
||||
@@ -78,12 +86,41 @@ not install 'mysql' since there's no way to disambiguate between
|
||||
|
||||
### Managing enman repositories
|
||||
|
||||
Install an available SCR repository using enman. The title is taken to be the
|
||||
repository name by default, and must be available via enman. Use an `ensure`
|
||||
value of `present` to install the repo, and `absent` to remove it.
|
||||
|
||||
```puppet
|
||||
enman_repo { 'community':
|
||||
ensure => present,
|
||||
}
|
||||
```
|
||||
|
||||
### Enabling and disabling entropy repositories
|
||||
|
||||
Installed repositories (whether system or SCR repositories) can be enabled and
|
||||
disabled using the `entropy_repo` type.
|
||||
|
||||
To enable a repository, use:
|
||||
```puppet
|
||||
entropy_repo { 'sabayon-limbo':
|
||||
enabled => 'true',
|
||||
}
|
||||
```
|
||||
|
||||
To disable a repository (only if present), use:
|
||||
```puppet
|
||||
if 'sabayon-limbo' in $facts['entropy_repos'] {
|
||||
entropy_repo { 'sabayon-limbo':
|
||||
enabled => 'false',
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This type cannot currently install or remove repositories, only control the
|
||||
enabled state of existing repositories. The repository being managed must
|
||||
already exist on the system.
|
||||
|
||||
### Masking packages
|
||||
|
||||
Entropy is very flexible in how to specify which packages can be masked,
|
||||
@@ -238,11 +275,55 @@ For more info on package keywords, see https://wiki.gentoo.org/wiki/KEYWORDS
|
||||
### Types
|
||||
|
||||
* `enman_repo`: Manages SCR repositories using enman
|
||||
* `entropy_repo`: Enables/Disables repositories
|
||||
* `entropy_mask`: Manages entropy package masks
|
||||
* `entropy_unmask`: Manages entropy package unmasks
|
||||
* `entropy_splitdebug` Manages entropy package debug information
|
||||
* `entropy_splitdebug_mask` Manages entropy package debug information masks
|
||||
|
||||
### Facts
|
||||
|
||||
#### `entropy_repos`
|
||||
|
||||
Provides a structured fact identifying the entropy repos present on the system
|
||||
including their enabled/disabled state, and whether they are enman or entropy
|
||||
repositories.
|
||||
|
||||
Example (in yaml format for readability):
|
||||
```yaml
|
||||
---
|
||||
sabayonlinux.org:
|
||||
repo_type: "entropy"
|
||||
enabled: "true"
|
||||
sabayon-limbo:
|
||||
repo_type: "entropy"
|
||||
enabled: "false"
|
||||
community:
|
||||
repo_type: "enman"
|
||||
enabled: "true"
|
||||
```
|
||||
|
||||
#### `locale`
|
||||
|
||||
Identifies the system-wide default locale, as set by `eselect`.
|
||||
|
||||
This is used internally by the entropy package provider to run `equo` commands
|
||||
using the correct locale.
|
||||
|
||||
#### `operatingsystem`
|
||||
|
||||
Overrides the detection of the operating system on Sabayon systems to `Sabayon`.
|
||||
|
||||
### Tasks
|
||||
|
||||
This module includes tasks for ad-hoc use with Puppet Bolt or Choria.
|
||||
|
||||
### `cleanup`
|
||||
|
||||
This task executes `equo cleanup` command on the target nodes, which frees up
|
||||
disk space used by cached package downloads. It does not accept any parameters,
|
||||
and does not support running noop mode.
|
||||
|
||||
## Limitations
|
||||
|
||||
This module is actively used by the developer against current Sabayon versions.
|
||||
@@ -254,3 +335,7 @@ best-efforts basis.
|
||||
|
||||
Pull requests welcome!
|
||||
|
||||
## Contributors
|
||||
|
||||
* [https://github.com/ace13](ace13)
|
||||
|
||||
|
||||
91
Rakefile
91
Rakefile
@@ -1,33 +1,76 @@
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'metadata-json-lint/rake_task'
|
||||
require 'puppet_blacksmith/rake_tasks'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
|
||||
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
|
||||
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
|
||||
|
||||
if RUBY_VERSION >= '1.9'
|
||||
require 'rubocop/rake_task'
|
||||
RuboCop::RakeTask.new
|
||||
def changelog_user
|
||||
return unless Rake.application.top_level_tasks.include? "changelog"
|
||||
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
|
||||
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
|
||||
puts "GitHubChangelogGenerator user:#{returnVal}"
|
||||
returnVal
|
||||
end
|
||||
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.relative = true
|
||||
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp', 'vendor/**/*.pp']
|
||||
def changelog_project
|
||||
return unless Rake.application.top_level_tasks.include? "changelog"
|
||||
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
|
||||
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
|
||||
puts "GitHubChangelogGenerator project:#{returnVal}"
|
||||
returnVal
|
||||
end
|
||||
|
||||
desc 'Validate manifests, templates, and ruby files'
|
||||
task :validate do
|
||||
Dir['manifests/**/*.pp'].each do |manifest|
|
||||
sh "puppet parser validate --noop #{manifest}"
|
||||
def changelog_future_release
|
||||
return unless Rake.application.top_level_tasks.include? "changelog"
|
||||
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
|
||||
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
|
||||
puts "GitHubChangelogGenerator future_release:#{returnVal}"
|
||||
returnVal
|
||||
end
|
||||
|
||||
PuppetLint.configuration.send('disable_relative')
|
||||
|
||||
if Bundler.rubygems.find_name('github_changelog_generator').any?
|
||||
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
||||
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
|
||||
config.user = "#{changelog_user}"
|
||||
config.project = "#{changelog_project}"
|
||||
config.future_release = "#{changelog_future_release}"
|
||||
config.exclude_labels = ['maintenance']
|
||||
config.header = "# Change log\n\nAll 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)."
|
||||
config.add_pr_wo_labels = true
|
||||
config.issues = false
|
||||
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
|
||||
config.configure_sections = {
|
||||
"Changed" => {
|
||||
"prefix" => "### Changed",
|
||||
"labels" => ["backwards-incompatible"],
|
||||
},
|
||||
"Added" => {
|
||||
"prefix" => "### Added",
|
||||
"labels" => ["feature", "enhancement"],
|
||||
},
|
||||
"Fixed" => {
|
||||
"prefix" => "### Fixed",
|
||||
"labels" => ["bugfix"],
|
||||
},
|
||||
}
|
||||
end
|
||||
Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file|
|
||||
sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures}
|
||||
end
|
||||
Dir['templates/**/*.erb'].each do |template|
|
||||
sh "erb -P -x -T '-' #{template} | ruby -c"
|
||||
else
|
||||
desc 'Generate a Changelog from GitHub'
|
||||
task :changelog do
|
||||
raise <<EOM
|
||||
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
|
||||
Please manually add it to your .sync.yml for now, and run `pdk update`:
|
||||
---
|
||||
Gemfile:
|
||||
optional:
|
||||
':development':
|
||||
- gem: 'github_changelog_generator'
|
||||
git: 'https://github.com/skywinder/github-changelog-generator'
|
||||
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
|
||||
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
|
||||
EOM
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run metadata_lint, lint, validate, and spec tests.'
|
||||
task :test do
|
||||
[:metadata_lint, :lint, :validate, :spec].each do |test|
|
||||
Rake::Task[test].invoke
|
||||
end
|
||||
end
|
||||
|
||||
55
appveyor.yml
Normal file
55
appveyor.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
version: 1.1.x.{build}
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
skip_commits:
|
||||
message: /^\(?doc\)?.*/
|
||||
clone_depth: 10
|
||||
init:
|
||||
- SET
|
||||
- 'mkdir C:\ProgramData\PuppetLabs\code && exit 0'
|
||||
- 'mkdir C:\ProgramData\PuppetLabs\facter && exit 0'
|
||||
- 'mkdir C:\ProgramData\PuppetLabs\hiera && exit 0'
|
||||
- 'mkdir C:\ProgramData\PuppetLabs\puppet\var && exit 0'
|
||||
environment:
|
||||
matrix:
|
||||
-
|
||||
RUBY_VERSION: 24-x64
|
||||
CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
|
||||
-
|
||||
PUPPET_GEM_VERSION: ~> 5.0
|
||||
RUBY_VERSION: 24
|
||||
CHECK: parallel_spec
|
||||
-
|
||||
PUPPET_GEM_VERSION: ~> 5.0
|
||||
RUBY_VERSION: 24-x64
|
||||
CHECK: parallel_spec
|
||||
-
|
||||
PUPPET_GEM_VERSION: ~> 6.0
|
||||
RUBY_VERSION: 25
|
||||
CHECK: parallel_spec
|
||||
-
|
||||
PUPPET_GEM_VERSION: ~> 6.0
|
||||
RUBY_VERSION: 25-x64
|
||||
CHECK: parallel_spec
|
||||
matrix:
|
||||
fast_finish: true
|
||||
install:
|
||||
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
||||
- bundle install --jobs 4 --retry 2 --without system_tests
|
||||
- type Gemfile.lock
|
||||
build: off
|
||||
test_script:
|
||||
- bundle exec puppet -V
|
||||
- ruby -v
|
||||
- gem -v
|
||||
- bundle -v
|
||||
- bundle exec rake %CHECK%
|
||||
notifications:
|
||||
- provider: Email
|
||||
to:
|
||||
- nobody@nowhere.com
|
||||
on_build_success: false
|
||||
on_build_failure: false
|
||||
on_build_status_changed: false
|
||||
3
circle.yml
Normal file
3
circle.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
test:
|
||||
override:
|
||||
- bundle exec rake test
|
||||
5
facts.d/sabayon.sh
Executable file
5
facts.d/sabayon.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /etc/sabayon-release ]; then
|
||||
echo "operatingsystem=Sabayon"
|
||||
fi
|
||||
20
lib/facter/entropy_repos.rb
Normal file
20
lib/facter/entropy_repos.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
Facter.add('entropy_repos') do
|
||||
confine operatingsystem: :Sabayon
|
||||
|
||||
setcode do
|
||||
# Use the types/providers to do the heavy lifting here
|
||||
repos = {}
|
||||
|
||||
Puppet::Type.type(:entropy_repo).provider(:file).instances.each do |repo|
|
||||
Facter.debug(repo.enabled)
|
||||
r = {
|
||||
repo_type: repo.repo_type,
|
||||
enabled: repo.enabled,
|
||||
}
|
||||
|
||||
repos[repo.name] = r
|
||||
end
|
||||
|
||||
repos
|
||||
end
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
Facter.add(:has_entropy) do
|
||||
confine :kernel => :linux
|
||||
setcode do
|
||||
FileTest.exists?("/usr/bin/equo")
|
||||
end
|
||||
end
|
||||
|
||||
6
lib/facter/locale.rb
Normal file
6
lib/facter/locale.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Facter.add(:locale) do
|
||||
confine osfamily: :gentoo
|
||||
setcode do
|
||||
Facter::Core::Execution.exec('eselect --colour=no --brief locale show').strip
|
||||
end
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
Facter.add(:operatingsystem) do
|
||||
# Sabayon Linux is a variant of Gentoo so this resolution needs to come
|
||||
# before the Gentoo resolution.
|
||||
has_weight(100)
|
||||
confine :kernel => :linux
|
||||
|
||||
setcode do
|
||||
distid = Facter.value(:lsbdistid)
|
||||
if distid == "Sabayon"
|
||||
'Sabayon'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,54 +1,52 @@
|
||||
Puppet::Type.type(:enman_repo).provide(:enman) do
|
||||
desc "Enman provider for Enman Repositories"
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
desc 'Enman provider for Enman Repositories'
|
||||
|
||||
commands({:enman => "enman"})
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
commands(enman: 'enman')
|
||||
|
||||
mk_resource_methods
|
||||
|
||||
|
||||
def create
|
||||
enman("add", resource[:name])
|
||||
@property_hash[:ensure] = :present
|
||||
enman('add', resource[:name])
|
||||
@property_hash[:ensure] = :present
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
enman("remove", resource[:name])
|
||||
@property_hash[:ensure] = :absent
|
||||
enman('remove', resource[:name])
|
||||
@property_hash[:ensure] = :absent
|
||||
end
|
||||
|
||||
|
||||
def exists?
|
||||
@property_hash[:ensure] == :present
|
||||
end
|
||||
|
||||
def self.instances
|
||||
all_installed = enman("list", "--quiet", "--installed").chomp.split
|
||||
all_available = enman("list", "--quiet", "--available").chomp.split
|
||||
all_installed = enman('list', '--quiet', '--installed').chomp.split
|
||||
all_available = enman('list', '--quiet', '--available').chomp.split
|
||||
|
||||
all_available.collect do |available_repo|
|
||||
all_available.map do |available_repo|
|
||||
repo = {
|
||||
:name => available_repo,
|
||||
:ensure => all_installed.include?(available_repo) ? :present : :absent,
|
||||
:provider => :enman_repo,
|
||||
name: available_repo,
|
||||
ensure: all_installed.include?(available_repo) ? :present : :absent,
|
||||
provider: :enman_repo,
|
||||
}
|
||||
|
||||
Puppet.debug(repo)
|
||||
new(repo)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def self.prefetch(resources)
|
||||
available_repos = self.instances()
|
||||
available_repos = instances
|
||||
|
||||
resources.each do |name, resource|
|
||||
if provider = available_repos.find { |r| r.name == name }
|
||||
resources.each do |name, _resource|
|
||||
provider = available_repos.find { |r| r.name == name }
|
||||
if provider
|
||||
resources[name].provider = provider
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
@@ -1,41 +1,55 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
file = "/etc/entropy/packages/package.keywords"
|
||||
file = '/etc/entropy/packages/package.keywords'
|
||||
|
||||
Puppet::Type.type(:entropy_keywords).provide(:parsed,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => file,
|
||||
:filetype => :flat
|
||||
) do
|
||||
parent: Puppet::Provider::ParsedFile,
|
||||
default_target: file,
|
||||
filetype: :flat) do
|
||||
|
||||
desc "Override keywords for entropy packages"
|
||||
desc 'Override keywords for entropy packages'
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
text_line :blank,
|
||||
:match => /^\s*$/
|
||||
match: %r{^\s*$}
|
||||
|
||||
text_line :comment,
|
||||
:match => /^\s*#/
|
||||
match: %r{^\s*#}
|
||||
|
||||
text_line :unmanaged,
|
||||
:match => %r{^(\S+)\s+([<>]?=)?(?:((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?)?(?:\s*repo=([a-zA-Z0-9\._-]+))?\s*$}
|
||||
match: %r{
|
||||
^(\S+)\s+([<>]?=)?
|
||||
(?:
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
)?
|
||||
(?:\s*repo=([a-zA-Z0-9\._-]+))?
|
||||
\s*$
|
||||
}x
|
||||
|
||||
record_line :parsed,
|
||||
:fields => %w{keyword operator package version repo name},
|
||||
:match => %r{^(\S+)\s+([<>]?=)?(?:((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?)?(?:\s*repo=([a-zA-Z0-9\._-]+))?\s+## Puppet Name: (.*)\s*$},
|
||||
:to_line => proc { |record|
|
||||
line = record[:keyword] + " "
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += "-" + record[:version] if record[:version]
|
||||
line += " " if record[:package] && record[:repo]
|
||||
line += "repo=" + record[:repo] if record[:repo]
|
||||
line += " ## Puppet Name: " + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
fields: ['keyword', 'operator', 'package', 'version', 'repo', 'name'],
|
||||
match: %r{
|
||||
^(\S+)\s+([<>]?=)?
|
||||
(?:
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
)?
|
||||
(?:\s*repo=([a-zA-Z0-9\._-]+))?
|
||||
\s+\#+\s+Puppet\s+Name:\s+(.*)
|
||||
\s*$
|
||||
}x,
|
||||
to_line: proc { |record|
|
||||
line = record[:keyword] + ' '
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += '-' + record[:version] if record[:version]
|
||||
line += ' ' if record[:package] && record[:repo]
|
||||
line += 'repo=' + record[:repo] if record[:repo]
|
||||
line += ' ## Puppet Name: ' + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
@@ -1,43 +1,57 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
masks = "/etc/entropy/packages/package.mask"
|
||||
masks = '/etc/entropy/packages/package.mask'
|
||||
|
||||
Puppet::Type.type(:entropy_mask).provide(:parsed,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => masks,
|
||||
:filetype => :flat
|
||||
) do
|
||||
parent: Puppet::Provider::ParsedFile,
|
||||
default_target: masks,
|
||||
filetype: :flat) do
|
||||
|
||||
desc "File mask provider for entropy packages"
|
||||
desc 'File mask provider for entropy packages'
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
text_line :blank,
|
||||
:match => /^\s*$/
|
||||
match: %r{^\s*$}
|
||||
|
||||
text_line :comment,
|
||||
:match => /^\s*#/
|
||||
match: %r{^\s*#}
|
||||
|
||||
text_line :unmanaged,
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9._-]+))?(?:::([a-zA-Z0-9\._-]+))?\s*$}
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9._-]+))?
|
||||
(?:::([a-zA-Z0-9\._-]+))?\s*$
|
||||
}x
|
||||
|
||||
record_line :parsed,
|
||||
:fields => %w{operator package version slot use tag repo name},
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9._-]+))?(?:::([a-zA-Z0-9\._-]+))?\s+#+ Puppet Name: (.*)\s*$},
|
||||
:to_line => proc { |record|
|
||||
line = ""
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += "-" + record[:version] if record[:version]
|
||||
line += ":" + record[:slot] if record[:slot]
|
||||
line += "[" + record[:use] + "]" if record[:use]
|
||||
line += "#" + record[:tag] if record[:tag]
|
||||
line += "::" + record[:repo] if record[:repo]
|
||||
line += " ## Puppet Name: " + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
fields: ['operator', 'package', 'version', 'slot', 'use', 'tag', 'repo', 'name'],
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9._-]+))?
|
||||
(?:::([a-zA-Z0-9\._-]+))?
|
||||
\s+\#+\s+Puppet\s+Name:\s+(.*)\s*$
|
||||
}x,
|
||||
to_line: proc { |record|
|
||||
line = ''
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += '-' + record[:version] if record[:version]
|
||||
line += ':' + record[:slot] if record[:slot]
|
||||
line += '[' + record[:use] + ']' if record[:use]
|
||||
line += '#' + record[:tag] if record[:tag]
|
||||
line += '::' + record[:repo] if record[:repo]
|
||||
line += ' ## Puppet Name: ' + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
71
lib/puppet/provider/entropy_repo/file.rb
Normal file
71
lib/puppet/provider/entropy_repo/file.rb
Normal file
@@ -0,0 +1,71 @@
|
||||
Puppet::Type.type(:entropy_repo).provide(:file) do
|
||||
desc 'File provider for Entropy Repositories'
|
||||
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
mk_resource_methods
|
||||
|
||||
def type_prefix
|
||||
if @property_hash[:repo_type] == 'enman'
|
||||
'enman_'
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
def enabled=(value)
|
||||
enabled_filename = "/etc/entropy/repositories.conf.d/entropy_#{type_prefix}#{@property_hash[:name]}"
|
||||
disabled_filename = "/etc/entropy/repositories.conf.d/_entropy_#{type_prefix}#{@property_hash[:name]}"
|
||||
|
||||
if ['true', :true].include?(value)
|
||||
if File.exist?(disabled_filename)
|
||||
File.rename(disabled_filename, enabled_filename)
|
||||
end
|
||||
elsif File.exist?(enabled_filename)
|
||||
File.rename(enabled_filename, disabled_filename)
|
||||
end
|
||||
|
||||
@property_hash[:enabled] = value
|
||||
end
|
||||
|
||||
def self.instances
|
||||
repos = Dir.entries('/etc/entropy/repositories.conf.d/')
|
||||
|
||||
repos.map { |r|
|
||||
if ['.', '..'].include?(r)
|
||||
nil
|
||||
elsif r =~ %r{\.example$}
|
||||
nil
|
||||
elsif r !~ %r{^_?entropy_}
|
||||
nil
|
||||
else
|
||||
matches = %r{^(_)?entropy_(enman_)?(.*)$}.match(r)
|
||||
enabled = matches[1].nil? ? 'true' : 'false'
|
||||
type = (matches[2] == 'enman_') ? 'enman' : 'entropy'
|
||||
name = matches[3]
|
||||
|
||||
repo = {
|
||||
name: name,
|
||||
repo_type: type,
|
||||
enabled: enabled,
|
||||
provider: :entropy_repo,
|
||||
}
|
||||
|
||||
new(repo)
|
||||
end
|
||||
}.compact
|
||||
end
|
||||
|
||||
def self.prefetch(resources)
|
||||
repos = instances
|
||||
|
||||
resources.each do |name, _resource|
|
||||
provider = repos.find { |r| r.name == name }
|
||||
if provider
|
||||
resources[name].provider = provider
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
@@ -1,43 +1,59 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
file = "/etc/entropy/packages/package.splitdebug"
|
||||
file = '/etc/entropy/packages/package.splitdebug'
|
||||
|
||||
Puppet::Type.type(:entropy_splitdebug).provide(:parsed,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => file,
|
||||
:filetype => :flat
|
||||
) do
|
||||
parent: Puppet::Provider::ParsedFile,
|
||||
default_target: file,
|
||||
filetype: :flat) do
|
||||
|
||||
desc "File splitdebug provider for entropy packages"
|
||||
desc 'File splitdebug provider for entropy packages'
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
text_line :blank,
|
||||
:match => /^\s*$/
|
||||
match: %r{^\s*$}
|
||||
|
||||
text_line :comment,
|
||||
:match => /^\s*#/
|
||||
match: %r{^\s*#}
|
||||
|
||||
text_line :unmanaged,
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9\._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9\._-]+))?(?:::([a-zA-Z0-9\._-]+))?\s*$}
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9\._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9\._-]+))?
|
||||
(?:::([a-zA-Z0-9\._-]+))?
|
||||
\s*$
|
||||
}x
|
||||
|
||||
record_line :parsed,
|
||||
:fields => %w{operator package version slot use tag repo name},
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9\._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9\._-]+))?(?:::([a-zA-Z0-9\._-]+))?\s+#+ Puppet Name: (.*)\s*$},
|
||||
:to_line => proc { |record|
|
||||
line = ""
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += "-" + record[:version] if record[:version]
|
||||
line += ":" + record[:slot] if record[:slot]
|
||||
line += "[" + record[:use] + "]" if record[:use]
|
||||
line += "#" + record[:tag] if record[:tag]
|
||||
line += "::" + record[:repo] if record[:repo]
|
||||
line += " ## Puppet Name: " + record[:name]
|
||||
fields: ['operator', 'package', 'version', 'slot', 'use', 'tag', 'repo', 'name'],
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9\._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9\._-]+))?
|
||||
(?:::([a-zA-Z0-9\._-]+))?
|
||||
\s+\#+\s+Puppet\s+Name:\s+(.*)
|
||||
\s*$
|
||||
}x,
|
||||
to_line: proc { |record|
|
||||
line = ''
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += '-' + record[:version] if record[:version]
|
||||
line += ':' + record[:slot] if record[:slot]
|
||||
line += '[' + record[:use] + ']' if record[:use]
|
||||
line += '#' + record[:tag] if record[:tag]
|
||||
line += '::' + record[:repo] if record[:repo]
|
||||
line += ' ## Puppet Name: ' + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
|
||||
line
|
||||
}
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
@@ -1,43 +1,58 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
file = "/etc/entropy/packages/package.splitdebug.mask"
|
||||
file = '/etc/entropy/packages/package.splitdebug.mask'
|
||||
|
||||
Puppet::Type.type(:entropy_splitdebug_mask).provide(:parsed,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => file,
|
||||
:filetype => :flat
|
||||
) do
|
||||
parent: Puppet::Provider::ParsedFile,
|
||||
default_target: file,
|
||||
filetype: :flat) do
|
||||
|
||||
desc "File splitdebug mask provider for entropy packages"
|
||||
desc 'File splitdebug mask provider for entropy packages'
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
text_line :blank,
|
||||
:match => /^\s*$/
|
||||
match: %r{^\s*$}
|
||||
|
||||
text_line :comment,
|
||||
:match => /^\s*#/
|
||||
match: %r{^\s*#}
|
||||
|
||||
text_line :unmanaged,
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9\._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9._-]+))?(?:::([a-zA-Z0-9._-]+))?\s*$}
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9\._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9._-]+))?
|
||||
(?:::([a-zA-Z0-9._-]+))?
|
||||
\s*$
|
||||
}x
|
||||
|
||||
record_line :parsed,
|
||||
:fields => %w{operator package version slot use tag repo name},
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9._-]+))?(?:::([a-zA-Z0-9._-]+))?\s+#+ Puppet Name: (.*)\s*$},
|
||||
:to_line => proc { |record|
|
||||
line = ""
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += "-" + record[:version] if record[:version]
|
||||
line += ":" + record[:slot] if record[:slot]
|
||||
line += "[" + record[:use] + "]" if record[:use]
|
||||
line += "#" + record[:tag] if record[:tag]
|
||||
line += "::" + record[:repo] if record[:repo]
|
||||
line += " ## Puppet Name: " + record[:name]
|
||||
fields: ['operator', 'package', 'version', 'slot', 'use', 'tag', 'repo', 'name'],
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9._-]+))?(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9._-]+))?
|
||||
(?:::([a-zA-Z0-9._-]+))?
|
||||
\s+\#+\s+Puppet\s+Name:\s+(.*)
|
||||
\s*$
|
||||
}x,
|
||||
to_line: proc { |record|
|
||||
line = ''
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += '-' + record[:version] if record[:version]
|
||||
line += ':' + record[:slot] if record[:slot]
|
||||
line += '[' + record[:use] + ']' if record[:use]
|
||||
line += '#' + record[:tag] if record[:tag]
|
||||
line += '::' + record[:repo] if record[:repo]
|
||||
line += ' ## Puppet Name: ' + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
|
||||
line
|
||||
}
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
@@ -1,43 +1,59 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
unmasks = "/etc/entropy/packages/package.unmask"
|
||||
unmasks = '/etc/entropy/packages/package.unmask'
|
||||
|
||||
Puppet::Type.type(:entropy_unmask).provide(:parsed,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => unmasks,
|
||||
:filetype => :flat
|
||||
) do
|
||||
parent: Puppet::Provider::ParsedFile,
|
||||
default_target: unmasks,
|
||||
filetype: :flat) do
|
||||
|
||||
desc "File unmask provider for entropy packages"
|
||||
desc 'File unmask provider for entropy packages'
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
defaultfor operatingsystem: :sabayon
|
||||
|
||||
text_line :blank,
|
||||
:match => /^\s*$/
|
||||
match: %r{^\s*$}
|
||||
|
||||
text_line :comment,
|
||||
:match => /^\s*#/
|
||||
match: %r{^\s*#}
|
||||
|
||||
text_line :unmanaged,
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9._-]+))?(?:::([a-zA-Z0-9._-]+))?\s*$}
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9._-]+))?
|
||||
(?:::([a-zA-Z0-9._-]+))?
|
||||
\s*$
|
||||
}x
|
||||
|
||||
record_line :parsed,
|
||||
:fields => %w{operator package version slot use tag repo name},
|
||||
:match => %r{^([<>]?=)?((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?(?::([a-zA-Z0-9._-]+))?(?:\[([^\]]*)\])?(?:#([a-zA-Z0-9._-]+))?(?:::([a-zA-Z0-9._-]+))?\s+#+ Puppet Name: (.*)\s*$},
|
||||
:to_line => proc { |record|
|
||||
line = ""
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += "-" + record[:version] if record[:version]
|
||||
line += ":" + record[:slot] if record[:slot]
|
||||
line += "[" + record[:use] + "]" if record[:use]
|
||||
line += "#" + record[:tag] if record[:tag]
|
||||
line += "::" + record[:repo] if record[:repo]
|
||||
line += " ## Puppet Name: " + record[:name]
|
||||
fields: ['operator', 'package', 'version', 'slot', 'use', 'tag', 'repo', 'name'],
|
||||
match: %r{
|
||||
^([<>]?=)?
|
||||
((?:[A-Za-z0-9+_.-]+/)?[a-zA-Z0-9+_-]+)?
|
||||
(?:-(\d+(?:\.\d+)*[a-z]*(?:_(?:alpha|beta|pre|p|rc)\d*)?(?:-r\d+)?))?
|
||||
(?::([a-zA-Z0-9._-]+))?
|
||||
(?:\[([^\]]*)\])?
|
||||
(?:\#([a-zA-Z0-9._-]+))?
|
||||
(?:::([a-zA-Z0-9._-]+))?
|
||||
\s+\#+\s+Puppet\s+Name:\s+(.*)
|
||||
\s*$
|
||||
}x,
|
||||
to_line: proc { |record|
|
||||
line = ''
|
||||
line += record[:operator] if record[:operator]
|
||||
line += record[:package] if record[:package]
|
||||
line += '-' + record[:version] if record[:version]
|
||||
line += ':' + record[:slot] if record[:slot]
|
||||
line += '[' + record[:use] + ']' if record[:use]
|
||||
line += '#' + record[:tag] if record[:tag]
|
||||
line += '::' + record[:repo] if record[:repo]
|
||||
line += ' ## Puppet Name: ' + record[:name]
|
||||
|
||||
line
|
||||
}
|
||||
|
||||
line
|
||||
}
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'puppet/provider/package'
|
||||
require 'fileutils'
|
||||
|
||||
Puppet::Type.type(:package).provide :entropy, :parent => Puppet::Provider::Package do
|
||||
Puppet::Type.type(:package).provide(:entropy, parent: Puppet::Provider::Package) do
|
||||
desc "Provides packaging support for Sabayon's entropy system."
|
||||
|
||||
has_feature :versionable
|
||||
@@ -9,47 +9,61 @@ Puppet::Type.type(:package).provide :entropy, :parent => Puppet::Provider::Packa
|
||||
has_feature :uninstallable
|
||||
has_feature :upgradeable
|
||||
|
||||
commands :equo => "#{File.dirname(__FILE__)}/entropy/equo_locale"
|
||||
has_command(:equo, 'equo') do
|
||||
locale = Facter.value(:locale)
|
||||
environment(LANG: locale,
|
||||
LC_ALL: locale,
|
||||
LANGUAHE: locale)
|
||||
end
|
||||
|
||||
confine :has_entropy => true
|
||||
|
||||
defaultfor :has_entropy => :true, :osfamily => :Gentoo
|
||||
# Require the locale fact exist
|
||||
confine false: Facter.value(:locale).nil?
|
||||
confine osfamily: :Gentoo
|
||||
|
||||
defaultfor operatingsystem: :Sabayon
|
||||
|
||||
def self.instances
|
||||
result_format = /^(\S+)\/(\S+)-([\.\d]+(?:_?(?:a(?:lpha)?|b(?:eta)?|pre|rc|p)\d*)?(?:-r\d+)?)(?:#(\S+))?$/
|
||||
result_fields = [:category, :name, :ensure]
|
||||
result_format = %r{
|
||||
^(\S+)\/(\S+)-([\.\d]+[a-z]?(?:_(?:alpha|beta|pre|pre_pre|rc|p)\d*)?
|
||||
(?:-r\d+)?)(?:\#(\S+))?$
|
||||
}x
|
||||
result_fields = [:category, :name, :ensure]
|
||||
|
||||
begin
|
||||
search_output = equo "query", "list", "installed", "--quiet", "--verbose"
|
||||
search_output = equo('query', 'list', 'installed', '--quiet', '--verbose').chomp
|
||||
|
||||
packages = []
|
||||
search_output.each_line do |search_result|
|
||||
match = result_format.match(search_result)
|
||||
|
||||
if match
|
||||
package = {}
|
||||
result_fields.zip(match.captures) do |field, value|
|
||||
package[field] = value unless !value or value.empty?
|
||||
end
|
||||
package[:provider] = :entropy
|
||||
packages << new(package)
|
||||
next unless match
|
||||
package = {}
|
||||
result_fields.zip(match.captures) do |field, value|
|
||||
package[field] = value unless !value || value.empty?
|
||||
end
|
||||
package[:provider] = :entropy
|
||||
|
||||
packages << new(package)
|
||||
end
|
||||
|
||||
return packages
|
||||
rescue Puppet::ExecutionFailure => detail
|
||||
raise Puppet::Error.new(detail)
|
||||
raise Puppet::Error, detail.message
|
||||
end
|
||||
end
|
||||
|
||||
def install
|
||||
should = @resource.should(:ensure)
|
||||
name = package_name
|
||||
unless should == :present or should == :latest
|
||||
unless [:present, :latest].include?(should)
|
||||
# We must install a specific version
|
||||
name = "=#{name}-#{should}"
|
||||
end
|
||||
equo "install", name
|
||||
begin
|
||||
equo 'install', name
|
||||
rescue Puppet::ExecutionFailure => detail
|
||||
raise Puppet::Error, detail.message
|
||||
end
|
||||
end
|
||||
|
||||
# The common package name format.
|
||||
@@ -62,37 +76,44 @@ Puppet::Type.type(:package).provide :entropy, :parent => Puppet::Provider::Packa
|
||||
end
|
||||
|
||||
def uninstall
|
||||
equo "remove", package_name
|
||||
equo 'remove', package_name
|
||||
rescue Puppet::ExecutionFailure => detail
|
||||
raise Puppet::Error, detail.message
|
||||
end
|
||||
|
||||
def update
|
||||
self.install
|
||||
install
|
||||
end
|
||||
|
||||
def query
|
||||
result_format = /^(\S+)\/(\S+)-([\.\d]+(?:_(?:alpha|beta|pre|rc|p)\d+)?(?:-r\d+)?)(?:#(\S+))?$/
|
||||
result_format = %r{
|
||||
^(\S+)\/(\S+)-([\.\d]+[a-z]?(?:_(?:alpha|beta|pre_pre|pre|rc|p)\d*)?(?:-r\d+)?)
|
||||
(?::[^\#]+)?(?:\#(\S+))?$
|
||||
}x
|
||||
result_fields = [:category, :name, :version_available]
|
||||
|
||||
begin
|
||||
# Look for an installed package from a known repository
|
||||
search_output = equo "match", "--quiet", "--verbose", package_name
|
||||
search_output.chomp
|
||||
search_output = equo('match', '--quiet', '--verbose', package_name).chomp
|
||||
|
||||
search_match = search_output.match(result_format)
|
||||
if search_match
|
||||
package = {}
|
||||
result_fields.zip(search_match.captures).each do |field, value|
|
||||
package[field] = value unless !value or value.empty?
|
||||
package[field] = value unless !value || value.empty?
|
||||
end
|
||||
|
||||
installed_output = equo 'match', '--quiet', '--verbose', '--installed', package_name
|
||||
installed_output.chomp
|
||||
installed_match = installed_output.match(result_format)
|
||||
begin
|
||||
installed_output = equo('match', '--quiet', '--verbose', '--installed', package_name).chomp
|
||||
installed_match = installed_output.match(result_format)
|
||||
|
||||
if installed_match
|
||||
installed_match_fields = Hash[result_fields.zip(installed_match.captures)]
|
||||
package[:ensure] = installed_match_fields[:version_available]
|
||||
else
|
||||
if installed_match
|
||||
installed_match_fields = Hash[result_fields.zip(installed_match.captures)]
|
||||
package[:ensure] = installed_match_fields[:version_available]
|
||||
else
|
||||
package[:ensure] = :absent
|
||||
end
|
||||
rescue Puppet::ExecutionFailure
|
||||
package[:ensure] = :absent
|
||||
end
|
||||
|
||||
@@ -101,39 +122,34 @@ Puppet::Type.type(:package).provide :entropy, :parent => Puppet::Provider::Packa
|
||||
else
|
||||
# List all installed packages and try and find if it's installed from outside a repository
|
||||
# If so, assume the installed version is the latest available
|
||||
all_installed = equo "query", "list", "installed", "--quiet", "--verbose"
|
||||
all_installed.chomp
|
||||
all_installed = equo('query', 'list', 'installed', '--quiet', '--verbose').chomp
|
||||
|
||||
all_installed.split("\n").each do |installed_package|
|
||||
|
||||
search_match = installed_package.match(result_format)
|
||||
if search_match
|
||||
search_captures = search_match.captures
|
||||
|
||||
if (search_captures[0] == @resource[:category] and search_captures[1] == @resource[:name]) or "#{search_captures[0]}/#{search_captures[1]}" == package_name
|
||||
next unless search_match
|
||||
search_captures = search_match.captures
|
||||
|
||||
package = {
|
||||
:ensure => search_captures[2]
|
||||
}
|
||||
next unless (search_captures[0] == (@resource[:category]) && search_captures[1] == (@resource[:name])) || package_name == "#{search_captures[0]}/#{search_captures[1]}"
|
||||
|
||||
result_fields.zip(search_captures).each do |field, value|
|
||||
package[field] = value unless !value or value.empty?
|
||||
end
|
||||
package = {
|
||||
ensure: search_captures[2],
|
||||
}
|
||||
|
||||
return package
|
||||
|
||||
end
|
||||
result_fields.zip(search_captures).each do |field, value|
|
||||
package[field] = value unless !value || value.empty?
|
||||
end
|
||||
|
||||
return package
|
||||
end
|
||||
|
||||
raise Puppet::Error.new("No package found with the specified name [#{package_name}]")
|
||||
raise Puppet::Error, "No package found with the specified name [#{package_name}]"
|
||||
end
|
||||
rescue Puppet::ExecutionFailure => detail
|
||||
raise Puppet::Error.new(detail)
|
||||
raise Puppet::Error, detail.message
|
||||
end
|
||||
end
|
||||
|
||||
def latest
|
||||
self.query[:version_available]
|
||||
query[:version_available]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /etc/profile
|
||||
/usr/bin/equo $@
|
||||
|
||||
exit 0
|
||||
@@ -1,8 +1,7 @@
|
||||
# Manage systemd services using /bin/systemctl
|
||||
|
||||
Puppet::Type.type(:service).provide :sabayon, :parent => :systemd do
|
||||
desc "Manages `systemd` services using `systemctl`."
|
||||
|
||||
defaultfor :operatingsystem => :sabayon
|
||||
Puppet::Type.type(:service).provide :sabayon, parent: :systemd do
|
||||
desc 'Manages `systemd` services using `systemctl`.'
|
||||
|
||||
defaultfor operatingsystem: :sabayon
|
||||
end
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
Puppet::Type.newtype(:enman_repo) do
|
||||
@desc = "Manages Sabayon Community Repositories"
|
||||
|
||||
@desc = 'Manages Sabayon Community Repositories'
|
||||
|
||||
ensurable
|
||||
|
||||
|
||||
newparam(:name) do
|
||||
desc "Name of the Enman Repository"
|
||||
desc 'Name of the Enman Repository'
|
||||
isnamevar
|
||||
end
|
||||
|
||||
autorequire(:package) do
|
||||
['enman']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
Puppet::Type.newtype(:entropy_keywords) do
|
||||
@desc = "Override keywords for Entropy packages"
|
||||
|
||||
@desc = 'Override keywords for Entropy packages'
|
||||
|
||||
ensurable
|
||||
|
||||
|
||||
newparam(:name) do
|
||||
desc "Unique name for this keyword entry"
|
||||
desc 'Unique name for this keyword entry'
|
||||
end
|
||||
|
||||
newproperty(:keyword) do
|
||||
desc "Keyword to be applied to matching packages"
|
||||
desc 'Keyword to be applied to matching packages'
|
||||
|
||||
defaultto {
|
||||
defaultto do
|
||||
os = Facter.value(:os)
|
||||
if os.key?('architecture')
|
||||
os['architecture']
|
||||
else
|
||||
'**'
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
newproperty(:operator) do
|
||||
@@ -25,35 +25,35 @@ Puppet::Type.newtype(:entropy_keywords) do
|
||||
end
|
||||
|
||||
newproperty(:package) do
|
||||
desc "Name of the package being keyworded"
|
||||
desc 'Name of the package being keyworded'
|
||||
newvalues(%r{^(?:[A-Za-z0-9+_.-]+\/)?[a-zA-Z0-9+_-]+$})
|
||||
end
|
||||
|
||||
newproperty(:version) do
|
||||
desc "Version of the package"
|
||||
desc 'Version of the package'
|
||||
newvalues(%r{^(\d*(?:\.\d+[a-zA-Z]*)*)(?:_((?:alpha|beta|pre|rc)\d*))?(-r\d+)?$})
|
||||
end
|
||||
|
||||
newproperty(:repo) do
|
||||
desc "Repo for the package"
|
||||
desc 'Repo for the package'
|
||||
end
|
||||
|
||||
newproperty(:target) do
|
||||
desc "Location of the package.keywords file being managed"
|
||||
desc 'Location of the package.keywords file being managed'
|
||||
|
||||
defaultto {
|
||||
defaultto do
|
||||
if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
||||
@resource.class.defaultprovider.default_target
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
validate do
|
||||
raise(ArgumentError, "Package is required when a version is specified") if self[:package].nil? && !self[:version].nil?
|
||||
raise(ArgumentError, 'Package is required when a version is specified') if self[:package].nil? && !self[:version].nil?
|
||||
|
||||
raise(ArgumentError, "Version is required when an operator is specified") if self[:version].nil? && !self[:operator].nil?
|
||||
raise(ArgumentError, 'Version is required when an operator is specified') if self[:version].nil? && !self[:operator].nil?
|
||||
end
|
||||
|
||||
autobefore(:package) do
|
||||
@@ -62,4 +62,3 @@ Puppet::Type.newtype(:entropy_keywords) do
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 expandtab:
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Puppet::Type.newtype(:entropy_mask) do
|
||||
@desc = "Mask packages in Entropy"
|
||||
|
||||
@desc = 'Mask packages in Entropy'
|
||||
|
||||
ensurable
|
||||
|
||||
|
||||
newparam(:name) do
|
||||
desc "Unique name for this mask"
|
||||
desc 'Unique name for this mask'
|
||||
end
|
||||
|
||||
newproperty(:operator) do
|
||||
@@ -12,47 +12,47 @@ Puppet::Type.newtype(:entropy_mask) do
|
||||
end
|
||||
|
||||
newproperty(:package) do
|
||||
desc "Name of the package being masked"
|
||||
desc 'Name of the package being masked'
|
||||
newvalues(%r{^(?:[A-Za-z0-9+_.-]+\/)?[a-zA-Z0-9+_-]+$})
|
||||
end
|
||||
|
||||
newproperty(:version) do
|
||||
desc "Version of the package"
|
||||
desc 'Version of the package'
|
||||
newvalues(%r{^(\d*(?:\.\d+[a-zA-Z]*)*)(?:_((?:alpha|beta|pre|rc)\d*))?(-r\d+)?$})
|
||||
end
|
||||
|
||||
newproperty(:slot) do
|
||||
desc "Slot the package is in"
|
||||
desc 'Slot the package is in'
|
||||
end
|
||||
|
||||
newproperty(:use) do
|
||||
desc "Useflags for the package"
|
||||
desc 'Useflags for the package'
|
||||
end
|
||||
|
||||
newproperty(:tag) do
|
||||
desc "Tag for the package"
|
||||
desc 'Tag for the package'
|
||||
end
|
||||
|
||||
newproperty(:repo) do
|
||||
desc "Repo for the package"
|
||||
desc 'Repo for the package'
|
||||
end
|
||||
|
||||
newproperty(:target) do
|
||||
desc "Location of the package.mask file being managed"
|
||||
desc 'Location of the package.mask file being managed'
|
||||
|
||||
defaultto {
|
||||
defaultto do
|
||||
if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
||||
@resource.class.defaultprovider.default_target
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
validate do
|
||||
raise(ArgumentError, "Package is required when a version is specified") if self[:package].nil? && !self[:version].nil?
|
||||
raise(ArgumentError, 'Package is required when a version is specified') if self[:package].nil? && !self[:version].nil?
|
||||
|
||||
raise(ArgumentError, "Version is required when an operator is specified") if self[:version].nil? && !self[:operator].nil?
|
||||
raise(ArgumentError, 'Version is required when an operator is specified') if self[:version].nil? && !self[:operator].nil?
|
||||
end
|
||||
|
||||
autobefore(:package) do
|
||||
@@ -61,4 +61,3 @@ Puppet::Type.newtype(:entropy_mask) do
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 expandtab:
|
||||
|
||||
|
||||
20
lib/puppet/type/entropy_repo.rb
Normal file
20
lib/puppet/type/entropy_repo.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'puppet/property/boolean'
|
||||
|
||||
Puppet::Type.newtype(:entropy_repo) do
|
||||
@desc = 'Manages Entropy Repositories'
|
||||
|
||||
newparam(:name) do
|
||||
desc 'Name of the Entropy Repository'
|
||||
end
|
||||
|
||||
newproperty(:repo_type, readonly: true) do
|
||||
desc 'What type of repository this is (enman or entropy)'
|
||||
end
|
||||
|
||||
newproperty(:enabled) do
|
||||
desc 'Whether the repository is enabled or not'
|
||||
newvalues('true', 'false')
|
||||
end
|
||||
end
|
||||
|
||||
# vim: set ts=2 shiftwidth=2 expandtab :
|
||||
@@ -1,10 +1,10 @@
|
||||
Puppet::Type.newtype(:entropy_splitdebug) do
|
||||
@desc = "Manages splitdebug for packages in Entropy"
|
||||
|
||||
@desc = 'Manages splitdebug for packages in Entropy'
|
||||
|
||||
ensurable
|
||||
|
||||
|
||||
newparam(:name) do
|
||||
desc "Unique name for this splitdebug specification"
|
||||
desc 'Unique name for this splitdebug specification'
|
||||
end
|
||||
|
||||
newproperty(:operator) do
|
||||
@@ -12,47 +12,47 @@ Puppet::Type.newtype(:entropy_splitdebug) do
|
||||
end
|
||||
|
||||
newproperty(:package) do
|
||||
desc "Name of the package with splitdebug"
|
||||
desc 'Name of the package with splitdebug'
|
||||
newvalues(%r{^(?:[A-Za-z0-9+_.-]+\/)?[a-zA-Z0-9+_-]+$})
|
||||
end
|
||||
|
||||
newproperty(:version) do
|
||||
desc "Version of the package"
|
||||
desc 'Version of the package'
|
||||
newvalues(%r{^(\d*(?:\.\d+[a-zA-Z]*)*)(?:_((?:alpha|beta|pre|rc)\d*))?(-r\d+)?$})
|
||||
end
|
||||
|
||||
newproperty(:slot) do
|
||||
desc "Slot the package is in"
|
||||
desc 'Slot the package is in'
|
||||
end
|
||||
|
||||
newproperty(:use) do
|
||||
desc "Useflags for the package"
|
||||
desc 'Useflags for the package'
|
||||
end
|
||||
|
||||
newproperty(:tag) do
|
||||
desc "Tag for the package"
|
||||
desc 'Tag for the package'
|
||||
end
|
||||
|
||||
newproperty(:repo) do
|
||||
desc "Repo for the package"
|
||||
desc 'Repo for the package'
|
||||
end
|
||||
|
||||
newproperty(:target) do
|
||||
desc "Location of the package.splitdebug file being managed"
|
||||
desc 'Location of the package.splitdebug file being managed'
|
||||
|
||||
defaultto {
|
||||
defaultto do
|
||||
if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
||||
@resource.class.defaultprovider.default_target
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
validate do
|
||||
raise(ArgumentError, "Package is required when a version is specified") if self[:package].nil? && !self[:version].nil?
|
||||
raise(ArgumentError, 'Package is required when a version is specified') if self[:package].nil? && !self[:version].nil?
|
||||
|
||||
raise(ArgumentError, "Version is required when an operator is specified") if self[:version].nil? && !self[:operator].nil?
|
||||
raise(ArgumentError, 'Version is required when an operator is specified') if self[:version].nil? && !self[:operator].nil?
|
||||
end
|
||||
|
||||
autobefore(:package) do
|
||||
@@ -61,4 +61,3 @@ Puppet::Type.newtype(:entropy_splitdebug) do
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 expandtab:
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Puppet::Type.newtype(:entropy_splitdebug_mask) do
|
||||
@desc = "Manages splitdebug masks for packages in Entropy"
|
||||
|
||||
@desc = 'Manages splitdebug masks for packages in Entropy'
|
||||
|
||||
ensurable
|
||||
|
||||
|
||||
newparam(:name) do
|
||||
desc "Unique name for this splitdebug mask specification"
|
||||
desc 'Unique name for this splitdebug mask specification'
|
||||
end
|
||||
|
||||
newproperty(:operator) do
|
||||
@@ -12,47 +12,47 @@ Puppet::Type.newtype(:entropy_splitdebug_mask) do
|
||||
end
|
||||
|
||||
newproperty(:package) do
|
||||
desc "Name of the package with splitdebug mask"
|
||||
desc 'Name of the package with splitdebug mask'
|
||||
newvalues(%r{^(?:[A-Za-z0-9+_.-]+\/)?[a-zA-Z0-9+_-]+$})
|
||||
end
|
||||
|
||||
newproperty(:version) do
|
||||
desc "Version of the package"
|
||||
desc 'Version of the package'
|
||||
newvalues(%r{^(\d*(?:\.\d+[a-zA-Z]*)*)(?:_((?:alpha|beta|pre|rc)\d*))?(-r\d+)?$})
|
||||
end
|
||||
|
||||
newproperty(:slot) do
|
||||
desc "Slot the package is in"
|
||||
desc 'Slot the package is in'
|
||||
end
|
||||
|
||||
newproperty(:use) do
|
||||
desc "Useflags for the package"
|
||||
desc 'Useflags for the package'
|
||||
end
|
||||
|
||||
newproperty(:tag) do
|
||||
desc "Tag for the package"
|
||||
desc 'Tag for the package'
|
||||
end
|
||||
|
||||
newproperty(:repo) do
|
||||
desc "Repo for the package"
|
||||
desc 'Repo for the package'
|
||||
end
|
||||
|
||||
newproperty(:target) do
|
||||
desc "Location of the package.splitdebug.mask file being managed"
|
||||
desc 'Location of the package.splitdebug.mask file being managed'
|
||||
|
||||
defaultto {
|
||||
defaultto do
|
||||
if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
||||
@resource.class.defaultprovider.default_target
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
validate do
|
||||
raise(ArgumentError, "Package is required when a version is specified") if self[:package].nil? && !self[:version].nil?
|
||||
raise(ArgumentError, 'Package is required when a version is specified') if self[:package].nil? && !self[:version].nil?
|
||||
|
||||
raise(ArgumentError, "Version is required when an operator is specified") if self[:version].nil? && !self[:operator].nil?
|
||||
raise(ArgumentError, 'Version is required when an operator is specified') if self[:version].nil? && !self[:operator].nil?
|
||||
end
|
||||
|
||||
autobefore(:package) do
|
||||
@@ -61,4 +61,3 @@ Puppet::Type.newtype(:entropy_splitdebug_mask) do
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 expandtab:
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Puppet::Type.newtype(:entropy_unmask) do
|
||||
@desc = "Unmask packages in Entropy"
|
||||
|
||||
@desc = 'Unmask packages in Entropy'
|
||||
|
||||
ensurable
|
||||
|
||||
|
||||
newparam(:name) do
|
||||
desc "Unique name for this unmask"
|
||||
desc 'Unique name for this unmask'
|
||||
end
|
||||
|
||||
newproperty(:operator) do
|
||||
@@ -12,47 +12,47 @@ Puppet::Type.newtype(:entropy_unmask) do
|
||||
end
|
||||
|
||||
newproperty(:package) do
|
||||
desc "Name of the package being masked"
|
||||
desc 'Name of the package being masked'
|
||||
newvalues(%r{^(?:[A-Za-z0-9+_.-]+\/)?[a-zA-Z0-9+_-]+$})
|
||||
end
|
||||
|
||||
newproperty(:version) do
|
||||
desc "Version of the package"
|
||||
desc 'Version of the package'
|
||||
newvalues(%r{^(\d*(?:\.\d+[a-zA-Z]*)*)(?:_((?:alpha|beta|pre|rc)\d*))?(-r\d+)?$})
|
||||
end
|
||||
|
||||
newproperty(:slot) do
|
||||
desc "Slot the package is in"
|
||||
desc 'Slot the package is in'
|
||||
end
|
||||
|
||||
newproperty(:use) do
|
||||
desc "Useflags for the package"
|
||||
desc 'Useflags for the package'
|
||||
end
|
||||
|
||||
newproperty(:tag) do
|
||||
desc "Tag for the package"
|
||||
desc 'Tag for the package'
|
||||
end
|
||||
|
||||
newproperty(:repo) do
|
||||
desc "Repo for the package"
|
||||
desc 'Repo for the package'
|
||||
end
|
||||
|
||||
newproperty(:target) do
|
||||
desc "Location of the package.unmask file being managed"
|
||||
desc 'Location of the package.unmask file being managed'
|
||||
|
||||
defaultto {
|
||||
defaultto do
|
||||
if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
||||
@resource.class.defaultprovider.default_target
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
validate do
|
||||
raise(ArgumentError, "Package is required when a version is specified") if self[:package].nil? && !self[:version].nil?
|
||||
raise(ArgumentError, 'Package is required when a version is specified') if self[:package].nil? && !self[:version].nil?
|
||||
|
||||
raise(ArgumentError, "Version is required when an operator is specified") if self[:version].nil? && !self[:operator].nil?
|
||||
raise(ArgumentError, 'Version is required when an operator is specified') if self[:version].nil? && !self[:operator].nil?
|
||||
end
|
||||
|
||||
autobefore(:package) do
|
||||
@@ -61,4 +61,3 @@ Puppet::Type.newtype(:entropy_unmask) do
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 expandtab:
|
||||
|
||||
|
||||
@@ -1,27 +1,39 @@
|
||||
{
|
||||
"name": "optiz0r-sabayon",
|
||||
"version": "0.1.1",
|
||||
"version": "0.6.1",
|
||||
"author": "Ben Roberts",
|
||||
"license": "MIT",
|
||||
"summary": "Extends Puppet with support for the Sabayon Linux distribution",
|
||||
"license": "MIT",
|
||||
"source": "https://github.com/Sabayon/puppet-sabayon.git",
|
||||
"project_page": "https://github.com/Sabayon/puppet-sabayon",
|
||||
"issues_url": "https://github.com/Sabayon/puppet-sabayon/issues",
|
||||
"tags": [
|
||||
"sabayon",
|
||||
"entropy"
|
||||
"dependencies": [
|
||||
|
||||
],
|
||||
"data_provider": "hiera",
|
||||
"operatingsystem_support": [
|
||||
{
|
||||
"operatingsystem": "Sabayon",
|
||||
"operatingsystemrelease": [
|
||||
"16.07",
|
||||
"16.11"
|
||||
"16.11",
|
||||
"19.03",
|
||||
"19.05",
|
||||
"19.10"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dependencies": [
|
||||
|
||||
"requirements": [
|
||||
{
|
||||
"name": "puppet",
|
||||
"version_requirement": ">= 4.10.0 < 7.0.0"
|
||||
}
|
||||
],
|
||||
"data_provider": "hiera"
|
||||
"tags": [
|
||||
"sabayon",
|
||||
"entropy"
|
||||
],
|
||||
"pdk-version": "1.10.0",
|
||||
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git#1.10.0",
|
||||
"template-ref": "1.10.0-0-gbba9ac3"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'spec_helper'
|
||||
describe 'sabayon' do
|
||||
context 'with default values for all parameters' do
|
||||
it { should contain_class('sabayon') }
|
||||
it { should contain_package('app-admin/enman') }
|
||||
it { is_expected.to contain_class('sabayon') }
|
||||
it { is_expected.to contain_package('app-admin/enman') }
|
||||
end
|
||||
end
|
||||
|
||||
7
spec/default_facts.yml
Normal file
7
spec/default_facts.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
# Use default_module_facts.yml for module specific facts.
|
||||
#
|
||||
# Facts specified here will override the values provided by rspec-puppet-facts.
|
||||
---
|
||||
ipaddress: "172.16.254.254"
|
||||
is_pe: false
|
||||
macaddress: "AA:AA:AA:AA:AA:AA"
|
||||
@@ -1 +1,48 @@
|
||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||
require 'rspec-puppet-facts'
|
||||
|
||||
require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb'))
|
||||
|
||||
include RspecPuppetFacts
|
||||
|
||||
default_facts = {
|
||||
puppetversion: Puppet.version,
|
||||
facterversion: Facter.version,
|
||||
}
|
||||
|
||||
default_fact_files = [
|
||||
File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')),
|
||||
File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')),
|
||||
]
|
||||
|
||||
default_fact_files.each do |f|
|
||||
next unless File.exist?(f) && File.readable?(f) && File.size?(f)
|
||||
|
||||
begin
|
||||
default_facts.merge!(YAML.safe_load(File.read(f), [], [], true))
|
||||
rescue => e
|
||||
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |c|
|
||||
c.mock_with :mocha
|
||||
c.default_facts = default_facts
|
||||
c.before :each do
|
||||
# set to strictest setting for testing
|
||||
# by default Puppet runs at warning level
|
||||
Puppet.settings[:strict] = :warning
|
||||
end
|
||||
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
|
||||
c.after(:suite) do
|
||||
end
|
||||
end
|
||||
|
||||
def ensure_module_defined(module_name)
|
||||
module_name.split('::').reduce(Object) do |last_module, next_module|
|
||||
last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false)
|
||||
last_module.const_get(next_module, false)
|
||||
end
|
||||
end
|
||||
|
||||
# 'spec_overrides' from sync.yml will appear below this line
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
before do
|
||||
let(:default_target) { described_class.default_target }
|
||||
|
||||
before(:each) do
|
||||
described_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
|
||||
described_class.stubs(:filetype=)
|
||||
@default_target = described_class.default_target
|
||||
end
|
||||
|
||||
describe 'should have a default target of /etc/entropy/packages/package.keywords' do
|
||||
@@ -14,7 +15,7 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
end
|
||||
|
||||
describe 'when parsing' do
|
||||
it 'should parse out the name' do
|
||||
it 'parses out the name' do
|
||||
line = '** app-admin/foobar ## Puppet Name: foobar'
|
||||
expect(described_class.parse_line(line)[:name]).to eq('foobar')
|
||||
end
|
||||
@@ -23,15 +24,15 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
line = '** app-admin/foobar ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the keyword' do
|
||||
it 'parses out the keyword' do
|
||||
expect(parsed[:keyword]).to eq('**')
|
||||
end
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -42,19 +43,19 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
line = '** app-admin/foobar-1.2.3_alpha1-r1 ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the keyword' do
|
||||
it 'parses out the keyword' do
|
||||
expect(parsed[:keyword]).to eq('**')
|
||||
end
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the version' do
|
||||
it 'parses out the version' do
|
||||
expect(parsed[:version]).to eq('1.2.3_alpha1-r1')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -65,23 +66,23 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
line = '** >=app-admin/foobar-1.2.3_alpha1-r1 ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the keyword' do
|
||||
it 'parses out the keyword' do
|
||||
expect(parsed[:keyword]).to eq('**')
|
||||
end
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the version' do
|
||||
it 'parses out the version' do
|
||||
expect(parsed[:version]).to eq('1.2.3_alpha1-r1')
|
||||
end
|
||||
|
||||
it 'should parse out the operator' do
|
||||
it 'parses out the operator' do
|
||||
expect(parsed[:operator]).to eq('>=')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -92,19 +93,19 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
line = '** app-admin/foobar repo=community ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the keyword' do
|
||||
it 'parses out the keyword' do
|
||||
expect(parsed[:keyword]).to eq('**')
|
||||
end
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the repo' do
|
||||
it 'parses out the repo' do
|
||||
expect(parsed[:repo]).to eq('community')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -115,15 +116,15 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
line = 'amd64 repo=community ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the keyword' do
|
||||
it 'parses out the keyword' do
|
||||
expect(parsed[:keyword]).to eq('amd64')
|
||||
end
|
||||
|
||||
it 'should parse out the repo' do
|
||||
it 'parses out the repo' do
|
||||
expect(parsed[:repo]).to eq('community')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:package, :operator, :version].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -135,99 +136,99 @@ describe Puppet::Type.type(:entropy_keywords).provider(:parsed) do
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
expected = {
|
||||
:name => 'foobar',
|
||||
:keyword => '**',
|
||||
:package => 'app-admin/foobar',
|
||||
:operator => '>=',
|
||||
:version => '1.2.3a_alpha1-r1',
|
||||
:repo => 'community',
|
||||
name: 'foobar',
|
||||
keyword: '**',
|
||||
package: 'app-admin/foobar',
|
||||
operator: '>=',
|
||||
version: '1.2.3a_alpha1-r1',
|
||||
repo: 'community',
|
||||
}
|
||||
|
||||
it 'should parse out all parameters' do
|
||||
it 'parses out all parameters' do
|
||||
expected.each do |param, value|
|
||||
expect(parsed[param]).to eq(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'when flushing' do
|
||||
describe 'when flushing' do
|
||||
let(:ramfile) { Puppet::Util::FileType::FileTypeRam.new(:default_target) }
|
||||
|
||||
before :each do
|
||||
@ramfile = Puppet::Util::FileType::FileTypeRam.new(@default_target)
|
||||
File.stubs(:exist?).with(@default_target).returns(true)
|
||||
described_class.any_instance.stubs(:target_object).returns(@ramfile)
|
||||
File.stubs(:exist?).with(:default_target).returns(true)
|
||||
described_class.stubs(:target_object).returns(:ramfile)
|
||||
end
|
||||
|
||||
after :each do
|
||||
described_class.clear
|
||||
end
|
||||
|
||||
it 'should output a single package entry' do
|
||||
it 'outputs a single package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:keyword => '**',
|
||||
:package => 'app-admin/foobar',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
keyword: '**',
|
||||
package: 'app-admin/foobar',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('** app-admin/foobar ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '** app-admin/foobar ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a versioned package entry' do
|
||||
it 'outputs a versioned package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:keyword => '**',
|
||||
:package => 'app-admin/foobar',
|
||||
:version => '1.2.3',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
keyword: '**',
|
||||
package: 'app-admin/foobar',
|
||||
version: '1.2.3',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('** app-admin/foobar-1.2.3 ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '** app-admin/foobar-1.2.3 ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a ranged versioned package entry' do
|
||||
it 'outputs a ranged versioned package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:keyword => '**',
|
||||
:package => 'app-admin/foobar',
|
||||
:version => '1.2.3',
|
||||
:operator => '>=',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
keyword: '**',
|
||||
package: 'app-admin/foobar',
|
||||
version: '1.2.3',
|
||||
operator: '>=',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('** >=app-admin/foobar-1.2.3 ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '** >=app-admin/foobar-1.2.3 ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a repo-specific package entry' do
|
||||
it 'outputs a repo-specific package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:keyword => '**',
|
||||
:package => 'app-admin/foobar',
|
||||
:repo => 'community',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
keyword: '**',
|
||||
package: 'app-admin/foobar',
|
||||
repo: 'community',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('** app-admin/foobar repo=community ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '** app-admin/foobar repo=community ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a whole-repo entry' do
|
||||
it 'outputs a whole-repo entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:keyword => '**',
|
||||
:repo => 'community',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
keyword: '**',
|
||||
repo: 'community',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('** repo=community ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '** repo=community ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output all fields for a package entry' do
|
||||
it 'outputs all fields for a package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:keyword => '**',
|
||||
:package => 'app-admin/foobar',
|
||||
:operator => '>=',
|
||||
:version => '1.2.3',
|
||||
:repo => 'community',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
keyword: '**',
|
||||
package: 'app-admin/foobar',
|
||||
operator: '>=',
|
||||
version: '1.2.3',
|
||||
repo: 'community',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('** >=app-admin/foobar-1.2.3 repo=community ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '** >=app-admin/foobar-1.2.3 repo=community ## Puppet Name: test'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
61
spec/unit/provider/entropy_repo/file_spec.rb
Normal file
61
spec/unit/provider/entropy_repo/file_spec.rb
Normal file
@@ -0,0 +1,61 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Puppet::Type.type(:entropy_repo).provider(:file) do
|
||||
describe 'when fetching existing resources' do
|
||||
let(:instances) do
|
||||
described_class.instances
|
||||
end
|
||||
|
||||
let(:repos) do
|
||||
[
|
||||
{ name: 'sabayonlinux.org', type: 'entropy', enabled: 'true' },
|
||||
{ name: 'sabayon-limbo', type: 'entropy', enabled: 'false' },
|
||||
{ name: 'community', type: 'enman', enabled: 'true' },
|
||||
]
|
||||
end
|
||||
|
||||
before(:each) do
|
||||
Dir.stubs(:entries).with('/etc/entropy/repositories.conf.d/').returns([
|
||||
'.', '..', 'README',
|
||||
'entropy_sabayonlinux.org',
|
||||
'_entropy_sabayon-limbo',
|
||||
'entropy_enman_community',
|
||||
'entropy_foobar.example'
|
||||
])
|
||||
end
|
||||
|
||||
it 'identifies the correct number of repos' do
|
||||
expect(instances.size).to eq(repos.size)
|
||||
end
|
||||
|
||||
it 'identifies the correct repo name' do
|
||||
repos.each_with_index do |repo, index|
|
||||
expect(instances[index].name).to eq(repo[:name])
|
||||
end
|
||||
end
|
||||
|
||||
it 'identifies the correct enabled state' do
|
||||
repos.each_with_index do |repo, index|
|
||||
expect(instances[index].enabled).to eq(repo[:enabled])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when enabling a repository' do
|
||||
it 'enables a disabled repository' do
|
||||
File.stubs(:exist?).with('/etc/entropy/repositories.conf.d/entropy_sabayonlinux.org').returns(true).once
|
||||
File.stubs(:rename).with('/etc/entropy/repositories.conf.d/entropy_sabayonlinux.org', '/etc/entropy/repositories.conf.d/_entropy_sabayonlinux.org').once
|
||||
instance = described_class.new(name: 'sabayonlinux.org', enabled: 'true', type: 'entropy')
|
||||
instance.enabled = 'false'
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when disabling a repository' do
|
||||
it 'disables an enabled repository' do
|
||||
File.stubs(:exist?).with('/etc/entropy/repositories.conf.d/_entropy_sabayon-limbo').returns(true).once
|
||||
File.stubs(:rename).with('/etc/entropy/repositories.conf.d/_entropy_sabayon-limbo', '/etc/entropy/repositories.conf.d/entropy_sabayon-limbo').once
|
||||
instance = described_class.new(name: 'sabayon-limbo', enabled: 'false', type: 'entropy')
|
||||
instance.enabled = 'true'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5,25 +5,26 @@ require 'puppet/type/entropy_splitdebug'
|
||||
require 'puppet/type/entropy_splitdebug_mask'
|
||||
|
||||
types = {
|
||||
:entropy_mask => Puppet::Type::Entropy_mask,
|
||||
:entropy_unmask => Puppet::Type::Entropy_unmask,
|
||||
:entropy_splitdebug => Puppet::Type::Entropy_splitdebug,
|
||||
:entropy_splitdebug_mask => Puppet::Type::Entropy_splitdebug_mask,
|
||||
entropy_mask: Puppet::Type::Entropy_mask,
|
||||
entropy_unmask: Puppet::Type::Entropy_unmask,
|
||||
entropy_splitdebug: Puppet::Type::Entropy_splitdebug,
|
||||
entropy_splitdebug_mask: Puppet::Type::Entropy_splitdebug_mask,
|
||||
}
|
||||
|
||||
default_targets = {
|
||||
:entropy_mask => '/etc/entropy/packages/package.mask',
|
||||
:entropy_unmask => '/etc/entropy/packages/package.unmask',
|
||||
:entropy_splitdebug => '/etc/entropy/packages/package.splitdebug',
|
||||
:entropy_splitdebug_mask => '/etc/entropy/packages/package.splitdebug.mask',
|
||||
entropy_mask: '/etc/entropy/packages/package.mask',
|
||||
entropy_unmask: '/etc/entropy/packages/package.unmask',
|
||||
entropy_splitdebug: '/etc/entropy/packages/package.splitdebug',
|
||||
entropy_splitdebug_mask: '/etc/entropy/packages/package.splitdebug.mask',
|
||||
}
|
||||
|
||||
types.each do |type_name, type|
|
||||
types.each do |type_name, _type|
|
||||
describe Puppet::Type.type(type_name).provider(:parsed) do
|
||||
before do
|
||||
let(:default_target) { described_class.default_target }
|
||||
|
||||
before(:each) do
|
||||
described_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
|
||||
described_class.stubs(:filetype=)
|
||||
@default_target = described_class.default_target
|
||||
end
|
||||
|
||||
describe "should have a default target of #{default_targets[type_name]}" do
|
||||
@@ -33,7 +34,7 @@ types.each do |type_name, type|
|
||||
end
|
||||
|
||||
describe 'when parsing' do
|
||||
it 'should parse out the name' do
|
||||
it 'parses out the name' do
|
||||
line = 'app-admin/foobar ## Puppet Name: foobar'
|
||||
expect(described_class.parse_line(line)[:name]).to eq('foobar')
|
||||
end
|
||||
@@ -42,11 +43,11 @@ types.each do |type_name, type|
|
||||
line = 'app-admin/foobar ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version, :slot, :use, :tag, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -57,15 +58,15 @@ types.each do |type_name, type|
|
||||
line = 'app-admin/foobar-1.2.3_alpha1-r1 ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the version' do
|
||||
it 'parses out the version' do
|
||||
expect(parsed[:version]).to eq('1.2.3_alpha1-r1')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :slot, :use, :tag, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -76,19 +77,19 @@ types.each do |type_name, type|
|
||||
line = '>=app-admin/foobar-1.2.3_alpha1-r1 ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the version' do
|
||||
it 'parses out the version' do
|
||||
expect(parsed[:version]).to eq('1.2.3_alpha1-r1')
|
||||
end
|
||||
|
||||
it 'should parse out the operator' do
|
||||
it 'parses out the operator' do
|
||||
expect(parsed[:operator]).to eq('>=')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:slot, :use, :tag, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -99,15 +100,15 @@ types.each do |type_name, type|
|
||||
line = 'app-admin/foobar:1.1 ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the slot' do
|
||||
it 'parses out the slot' do
|
||||
expect(parsed[:slot]).to eq('1.1')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version, :use, :tag, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -118,15 +119,15 @@ types.each do |type_name, type|
|
||||
line = 'app-admin/foobar[-foo,bar] ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the use' do
|
||||
it 'parses out the use' do
|
||||
expect(parsed[:use]).to eq('-foo,bar')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version, :slot, :tag, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -137,15 +138,15 @@ types.each do |type_name, type|
|
||||
line = 'app-admin/foobar#server ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the tag' do
|
||||
it 'parses out the tag' do
|
||||
expect(parsed[:tag]).to eq('server')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version, :slot, :use, :repo].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -156,15 +157,15 @@ types.each do |type_name, type|
|
||||
line = 'app-admin/foobar::community ## Puppet Name: foobar'
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
it 'should parse out the package name' do
|
||||
it 'parses out the package name' do
|
||||
expect(parsed[:package]).to eq('app-admin/foobar')
|
||||
end
|
||||
|
||||
it 'should parse out the repo' do
|
||||
it 'parses out the repo' do
|
||||
expect(parsed[:repo]).to eq('community')
|
||||
end
|
||||
|
||||
it 'should have all other parameters undefined' do
|
||||
it 'has all other parameters undefined' do
|
||||
[:operator, :version, :slot, :use, :tag].each do |param|
|
||||
expect(parsed[param]).to be_nil
|
||||
end
|
||||
@@ -176,128 +177,130 @@ types.each do |type_name, type|
|
||||
parsed = described_class.parse_line(line)
|
||||
|
||||
expected = {
|
||||
:name => 'foobar',
|
||||
:operator => '>=',
|
||||
:package => 'app-admin/foobar',
|
||||
:version => '1.2.3a_alpha1-r1',
|
||||
:slot => '1',
|
||||
:use => '-foo',
|
||||
:tag => 'server',
|
||||
:repo => 'community',
|
||||
name: 'foobar',
|
||||
operator: '>=',
|
||||
package: 'app-admin/foobar',
|
||||
version: '1.2.3a_alpha1-r1',
|
||||
slot: '1',
|
||||
use: '-foo',
|
||||
tag: 'server',
|
||||
repo: 'community',
|
||||
}
|
||||
|
||||
it 'should parse out all parameters' do
|
||||
it 'parses out all parameters' do
|
||||
expected.each do |param, value|
|
||||
expect(parsed[param]).to eq(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'when flushing' do
|
||||
describe 'when flushing' do
|
||||
let(:ramfile) do
|
||||
Puppet::Util::FileType::FileTypeRam.new(:default_target)
|
||||
end
|
||||
|
||||
before :each do
|
||||
@ramfile = Puppet::Util::FileType::FileTypeRam.new(@default_target)
|
||||
File.stubs(:exist?).with(default_targets[type_name]).returns(true)
|
||||
described_class.any_instance.stubs(:target_object).returns(@ramfile)
|
||||
described_class.stubs(:target_object).returns(:ramfile)
|
||||
end
|
||||
|
||||
after :each do
|
||||
described_class.clear
|
||||
end
|
||||
|
||||
it 'should output a single package entry' do
|
||||
it 'outputs a single package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('app-admin/foobar ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq 'app-admin/foobar ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a versioned package entry' do
|
||||
it 'outputs a versioned package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:version => '1.2.3',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
version: '1.2.3',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('app-admin/foobar-1.2.3 ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq 'app-admin/foobar-1.2.3 ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a ranged versioned package entry' do
|
||||
it 'outputs a ranged versioned package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:version => '1.2.3',
|
||||
:operator => '>=',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
version: '1.2.3',
|
||||
operator: '>=',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('>=app-admin/foobar-1.2.3 ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '>=app-admin/foobar-1.2.3 ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a use-restricted package entry' do
|
||||
it 'outputs a use-restricted package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:use => '-foo,bar',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
use: '-foo,bar',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('app-admin/foobar[-foo,bar] ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq 'app-admin/foobar[-foo,bar] ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a slotted package entry' do
|
||||
it 'outputs a slotted package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:slot => '1.1',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
slot: '1.1',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('app-admin/foobar:1.1 ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq 'app-admin/foobar:1.1 ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a tagged package entry' do
|
||||
it 'outputs a tagged package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:tag => 'server',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
tag: 'server',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('app-admin/foobar#server ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq 'app-admin/foobar#server ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a repo-specific package entry' do
|
||||
it 'outputs a repo-specific package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:repo => 'community',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
repo: 'community',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('app-admin/foobar::community ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq 'app-admin/foobar::community ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output a whole-repo entry' do
|
||||
it 'outputs a whole-repo entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:repo => 'community',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
repo: 'community',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('::community ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '::community ## Puppet Name: test'
|
||||
end
|
||||
|
||||
it 'should output all fields for a package entry' do
|
||||
it 'outputs all fields for a package entry' do
|
||||
resource = {
|
||||
:record_type => :parsed,
|
||||
:name => 'test',
|
||||
:package => 'app-admin/foobar',
|
||||
:operator => '>=',
|
||||
:version => '1.2.3',
|
||||
:slot => '1.1',
|
||||
:use => '-foo,bar',
|
||||
:tag => 'server',
|
||||
:repo => 'community',
|
||||
record_type: :parsed,
|
||||
name: 'test',
|
||||
package: 'app-admin/foobar',
|
||||
operator: '>=',
|
||||
version: '1.2.3',
|
||||
slot: '1.1',
|
||||
use: '-foo,bar',
|
||||
tag: 'server',
|
||||
repo: 'community',
|
||||
}
|
||||
expect(described_class.to_line(resource)).to eq ('>=app-admin/foobar-1.2.3:1.1[-foo,bar]#server::community ## Puppet Name: test')
|
||||
expect(described_class.to_line(resource)).to eq '>=app-admin/foobar-1.2.3:1.1[-foo,bar]#server::community ## Puppet Name: test'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Puppet::Type.type(:enman_repo) do
|
||||
before do
|
||||
@provider = stub 'provider'
|
||||
@provider.stubs(:name).returns(:enman)
|
||||
described_class.stubs(:defaultprovider).returns(@provider)
|
||||
before(:each) do
|
||||
provider = stub 'provider'
|
||||
provider.stubs(:name).returns(:enman)
|
||||
described_class.stubs(:defaultprovider).returns(provider)
|
||||
end
|
||||
|
||||
it "should be an instance of Puppet::Type::Enman_repo" do
|
||||
expect(described_class.new(:name => "test")).to be_an_instance_of Puppet::Type::Enman_repo
|
||||
it 'is an instance of Puppet::Type::Enman_repo' do
|
||||
expect(described_class.new(name: 'test')).to be_an_instance_of Puppet::Type::Enman_repo
|
||||
end
|
||||
|
||||
describe "when validating attributes" do
|
||||
params = [:name]
|
||||
describe 'when validating attributes' do
|
||||
params = [:name]
|
||||
|
||||
params.each do |param|
|
||||
it "should have the #{param} param" do
|
||||
@@ -19,7 +21,7 @@ describe Puppet::Type.type(:enman_repo) do
|
||||
end
|
||||
end
|
||||
|
||||
it "should have name as the namevar" do
|
||||
it 'has name as the namevar' do
|
||||
expect(described_class.key_attributes).to eq [:name]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Puppet::Type.type(:entropy_keywords) do
|
||||
before do
|
||||
@provider = stub 'provider'
|
||||
@provider.stubs(:name).returns(:parsed)
|
||||
@provider.stubs(:ancestors).returns([Puppet::Provider::ParsedFile])
|
||||
@provider.stubs(:default_target).returns("defaulttarget")
|
||||
described_class.stubs(:defaultprovider).returns(@provider)
|
||||
before(:each) do
|
||||
provider = stub 'provider'
|
||||
provider.stubs(:name).returns(:parsed)
|
||||
provider.stubs(:ancestors).returns([Puppet::Provider::ParsedFile])
|
||||
provider.stubs(:default_target).returns('defaulttarget')
|
||||
described_class.stubs(:defaultprovider).returns(provider)
|
||||
end
|
||||
|
||||
it "should be an instance of Puppet::Type::Entropy_keywords" do
|
||||
expect(described_class.new(:name => "test", :package => "app-admin/dummy")).to be_an_instance_of Puppet::Type::Entropy_keywords
|
||||
it 'is an instance of Puppet::Type::Entropy_keywords' do
|
||||
expect(described_class.new(name: 'test', package: 'app-admin/dummy')).to be_an_instance_of Puppet::Type::Entropy_keywords
|
||||
end
|
||||
|
||||
describe "when validating attributes" do
|
||||
describe 'when validating attributes' do
|
||||
params = [:name]
|
||||
properties = [:package, :operator, :version, :repo, :target]
|
||||
|
||||
@@ -26,37 +28,36 @@ describe Puppet::Type.type(:entropy_keywords) do
|
||||
expect(described_class.attrtype(property)).to eq :property
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
it "should have name as the namevar" do
|
||||
it 'has name as the namevar' do
|
||||
expect(described_class.key_attributes).to eq [:name]
|
||||
end
|
||||
|
||||
describe "when validating the target property" do
|
||||
it "should default to the provider's default target" do
|
||||
expect(described_class.new(:name => "test", :package => "app-admin/dummy").should(:target)).to eq "defaulttarget"
|
||||
describe 'when validating the target property' do
|
||||
it "defaults to the provider's default target" do
|
||||
expect(described_class.new(name: 'test', package: 'app-admin/dummy').should(:target)).to eq 'defaulttarget'
|
||||
end
|
||||
end
|
||||
|
||||
describe "when validating required properties" do
|
||||
it "should raise an error when a version is passed with no package" do
|
||||
describe 'when validating required properties' do
|
||||
it 'raises an error when a version is passed with no package' do
|
||||
expect {
|
||||
described_class.new(:name => "test", :repo => "test", :version => "1.2.3")
|
||||
}.to raise_error(Puppet::Error, /Package is required/)
|
||||
described_class.new(name: 'test', repo: 'test', version: '1.2.3')
|
||||
}.to raise_error(Puppet::Error, %r{Package is required})
|
||||
end
|
||||
|
||||
it "should raise an error when an operator is passed with no version" do
|
||||
it 'raises an error when an operator is passed with no version' do
|
||||
expect {
|
||||
described_class.new(:name => "test", :package => "app-admin/dummy", :operator => "<=")
|
||||
}.to raise_error(Puppet::Error, /Version is required/)
|
||||
described_class.new(name: 'test', package: 'app-admin/dummy', operator: '<=')
|
||||
}.to raise_error(Puppet::Error, %r{Version is required})
|
||||
end
|
||||
end
|
||||
|
||||
describe "when the catalog includes a matching package" do
|
||||
it "should have an autobefore relationship" do
|
||||
resource = described_class.new(:name => "test", :package => "app-admin/dummy")
|
||||
package = Puppet::Type.type(:package).new(:title => 'app-admin/dummy')
|
||||
describe 'when the catalog includes a matching package' do
|
||||
it 'has an autobefore relationship' do
|
||||
resource = described_class.new(name: 'test', package: 'app-admin/dummy')
|
||||
package = Puppet::Type.type(:package).new(title: 'app-admin/dummy')
|
||||
|
||||
catalog = Puppet::Resource::Catalog.new
|
||||
catalog.add_resource package
|
||||
|
||||
34
spec/unit/type/entropy_repo_spec.rb
Normal file
34
spec/unit/type/entropy_repo_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Puppet::Type.type(:entropy_repo) do
|
||||
before(:each) do
|
||||
provider = stub 'provider'
|
||||
provider.stubs(:name).returns(:file)
|
||||
described_class.stubs(:defaultprovider).returns(provider)
|
||||
end
|
||||
|
||||
it 'is an instance of Puppet::Type::Entropy_repo' do
|
||||
expect(described_class.new(name: 'test')).to be_an_instance_of Puppet::Type::Entropy_repo
|
||||
end
|
||||
|
||||
describe 'when validating attributes' do
|
||||
params = [:name]
|
||||
properties = [:repo_type, :enabled]
|
||||
|
||||
params.each do |param|
|
||||
it "should have the #{param} param" do
|
||||
expect(described_class.attrtype(param)).to eq :param
|
||||
end
|
||||
end
|
||||
|
||||
properties.each do |property|
|
||||
it "should have the #{property} property" do
|
||||
expect(described_class.attrtype(property)).to eq :property
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'has name as the namevar' do
|
||||
expect(described_class.key_attributes).to eq [:name]
|
||||
end
|
||||
end
|
||||
@@ -5,27 +5,27 @@ require 'puppet/type/entropy_splitdebug'
|
||||
require 'puppet/type/entropy_splitdebug_mask'
|
||||
|
||||
types = {
|
||||
:entropy_mask => Puppet::Type::Entropy_mask,
|
||||
:entropy_unmask => Puppet::Type::Entropy_unmask,
|
||||
:entropy_splitdebug => Puppet::Type::Entropy_splitdebug,
|
||||
:entropy_splitdebug_mask => Puppet::Type::Entropy_splitdebug_mask,
|
||||
entropy_mask: Puppet::Type::Entropy_mask,
|
||||
entropy_unmask: Puppet::Type::Entropy_unmask,
|
||||
entropy_splitdebug: Puppet::Type::Entropy_splitdebug,
|
||||
entropy_splitdebug_mask: Puppet::Type::Entropy_splitdebug_mask,
|
||||
}
|
||||
|
||||
types.each do |type_name, type|
|
||||
describe Puppet::Type.type(type_name) do
|
||||
before do
|
||||
@provider = stub 'provider'
|
||||
@provider.stubs(:name).returns(:parsed)
|
||||
@provider.stubs(:ancestors).returns([Puppet::Provider::ParsedFile])
|
||||
@provider.stubs(:default_target).returns("defaulttarget")
|
||||
described_class.stubs(:defaultprovider).returns(@provider)
|
||||
before(:each) do
|
||||
provider = stub 'provider'
|
||||
provider.stubs(:name).returns(:parsed)
|
||||
provider.stubs(:ancestors).returns([Puppet::Provider::ParsedFile])
|
||||
provider.stubs(:default_target).returns('defaulttarget')
|
||||
described_class.stubs(:defaultprovider).returns(provider)
|
||||
end
|
||||
|
||||
it "should be an instance of #{type.class.name}" do
|
||||
expect(described_class.new(:name => "test", :package => "app-admin/dummy")).to be_an_instance_of type
|
||||
expect(described_class.new(name: 'test', package: 'app-admin/dummy')).to be_an_instance_of type
|
||||
end
|
||||
|
||||
describe "when validating attributes" do
|
||||
describe 'when validating attributes' do
|
||||
params = [:name]
|
||||
properties = [:package, :operator, :version, :slot, :use, :tag, :repo, :target]
|
||||
|
||||
@@ -40,32 +40,31 @@ types.each do |type_name, type|
|
||||
expect(described_class.attrtype(property)).to eq :property
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
it "should have name as the namevar" do
|
||||
it 'has name as the namevar' do
|
||||
expect(described_class.key_attributes).to eq [:name]
|
||||
end
|
||||
|
||||
describe "when validating the target property" do
|
||||
it "should default to the provider's default target" do
|
||||
expect(described_class.new(:name => "test", :package => "app-admin/dummy").should(:target)).to eq "defaulttarget"
|
||||
describe 'when validating the target property' do
|
||||
it "defaults to the provider's default target" do
|
||||
expect(described_class.new(name: 'test', package: 'app-admin/dummy').should(:target)).to eq 'defaulttarget'
|
||||
end
|
||||
end
|
||||
|
||||
describe "when validating required properties" do
|
||||
describe 'when validating required properties' do
|
||||
packages = [
|
||||
'virtual/package',
|
||||
'package',
|
||||
'package-with-dash',
|
||||
'package_with_underscores',
|
||||
'category-123/package2',
|
||||
'category.with.dots/package'
|
||||
'category.with.dots/package',
|
||||
]
|
||||
packages.each do |package|
|
||||
it "should accept valid package name #{package}" do
|
||||
expect {
|
||||
described_class.new(:name => 'test', :package => package)
|
||||
described_class.new(name: 'test', package: package)
|
||||
}.not_to raise_error
|
||||
end
|
||||
end
|
||||
@@ -79,28 +78,28 @@ types.each do |type_name, type|
|
||||
packages.each do |package|
|
||||
it "should reject invalid package name #{package}" do
|
||||
expect {
|
||||
described_class.new(:name => 'test', :package => package)
|
||||
described_class.new(name: 'test', package: package)
|
||||
}.to raise_error(Puppet::Error)
|
||||
end
|
||||
end
|
||||
|
||||
it "should raise an error when a version is passed with no package" do
|
||||
it 'raises an error when a version is passed with no package' do
|
||||
expect {
|
||||
described_class.new(:name => "test", :repo => "test", :version => "1.2.3")
|
||||
}.to raise_error(Puppet::Error, /Package is required/)
|
||||
described_class.new(name: 'test', repo: 'test', version: '1.2.3')
|
||||
}.to raise_error(Puppet::Error, %r{Package is required})
|
||||
end
|
||||
|
||||
it "should raise an error when an operator is passed with no version" do
|
||||
it 'raises an error when an operator is passed with no version' do
|
||||
expect {
|
||||
described_class.new(:name => "test", :package => "app-admin/dummy", :operator => "<=")
|
||||
}.to raise_error(Puppet::Error, /Version is required/)
|
||||
described_class.new(name: 'test', package: 'app-admin/dummy', operator: '<=')
|
||||
}.to raise_error(Puppet::Error, %r{Version is required})
|
||||
end
|
||||
end
|
||||
|
||||
describe "when the catalog includes a matching package" do
|
||||
it "should have an autobefore relationship" do
|
||||
resource = described_class.new(:name => "test", :package => "app-admin/dummy")
|
||||
package = Puppet::Type.type(:package).new(:title => 'app-admin/dummy')
|
||||
describe 'when the catalog includes a matching package' do
|
||||
it 'has an autobefore relationship' do
|
||||
resource = described_class.new(name: 'test', package: 'app-admin/dummy')
|
||||
package = Puppet::Type.type(:package).new(title: 'app-admin/dummy')
|
||||
|
||||
catalog = Puppet::Resource::Catalog.new
|
||||
catalog.add_resource package
|
||||
|
||||
7
tasks/cleanup.json
Normal file
7
tasks/cleanup.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"puppet_task_version": 1,
|
||||
"supports_noop": false,
|
||||
"description": "Run `equo cleanup` on target nodes to free up disk space used by downloaded packages",
|
||||
"parameters": {
|
||||
}
|
||||
}
|
||||
3
tasks/cleanup.sh
Normal file
3
tasks/cleanup.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
/usr/bin/equo cleanup
|
||||
|
||||
11
tasks/update.json
Normal file
11
tasks/update.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"puppet_task_version": 1,
|
||||
"supports_noop": false,
|
||||
"description": "Run `equo update` on target nodes to refresh repository definitions",
|
||||
"parameters": {
|
||||
"repo": {
|
||||
"description": "Restrict update to only this named repository",
|
||||
"type": "Optional[Pattern[/^[a-zA-Z0-9._-]+$/]]"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
tasks/update.sh
Normal file
7
tasks/update.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -z "${PT_repo}" ]; then
|
||||
/usr/bin/equo update "${PT_repo}"
|
||||
else
|
||||
/usr/bin/equo update
|
||||
fi
|
||||
1
vendor/.gitignore
vendored
1
vendor/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
bundle
|
||||
Reference in New Issue
Block a user