ra10ke 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/release.yml +32 -0
- data/.github/workflows/test.yml +32 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/CHANGELOG.md +72 -4
- data/Gemfile +9 -0
- data/HISTORY.md +118 -0
- data/README.md +34 -1
- data/Rakefile +13 -0
- data/lib/ra10ke/dependencies.rb +172 -49
- data/lib/ra10ke/deprecation.rb +72 -0
- data/lib/ra10ke/git_repo.rb +128 -0
- data/lib/ra10ke/puppetfile_parser.rb +9 -2
- data/lib/ra10ke/solve.rb +4 -0
- data/lib/ra10ke/validate.rb +19 -60
- data/lib/ra10ke/version.rb +1 -1
- data/lib/ra10ke.rb +6 -0
- data/ra10ke.gemspec +5 -2
- data/spec/fixtures/Puppetfile +2 -0
- data/spec/fixtures/Puppetfile_deprecation_issue +78 -0
- data/spec/fixtures/Puppetfile_git_conversion +28 -0
- data/spec/fixtures/Puppetfile_with_bad_refs +3 -0
- data/spec/fixtures/Puppetfile_with_commit +3 -0
- data/spec/fixtures/Puppetfile_with_control_branch +23 -0
- data/spec/fixtures/refs/debug.txt +0 -0
- data/spec/fixtures/refs/gitlab.txt +285 -0
- data/spec/fixtures/refs/r10k.txt +120 -0
- data/spec/fixtures/{reflist.txt → refs/reflist.txt} +0 -0
- data/spec/ra10ke/dependencies_spec.rb +108 -0
- data/spec/ra10ke/deprecation_spec.rb +48 -0
- data/spec/ra10ke/git_repo_spec.rb +92 -0
- data/spec/ra10ke/puppetfile_parser_spec.rb +3 -1
- data/spec/ra10ke/validate_spec.rb +96 -33
- data/spec/ra10ke_spec.rb +6 -4
- data/spec/spec_helper.rb +28 -0
- metadata +51 -8
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ra10ke/puppetfile_parser'
|
4
|
+
require 'English'
|
5
|
+
require 'puppet_forge'
|
6
|
+
require 'table_print'
|
7
|
+
require 'time'
|
8
|
+
|
9
|
+
module Ra10ke::Deprecation
|
10
|
+
# Validate the git urls and refs
|
11
|
+
def define_task_deprecation(*)
|
12
|
+
desc 'Validate that no forge modules are deprecated'
|
13
|
+
task :deprecation do
|
14
|
+
valid = Ra10ke::Deprecation::Validation.new(get_puppetfile.puppetfile_path)
|
15
|
+
exit_code = 0
|
16
|
+
if valid.bad_mods?
|
17
|
+
exit_code = 1
|
18
|
+
message = "\nError: Puppetfile contains deprecated modules."
|
19
|
+
tp valid.sorted_mods, :name, :deprecated_at
|
20
|
+
else
|
21
|
+
message = 'Puppetfile contains no deprecated Forge modules.'
|
22
|
+
end
|
23
|
+
abort(message) if exit_code.positive?
|
24
|
+
|
25
|
+
puts message
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class Validation
|
30
|
+
include Ra10ke::PuppetfileParser
|
31
|
+
|
32
|
+
attr_reader :puppetfile
|
33
|
+
|
34
|
+
def initialize(file)
|
35
|
+
file ||= './Puppetfile'
|
36
|
+
@puppetfile = File.expand_path(file)
|
37
|
+
abort("Puppetfile does not exist at #{puppetfile}") unless File.readable?(puppetfile)
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [Array[Hash]] array of module information and git status
|
41
|
+
def deprecated_modules
|
42
|
+
@deprecated_modules ||= begin
|
43
|
+
deprecated = forge_modules(puppetfile).map do |mod|
|
44
|
+
# For Ruby 2.4 support
|
45
|
+
begin # rubocop:disable Style/RedundantBegin
|
46
|
+
module_name = "#{mod[:namespace] || mod[:name]}-#{mod[:name]}"
|
47
|
+
forge_data = PuppetForge::Module.find(module_name)
|
48
|
+
|
49
|
+
next forge_data if forge_data.deprecated_at
|
50
|
+
|
51
|
+
nil
|
52
|
+
rescue Faraday::ResourceNotFound
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
end
|
56
|
+
deprecated.compact.map do |mod|
|
57
|
+
{ name: mod.slug, deprecated_at: Time.parse(mod.deprecated_at) }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# @return [Boolean] - true if there are any bad mods
|
63
|
+
def bad_mods?
|
64
|
+
deprecated_modules.any?
|
65
|
+
end
|
66
|
+
|
67
|
+
# @return [Hash] - sorts the mods based on good/bad
|
68
|
+
def sorted_mods
|
69
|
+
deprecated_modules.sort_by { |a| a[:name] }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'tempfile'
|
4
|
+
|
5
|
+
module Ra10ke
|
6
|
+
class GitRepo
|
7
|
+
attr_reader :url
|
8
|
+
|
9
|
+
REMOTE_REFS_CMD = 'git ls-remote --symref'
|
10
|
+
CLONE_CMD = 'git clone --no-tags'
|
11
|
+
CURRENT_BRANCH_CMD = 'git symbolic-ref --short HEAD'
|
12
|
+
SHOW_CMD = 'git show'
|
13
|
+
|
14
|
+
def initialize(url)
|
15
|
+
@url = url
|
16
|
+
end
|
17
|
+
|
18
|
+
# Get the current branch for a Git repo
|
19
|
+
# @param path [String] - The path to the repository to check
|
20
|
+
# @return [String] - The current active branch of the Git repo
|
21
|
+
def self.current_branch(path)
|
22
|
+
Dir.chdir(path) do
|
23
|
+
data, success = run_command(CURRENT_BRANCH_CMD)
|
24
|
+
return success ? data.strip : nil
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [Array] - the raw data from the git ls-remote command as lines array
|
29
|
+
# return empty array if url or command failed
|
30
|
+
def remote_refs
|
31
|
+
@remote_refs ||= begin
|
32
|
+
data, success = run_command("#{REMOTE_REFS_CMD} #{url}")
|
33
|
+
success ? data.lines : []
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [Boolean] true if the git url is valid
|
38
|
+
def valid_url?
|
39
|
+
!remote_refs.empty?
|
40
|
+
end
|
41
|
+
|
42
|
+
# @return [Boolean] - return true if the commit sha is valid
|
43
|
+
# @param url [String] - the git string either https or ssh url
|
44
|
+
# @param ref [String] - the sha id
|
45
|
+
def valid_commit?(sha)
|
46
|
+
return false if sha.nil? || sha.empty?
|
47
|
+
return true if valid_ref?(sha)
|
48
|
+
|
49
|
+
# cloning is a last resort if for some reason we cannot
|
50
|
+
# remotely get via ls-remote
|
51
|
+
Dir.mktmpdir do |dir|
|
52
|
+
run_command("#{CLONE_CMD} #{url} #{dir}", silent: true)
|
53
|
+
Dir.chdir(dir) do
|
54
|
+
_, status = run_command("#{SHOW_CMD} #{sha}", silent: true)
|
55
|
+
status
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# @return [Boolean] - return true if the ref is valid
|
61
|
+
# @param url [String] - the git string either https or ssh url
|
62
|
+
# @param ref [String] - the ref object, branch name, tag name, or commit sha, defaults to HEAD
|
63
|
+
def valid_ref?(ref = 'HEAD')
|
64
|
+
return false if ref.nil?
|
65
|
+
|
66
|
+
found = all_refs.find do |data|
|
67
|
+
# we don't need to bother with these types
|
68
|
+
next if data[:type] == :pull || data[:type] == :merge_request
|
69
|
+
|
70
|
+
# is the name equal to the tag or branch? Is the commit sha equal?
|
71
|
+
data[:name].eql?(ref) || data[:sha].slice(0, 8).eql?(ref.slice(0, 8))
|
72
|
+
end
|
73
|
+
!found.nil?
|
74
|
+
end
|
75
|
+
|
76
|
+
# @return [Array] - an array of all the refs associated with the remote repository
|
77
|
+
# @param url [String] - the git string either https or ssh url
|
78
|
+
# @example
|
79
|
+
# [{:sha=>"0ec707e431367bbe2752966be8ab915b6f0da754", :ref=>"refs/heads/74110ac", :type=>:branch, :subtype=>nil, :name=>"74110ac"},
|
80
|
+
# :sha=>"07bb5d2d94db222dca5860eb29c184e8970f36f4", :ref=>"refs/pull/74/head", :type=>:pull, :subtype=>:head, :name=>"74"},
|
81
|
+
# :sha=>"156ca9a8ea69e056e86355b27d944e59d1b3a1e1", :ref=>"refs/heads/master", :type=>:branch, :subtype=>nil, :name=>"master"},
|
82
|
+
# :sha=>"fcc0532bbc5a5b65f3941738339e9cc7e3d767ce", :ref=>"refs/pull/249/head", :type=>:pull, :subtype=>:head, :name=>"249"},
|
83
|
+
# :sha=>"8d54891fa5df75890ee15d53080c2a81b4960f92", :ref=>"refs/pull/267/head", :type=>:pull, :subtype=>:head, :name=>"267"}]
|
84
|
+
def all_refs
|
85
|
+
@all_refs ||= begin
|
86
|
+
remote_refs.each_with_object([]) do |line, refs|
|
87
|
+
sha, ref = line.split("\t")
|
88
|
+
next refs if line.include?('redirecting')
|
89
|
+
next refs if sha.eql?('ref: refs/heads/master')
|
90
|
+
_, type, name, subtype = ref.chomp.split('/')
|
91
|
+
next refs unless name
|
92
|
+
|
93
|
+
type = :tag if type.eql?('tags')
|
94
|
+
type = type.to_sym
|
95
|
+
subtype = subtype.to_sym if subtype
|
96
|
+
type = :branch if type.eql?(:heads)
|
97
|
+
refs << { sha: sha, ref: ref.chomp, type: type, subtype: subtype, name: name }
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# @summary searches all the refs for a ref similar to the name provided
|
103
|
+
# This is useful when looking for tags if a v or not a v
|
104
|
+
# @param ref_name [String]
|
105
|
+
# @return [String] the matching ref_name or nil
|
106
|
+
def get_ref_like(ref_name)
|
107
|
+
return nil unless valid_url?
|
108
|
+
ref = all_refs.find do |ref|
|
109
|
+
ref[:name].include?(ref_name)
|
110
|
+
end
|
111
|
+
ref
|
112
|
+
end
|
113
|
+
|
114
|
+
# useful for mocking easily
|
115
|
+
# @param cmd [String]
|
116
|
+
# @param silent [Boolean] set to true if you wish to send output to /dev/null, false by default
|
117
|
+
# @return [Array]
|
118
|
+
def self.run_command(cmd, silent: false)
|
119
|
+
out_args = silent ? '2>&1 > /dev/null' : '2>&1'
|
120
|
+
out = `#{cmd} #{out_args}`
|
121
|
+
[out, $CHILD_STATUS.success?]
|
122
|
+
end
|
123
|
+
|
124
|
+
def run_command(cmd, silent: false)
|
125
|
+
self.class.run_command(cmd, silent: silent)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -12,6 +12,13 @@ module Ra10ke
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
# @return [Array] - returns a array of hashes that contain modules from the Forge
|
16
|
+
def forge_modules(file = puppetfile)
|
17
|
+
modules(file).reject do |mod|
|
18
|
+
mod[:args].key?(:git)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
15
22
|
# @param puppetfile [String] - the absolute path to the puppetfile
|
16
23
|
# @return [Array] - returns an array of module hashes that represent the puppetfile
|
17
24
|
# @example
|
@@ -20,11 +27,11 @@ module Ra10ke
|
|
20
27
|
def modules(puppetfile)
|
21
28
|
@modules ||= begin
|
22
29
|
return [] unless File.exist?(puppetfile)
|
23
|
-
|
24
30
|
all_lines = File.read(puppetfile).lines.map(&:strip_comment)
|
25
31
|
# remove comments from all the lines
|
26
|
-
lines_without_comments = all_lines.reject { |line| line.match(/#.*\n/) }.join("\n")
|
32
|
+
lines_without_comments = all_lines.reject { |line| line.match(/#.*\n/) || line.empty? }.join("\n")
|
27
33
|
lines_without_comments.split(/^mod/).map do |line|
|
34
|
+
|
28
35
|
next nil if line =~ /^forge/
|
29
36
|
next nil if line.empty?
|
30
37
|
|
data/lib/ra10ke/solve.rb
CHANGED
@@ -6,6 +6,7 @@ require 'set'
|
|
6
6
|
require 'solve'
|
7
7
|
require 'yaml/store'
|
8
8
|
require 'semverse/version'
|
9
|
+
require 'fileutils'
|
9
10
|
|
10
11
|
# How many versions to fetch from the Forge, at most
|
11
12
|
FETCH_LIMIT = 3
|
@@ -35,6 +36,9 @@ module Ra10ke::Solve
|
|
35
36
|
end
|
36
37
|
# Actual new logic begins here:
|
37
38
|
cache = (ENV['XDG_CACHE_DIR'] || File.expand_path('~/.cache'))
|
39
|
+
|
40
|
+
FileUtils.mkdir_p(cache)
|
41
|
+
|
38
42
|
# Metadata cache, since the Forge is slow:
|
39
43
|
@metadata_cache = YAML::Store.new File.join(cache, 'ra10ke.metadata_cache')
|
40
44
|
# The graph of available module versions
|
data/lib/ra10ke/validate.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'ra10ke/monkey_patches'
|
4
|
-
require 'tempfile'
|
5
4
|
require 'table_print'
|
6
5
|
require 'ra10ke/puppetfile_parser'
|
7
6
|
require 'English'
|
7
|
+
require 'ra10ke/git_repo'
|
8
8
|
|
9
9
|
module Ra10ke
|
10
10
|
module Validate
|
@@ -13,7 +13,7 @@ module Ra10ke
|
|
13
13
|
BAD_EMOJI = ENV['BAD_EMOJI'] || '😨'
|
14
14
|
|
15
15
|
# Validate the git urls and refs
|
16
|
-
def define_task_validate(*
|
16
|
+
def define_task_validate(*)
|
17
17
|
desc 'Validate the git urls and branches, refs, or tags'
|
18
18
|
task :validate do
|
19
19
|
gitvalididation = Ra10ke::Validate::Validation.new(get_puppetfile.puppetfile_path)
|
@@ -32,7 +32,7 @@ module Ra10ke
|
|
32
32
|
|
33
33
|
class Validation
|
34
34
|
include Ra10ke::PuppetfileParser
|
35
|
-
|
35
|
+
|
36
36
|
attr_reader :puppetfile
|
37
37
|
|
38
38
|
def initialize(file)
|
@@ -41,69 +41,28 @@ module Ra10ke
|
|
41
41
|
abort("Puppetfile does not exist at #{puppetfile}") unless File.readable?(puppetfile)
|
42
42
|
end
|
43
43
|
|
44
|
-
# @return [Boolean] - return true if the ref is valid
|
45
|
-
# @param url [String] - the git string either https or ssh url
|
46
|
-
# @param ref [String] - the ref object, branch name, tag name, or commit sha, defaults to HEAD
|
47
|
-
def valid_ref?(url, ref = 'HEAD')
|
48
|
-
raise ArgumentError unless ref
|
49
|
-
found = all_refs(url).find do |data|
|
50
|
-
# we don't need to bother with these types
|
51
|
-
next if data[:type] == :pull || data[:type] == :merge_request
|
52
|
-
# is the name equal to the tag or branch? Is the commit sha equal?
|
53
|
-
data[:name].eql?(ref) || data[:sha].slice(0,8).eql?(ref.slice(0,8))
|
54
|
-
end
|
55
|
-
!found.nil?
|
56
|
-
end
|
57
|
-
|
58
|
-
# @return [Array] - an array of all the refs associated with the remote repository
|
59
|
-
# @param url [String] - the git string either https or ssh url
|
60
|
-
# @example
|
61
|
-
# [{:sha=>"0ec707e431367bbe2752966be8ab915b6f0da754", :ref=>"refs/heads/74110ac", :type=>:branch, :subtype=>nil, :name=>"74110ac"},
|
62
|
-
# :sha=>"07bb5d2d94db222dca5860eb29c184e8970f36f4", :ref=>"refs/pull/74/head", :type=>:pull, :subtype=>:head, :name=>"74"},
|
63
|
-
# :sha=>"156ca9a8ea69e056e86355b27d944e59d1b3a1e1", :ref=>"refs/heads/master", :type=>:branch, :subtype=>nil, :name=>"master"},
|
64
|
-
# :sha=>"fcc0532bbc5a5b65f3941738339e9cc7e3d767ce", :ref=>"refs/pull/249/head", :type=>:pull, :subtype=>:head, :name=>"249"},
|
65
|
-
# :sha=>"8d54891fa5df75890ee15d53080c2a81b4960f92", :ref=>"refs/pull/267/head", :type=>:pull, :subtype=>:head, :name=>"267"}]
|
66
|
-
def all_refs(url)
|
67
|
-
data = `git ls-remote --symref #{url}`
|
68
|
-
raise "Error downloading #{url}" unless $CHILD_STATUS.success?
|
69
|
-
data.lines.reduce([]) do |refs, line|
|
70
|
-
sha, ref = line.split("\t")
|
71
|
-
next refs if sha.eql?('ref: refs/heads/master')
|
72
|
-
_, type, name, subtype = ref.chomp.split('/')
|
73
|
-
next refs unless name
|
74
|
-
type = :tag if type.eql?('tags')
|
75
|
-
type = type.to_sym
|
76
|
-
subtype = subtype.to_sym if subtype
|
77
|
-
type = :branch if type.eql?(:heads)
|
78
|
-
refs << { sha: sha, ref: ref.chomp, type: type, subtype: subtype, name: name }
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
# @return [Boolean] - return true if the commit sha is valid
|
83
|
-
# @param url [String] - the git string either https or ssh url
|
84
|
-
# @param ref [String] - the sha id
|
85
|
-
def valid_commit?(url, sha)
|
86
|
-
return false if sha.nil? || sha.empty?
|
87
|
-
return true if valid_ref?(url, sha)
|
88
|
-
Dir.mktmpdir do |dir|
|
89
|
-
`git clone --no-tags #{url} #{dir} 2>&1 > /dev/null`
|
90
|
-
Dir.chdir(dir) do
|
91
|
-
`git show #{sha} 2>&1 > /dev/null`
|
92
|
-
$CHILD_STATUS.success?
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
44
|
# @return [Array[Hash]] array of module information and git status
|
98
45
|
def all_modules
|
99
|
-
begin
|
46
|
+
@all_modules ||= begin
|
47
|
+
r10k_branch = Ra10ke::GitRepo.current_branch(File.dirname(puppetfile))
|
100
48
|
git_modules(puppetfile).map do |mod|
|
101
|
-
|
102
|
-
|
49
|
+
repo = Ra10ke::GitRepo.new(mod[:args][:git])
|
50
|
+
ref = mod[:args][:ref] || mod[:args][:tag] || mod[:args][:branch] || mod[:args][:commit]
|
51
|
+
# If using control_branch, try to guesstimate what the target branch should be
|
52
|
+
if ref == ':control_branch'
|
53
|
+
ref = ENV['CONTROL_BRANCH'] \
|
54
|
+
|| r10k_branch \
|
55
|
+
|| mod[:args][:default_branch_override] \
|
56
|
+
|| ENV['CONTROL_BRANCH_FALLBACK'] \
|
57
|
+
|| mod[:args][:default_branch] \
|
58
|
+
|| 'main'
|
59
|
+
end
|
60
|
+
valid_ref = repo.valid_ref?(ref) || repo.valid_commit?(mod[:args][:ref])
|
103
61
|
{
|
104
62
|
name: mod[:name],
|
105
|
-
url:
|
63
|
+
url: repo.url,
|
106
64
|
ref: ref,
|
65
|
+
valid_url?: repo.valid_url?,
|
107
66
|
valid_ref?: valid_ref,
|
108
67
|
status: valid_ref ? Ra10ke::Validate::GOOD_EMOJI : Ra10ke::Validate::BAD_EMOJI
|
109
68
|
}
|
data/lib/ra10ke/version.rb
CHANGED
data/lib/ra10ke.rb
CHANGED
@@ -4,6 +4,7 @@ require 'ra10ke/version'
|
|
4
4
|
require 'ra10ke/solve'
|
5
5
|
require 'ra10ke/syntax'
|
6
6
|
require 'ra10ke/dependencies'
|
7
|
+
require 'ra10ke/deprecation'
|
7
8
|
require 'ra10ke/duplicates'
|
8
9
|
require 'ra10ke/install'
|
9
10
|
require 'ra10ke/validate'
|
@@ -15,6 +16,7 @@ module Ra10ke
|
|
15
16
|
include Ra10ke::Solve
|
16
17
|
include Ra10ke::Syntax
|
17
18
|
include Ra10ke::Dependencies
|
19
|
+
include Ra10ke::Deprecation
|
18
20
|
include Ra10ke::Duplicates
|
19
21
|
include Ra10ke::Install
|
20
22
|
include Ra10ke::Validate
|
@@ -35,14 +37,18 @@ module Ra10ke
|
|
35
37
|
define_task_solve_dependencies(*args)
|
36
38
|
define_task_syntax(*args)
|
37
39
|
define_task_dependencies(*args)
|
40
|
+
define_task_deprecation(*args)
|
38
41
|
define_task_duplicates(*args)
|
39
42
|
define_task_install(*args)
|
40
43
|
define_task_validate(*args)
|
44
|
+
define_task_print_git_conversion(*args)
|
41
45
|
end
|
42
46
|
end
|
43
47
|
|
44
48
|
def get_puppetfile
|
45
49
|
R10K::Puppetfile.new(@basedir, @moduledir, @puppetfile_path, @puppetfile_name, @force)
|
50
|
+
rescue ArgumentError # R10k < 2.6.0
|
51
|
+
R10K::Puppetfile.new(@basedir, @moduledir, @puppetfile_path || File.join(@basedir, @puppetfile_name || 'Puppetfile'))
|
46
52
|
end
|
47
53
|
end
|
48
54
|
end
|
data/ra10ke.gemspec
CHANGED
@@ -14,14 +14,17 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
16
16
|
spec.require_paths = ["lib"]
|
17
|
-
spec.required_ruby_version = '>= 2.
|
17
|
+
spec.required_ruby_version = '>= 2.6.0'
|
18
18
|
|
19
19
|
spec.add_dependency "rake"
|
20
20
|
spec.add_dependency "puppet_forge"
|
21
|
-
spec.add_dependency "r10k"
|
21
|
+
spec.add_dependency "r10k", '>= 2.6.5'
|
22
22
|
spec.add_dependency "git"
|
23
23
|
spec.add_dependency "solve"
|
24
24
|
spec.add_dependency 'semverse', '>= 2.0'
|
25
25
|
spec.add_dependency 'table_print', '~> 1.5.6'
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.6'
|
27
|
+
spec.add_development_dependency 'pry'
|
28
|
+
spec.add_development_dependency 'simplecov'
|
27
29
|
end
|
30
|
+
|
data/spec/fixtures/Puppetfile
CHANGED
@@ -0,0 +1,78 @@
|
|
1
|
+
# used in profiles
|
2
|
+
mod 'puppet/systemd', :latest
|
3
|
+
mod 'puppet/lldpd', :latest
|
4
|
+
mod 'puppet/ferm', :latest
|
5
|
+
mod 'puppet/borg', :latest
|
6
|
+
mod 'puppet/wireguard', :latest
|
7
|
+
mod 'puppet/bird', :latest
|
8
|
+
mod 'herculesteam/augeasproviders_pam', :latest
|
9
|
+
mod 'herculesteam/augeasproviders_shellvar', :latest
|
10
|
+
mod 'puppetlabs/vcsrepo', :latest
|
11
|
+
mod 'saz/ssh', :latest
|
12
|
+
mod 'puppet/r10k', :latest
|
13
|
+
mod 'puppet/dbbackup', :latest
|
14
|
+
mod 'puppet/mosquitto', :latest
|
15
|
+
mod 'puppet/grafana', :latest
|
16
|
+
mod 'puppet/nginx', :latest
|
17
|
+
mod 'puppet/ssh_keygen', :latest
|
18
|
+
mod 'puppet/unbound', :latest
|
19
|
+
mod 'puppetlabs/inifile', :latest
|
20
|
+
mod 'puppet/prometheus', :latest
|
21
|
+
mod 'theforeman/foreman', :latest
|
22
|
+
mod 'theforeman/puppet', :latest
|
23
|
+
mod 'theforeman/foreman_proxy', :latest
|
24
|
+
mod 'puppet/nftables', :latest
|
25
|
+
mod 'herculesteam/augeasproviders_sysctl', :latest
|
26
|
+
mod 'camptocamp/catalog_diff', :latest
|
27
|
+
mod 'puppet/unattended_upgrades', :latest
|
28
|
+
mod 'puppet/selinux', :latest
|
29
|
+
mod 'choria/choria', :latest
|
30
|
+
mod 'puppet/archive', :latest
|
31
|
+
mod 'puppet/elasticsearch', :latest
|
32
|
+
mod 'jsok/vault',
|
33
|
+
git: 'https://github.com/bastelfreak/puppet-vault',
|
34
|
+
ref: 'test'
|
35
|
+
|
36
|
+
# dependencies
|
37
|
+
mod 'herculesteam/augeasproviders_core', :latest
|
38
|
+
mod 'puppetlabs/stdlib', :latest
|
39
|
+
mod 'choria/mcollective', :latest
|
40
|
+
mod 'puppetlabs/concat', :latest
|
41
|
+
mod 'puppetlabs/apt', :latest
|
42
|
+
mod 'puppetlabs/apache', :latest
|
43
|
+
mod 'puppetlabs/postgresql', :latest
|
44
|
+
mod 'puppet/extlib', :latest
|
45
|
+
mod 'puppet/redis', :latest
|
46
|
+
mod 'puppet/epel', :latest
|
47
|
+
mod 'theforeman/puppetserver_foreman', :latest
|
48
|
+
mod 'richardc/datacat', :latest
|
49
|
+
mod 'theforeman/dns', :latest
|
50
|
+
mod 'theforeman/dhcp', :latest
|
51
|
+
mod 'theforeman/tftp', :latest
|
52
|
+
mod 'puppetlabs/xinetd', :latest
|
53
|
+
mod 'choria-mcollective_choria', :latest
|
54
|
+
mod 'choria/mcollective_agent_puppet', :latest
|
55
|
+
mod 'choria/mcollective_agent_package', :latest
|
56
|
+
mod 'choria/mcollective_agent_service', :latest
|
57
|
+
mod 'choria/mcollective_agent_filemgr', :latest
|
58
|
+
mod 'choria/mcollective_agent_shell', :latest
|
59
|
+
mod 'choria/mcollective_agent_nettest', :latest
|
60
|
+
mod 'choria/mcollective_agent_puppetca', :latest
|
61
|
+
mod 'choria/mcollective_agent_bolt_tasks', :latest
|
62
|
+
mod 'choria/mcollective_agent_iptables', :latest
|
63
|
+
mod 'choria/mcollective_agent_process', :latest
|
64
|
+
mod 'choria/mcollective_util_actionpolicy', :latest
|
65
|
+
mod 'optiz0r/mcollective_agent_puppet_env', :latest
|
66
|
+
mod 'jay7x/mcollective_agent_query', :latest
|
67
|
+
mod 'choria/mcollective_data_sysctl', :latest
|
68
|
+
mod 'puppet/yum', :latest
|
69
|
+
mod 'puppetlabs/java', :latest
|
70
|
+
mod 'puppet/elastic_stack', :latest
|
71
|
+
mod 'puppet/hashi_stack', :latest
|
72
|
+
|
73
|
+
# core modules are not vendored on Gentoo
|
74
|
+
mod 'puppetlabs-sshkeys_core', :latest
|
75
|
+
mod 'puppetlabs-mount_core', :latest
|
76
|
+
mod 'puppetlabs-augeas_core', :latest
|
77
|
+
mod 'puppetlabs-selinux_core', :latest
|
78
|
+
mod 'puppetlabs-yumrepo_core', :latest
|
@@ -0,0 +1,28 @@
|
|
1
|
+
mod 'choria',
|
2
|
+
:git => 'https://github.com/choria-io/puppet-choria',
|
3
|
+
:ref => '0.26.2'
|
4
|
+
|
5
|
+
mod 'inifile',
|
6
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-inifile',
|
7
|
+
:ref => '2.2.0'
|
8
|
+
|
9
|
+
mod 'ruby',
|
10
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-ruby.git',
|
11
|
+
:ref => 'v1.0.1'
|
12
|
+
|
13
|
+
mod 'stdlib',
|
14
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib',
|
15
|
+
:ref => '4.24.0'
|
16
|
+
|
17
|
+
mod 'concat',
|
18
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-concat',
|
19
|
+
:ref => '4.0.0'
|
20
|
+
|
21
|
+
mod 'ntp',
|
22
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-ntp',
|
23
|
+
:ref => '6.4.1'
|
24
|
+
|
25
|
+
mod 'archive',
|
26
|
+
:git => 'https://github.com/voxpupuli/puppet-archive',
|
27
|
+
:ref => 'v3.1.1'
|
28
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
mod 'puppet-hiera_master',
|
2
|
+
git: 'https://github.com/voxpupuli/puppet-hiera_master.git',
|
3
|
+
branch: master
|
4
|
+
|
5
|
+
mod 'puppet-hiera_control',
|
6
|
+
git: 'https://github.com/voxpupuli/puppet-hiera_control.git',
|
7
|
+
branch: :control_branch
|
8
|
+
|
9
|
+
mod 'puppet-hiera_controlwithdefault',
|
10
|
+
git: 'https://github.com/voxpupuli/puppet-hiera_control.git',
|
11
|
+
branch: :control_branch,
|
12
|
+
default_branch: 'master'
|
13
|
+
|
14
|
+
mod 'puppet-hiera_controlwithdefaultoverride',
|
15
|
+
git: 'https://github.com/voxpupuli/puppet-hiera_control.git',
|
16
|
+
branch: :control_branch,
|
17
|
+
default_branch_override: 'master',
|
18
|
+
default_branch: 'devel'
|
19
|
+
|
20
|
+
mod 'puppet-hiera_fakecontrol',
|
21
|
+
git: 'https://github.com/voxpupuli/puppet-hiera_fakecontrol.git',
|
22
|
+
branch: control_branch
|
23
|
+
|
File without changes
|