r10k 3.5.2 → 3.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +4 -1
  3. data/.github/workflows/docker.yml +4 -1
  4. data/.github/workflows/release.yml +3 -2
  5. data/.github/workflows/rspec_tests.yml +81 -0
  6. data/.github/workflows/stale.yml +19 -0
  7. data/.travis.yml +8 -1
  8. data/CHANGELOG.mkd +43 -1
  9. data/CODEOWNERS +2 -2
  10. data/README.mkd +13 -4
  11. data/doc/common-patterns.mkd +1 -0
  12. data/doc/dynamic-environments/configuration.mkd +149 -45
  13. data/doc/dynamic-environments/usage.mkd +12 -11
  14. data/doc/puppetfile.mkd +23 -3
  15. data/docker/Gemfile +1 -1
  16. data/docker/Makefile +7 -4
  17. data/docker/docker-compose.yml +18 -0
  18. data/docker/r10k/Dockerfile +4 -3
  19. data/docker/r10k/docker-entrypoint.sh +0 -1
  20. data/docker/r10k/release.Dockerfile +3 -2
  21. data/docker/spec/dockerfile_spec.rb +26 -32
  22. data/integration/tests/git_source/git_source_repeated_remote.rb +68 -0
  23. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +2 -1
  24. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +2 -1
  25. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +1 -1
  26. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +2 -1
  27. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +1 -1
  28. data/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb +1 -1
  29. data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +1 -1
  30. data/lib/r10k/action/base.rb +8 -1
  31. data/lib/r10k/action/deploy/display.rb +46 -10
  32. data/lib/r10k/action/deploy/environment.rb +98 -50
  33. data/lib/r10k/action/deploy/module.rb +51 -29
  34. data/lib/r10k/action/puppetfile/check.rb +3 -1
  35. data/lib/r10k/action/puppetfile/install.rb +20 -23
  36. data/lib/r10k/action/puppetfile/purge.rb +8 -2
  37. data/lib/r10k/action/runner.rb +34 -0
  38. data/lib/r10k/cli/deploy.rb +14 -7
  39. data/lib/r10k/cli/puppetfile.rb +5 -5
  40. data/lib/r10k/content_synchronizer.rb +83 -0
  41. data/lib/r10k/deployment.rb +1 -1
  42. data/lib/r10k/environment/base.rb +30 -3
  43. data/lib/r10k/environment/git.rb +17 -5
  44. data/lib/r10k/environment/name.rb +22 -4
  45. data/lib/r10k/environment/svn.rb +11 -4
  46. data/lib/r10k/environment/with_modules.rb +46 -30
  47. data/lib/r10k/git.rb +1 -0
  48. data/lib/r10k/git/cache.rb +12 -4
  49. data/lib/r10k/git/rugged/credentials.rb +39 -2
  50. data/lib/r10k/git/stateful_repository.rb +4 -0
  51. data/lib/r10k/initializers.rb +2 -0
  52. data/lib/r10k/module.rb +1 -1
  53. data/lib/r10k/module/base.rb +25 -1
  54. data/lib/r10k/module/forge.rb +29 -11
  55. data/lib/r10k/module/git.rb +54 -27
  56. data/lib/r10k/module/local.rb +2 -1
  57. data/lib/r10k/module/svn.rb +24 -18
  58. data/lib/r10k/puppetfile.rb +75 -72
  59. data/lib/r10k/settings.rb +30 -3
  60. data/lib/r10k/source/base.rb +9 -0
  61. data/lib/r10k/source/git.rb +40 -9
  62. data/lib/r10k/source/hash.rb +5 -5
  63. data/lib/r10k/source/svn.rb +5 -3
  64. data/lib/r10k/util/cleaner.rb +21 -0
  65. data/lib/r10k/util/setopts.rb +33 -12
  66. data/lib/r10k/version.rb +1 -1
  67. data/locales/r10k.pot +103 -83
  68. data/r10k.gemspec +1 -1
  69. data/spec/fixtures/unit/action/r10k_creds.yaml +9 -0
  70. data/spec/r10k-mocks/mock_source.rb +1 -1
  71. data/spec/shared-examples/puppetfile-action.rb +7 -7
  72. data/spec/shared-examples/subprocess-runner.rb +11 -5
  73. data/spec/unit/action/deploy/display_spec.rb +35 -5
  74. data/spec/unit/action/deploy/environment_spec.rb +207 -37
  75. data/spec/unit/action/deploy/module_spec.rb +173 -26
  76. data/spec/unit/action/puppetfile/check_spec.rb +2 -2
  77. data/spec/unit/action/puppetfile/install_spec.rb +32 -10
  78. data/spec/unit/action/puppetfile/purge_spec.rb +25 -5
  79. data/spec/unit/action/runner_spec.rb +48 -1
  80. data/spec/unit/environment/git_spec.rb +19 -2
  81. data/spec/unit/environment/name_spec.rb +28 -0
  82. data/spec/unit/environment/svn_spec.rb +12 -0
  83. data/spec/unit/environment/with_modules_spec.rb +74 -0
  84. data/spec/unit/git/cache_spec.rb +10 -0
  85. data/spec/unit/git/rugged/credentials_spec.rb +79 -2
  86. data/spec/unit/git_spec.rb +3 -3
  87. data/spec/unit/module/forge_spec.rb +21 -13
  88. data/spec/unit/module/git_spec.rb +64 -1
  89. data/spec/unit/module_spec.rb +60 -10
  90. data/spec/unit/puppetfile_spec.rb +98 -30
  91. data/spec/unit/settings_spec.rb +12 -0
  92. data/spec/unit/source/git_spec.rb +49 -1
  93. data/spec/unit/util/purgeable_spec.rb +2 -8
  94. data/spec/unit/util/setopts_spec.rb +25 -1
  95. metadata +12 -11
  96. data/azure-pipelines.yml +0 -86
@@ -9,17 +9,45 @@ module R10K
9
9
 
10
10
  include R10K::Action::Deploy::DeployHelpers
11
11
 
12
+ # @param opts [Hash] A hash of options defined in #allowed_initialized_opts
13
+ # and managed by the SetOps mixin within the Action::Base class.
14
+ # Corresponds to the CLI flags and options.
15
+ # @param argv [CRI::ArgumentList] A list-like collection of the remaining
16
+ # arguments to the CLI invocation (after removing flags and options).
17
+ # @param settings [Hash] A hash of configuration loaded from the relevant
18
+ # config (r10k.yaml).
19
+ def initialize(opts, argv, settings)
20
+ super
21
+
22
+ @settings = @settings.merge({
23
+ overrides: {
24
+ environments: {
25
+ preload_environments: @fetch,
26
+ requested_environments: @argv.map { |arg| arg.gsub(/\W/, '_') }
27
+ },
28
+ modules: {},
29
+ output: {
30
+ format: @format,
31
+ trace: @trace,
32
+ detail: @detail
33
+ },
34
+ purging: {}
35
+ }
36
+ })
37
+ end
38
+
12
39
  def call
13
40
  expect_config!
14
41
  deployment = R10K::Deployment.new(@settings)
15
42
 
16
- if @fetch
43
+ if @settings.dig(:overrides, :environments, :preload_environments)
17
44
  deployment.preload!
45
+ deployment.validate!
18
46
  end
19
47
 
20
- output = { :sources => deployment.sources.map { |source| source_info(source, @argv) } }
48
+ output = { :sources => deployment.sources.map { |source| source_info(source, @settings.dig(:overrides, :environments, :requested_environments)) } }
21
49
 
22
- case @format
50
+ case @settings.dig(:overrides, :output, :format)
23
51
  when 'json' then json_format(output)
24
52
  else yaml_format(output)
25
53
  end
@@ -27,7 +55,7 @@ module R10K
27
55
  # exit 0
28
56
  true
29
57
  rescue => e
30
- logger.error R10K::Errors::Formatting.format_exception(e, @trace)
58
+ logger.error R10K::Errors::Formatting.format_exception(e, @settings.dig(:overrides, :output, :trace))
31
59
  false
32
60
  end
33
61
 
@@ -43,7 +71,7 @@ module R10K
43
71
  puts output.to_yaml
44
72
  end
45
73
 
46
- def source_info(source, argv=[])
74
+ def source_info(source, requested_environments = [])
47
75
  source_info = {
48
76
  :name => source.name,
49
77
  :basedir => source.basedir,
@@ -52,28 +80,30 @@ module R10K
52
80
  source_info[:prefix] = source.prefix if source.prefix
53
81
  source_info[:remote] = source.remote if source.respond_to?(:remote)
54
82
 
55
- env_list = source.environments.select { |env| argv.empty? || argv.include?(env.name) }
83
+ select_all_envs = requested_environments.empty?
84
+ env_list = source.environments.select { |env| select_all_envs || requested_environments.include?(env.name) }
56
85
  source_info[:environments] = env_list.map { |env| environment_info(env) }
57
86
 
58
87
  source_info
59
88
  end
60
89
 
61
90
  def environment_info(env)
62
- if !@puppetfile && !@detail
91
+ modules = @settings.dig(:overrides, :environments, :deploy_modules)
92
+ if !modules && !@settings.dig(:overrides, :output, :detail)
63
93
  env.dirname
64
94
  else
65
95
  env_info = env.info.merge({
66
96
  :status => (env.status rescue nil),
67
97
  })
68
98
 
69
- env_info[:modules] = env.modules.map { |mod| module_info(mod) } if @puppetfile
99
+ env_info[:modules] = env.modules.map { |mod| module_info(mod) } if modules
70
100
 
71
101
  env_info
72
102
  end
73
103
  end
74
104
 
75
105
  def module_info(mod)
76
- if @detail
106
+ if @settings.dig(:overrides, :output, :detail)
77
107
  { :name => mod.title, :properties => mod.properties }
78
108
  else
79
109
  mod.title
@@ -81,7 +111,13 @@ module R10K
81
111
  end
82
112
 
83
113
  def allowed_initialize_opts
84
- super.merge(puppetfile: :self, detail: :self, format: :self, fetch: :self)
114
+ super.merge({
115
+ puppetfile: :modules,
116
+ modules: :self,
117
+ detail: :self,
118
+ format: :self,
119
+ fetch: :self
120
+ })
85
121
  end
86
122
  end
87
123
  end
@@ -1,4 +1,5 @@
1
1
  require 'r10k/util/setopts'
2
+ require 'r10k/util/cleaner'
2
3
  require 'r10k/deployment'
3
4
  require 'r10k/logging'
4
5
  require 'r10k/action/visitor'
@@ -13,29 +14,61 @@ module R10K
13
14
 
14
15
  include R10K::Action::Deploy::DeployHelpers
15
16
 
17
+ # Deprecated
16
18
  attr_reader :force
17
19
 
18
- def initialize(opts, argv, settings = nil)
19
- settings ||= {}
20
- @purge_levels = settings.fetch(:deploy, {}).fetch(:purge_levels, [])
21
- @user_purge_whitelist = settings.fetch(:deploy, {}).fetch(:purge_whitelist, [])
22
- @generate_types = settings.fetch(:deploy, {}).fetch(:generate_types, false)
20
+ attr_reader :settings
23
21
 
22
+ # @param opts [Hash] A hash of options defined in #allowed_initialized_opts
23
+ # and managed by the SetOps mixin within the Action::Base class.
24
+ # Corresponds to the CLI flags and options.
25
+ # @param argv [CRI::ArgumentList] A list-like collection of the remaining
26
+ # arguments to the CLI invocation (after removing flags and options).
27
+ # @param settings [Hash] A hash of configuration loaded from the relevant
28
+ # config (r10k.yaml).
29
+ def initialize(opts, argv, settings)
24
30
  super
25
31
 
26
- # @force here is used to make it easier to reason about
27
- @force = !@no_force
28
- @argv = @argv.map { |arg| arg.gsub(/\W/,'_') }
32
+ # instance variables below are set by the super class based on the
33
+ # spec of #allowed_initialize_opts and any command line flags. This
34
+ # gives a preference order of cli flags > config files > defaults.
35
+ @settings = @settings.merge({
36
+ overrides: {
37
+ environments: {
38
+ requested_environments: @argv.map { |arg| arg.gsub(/\W/,'_') },
39
+ default_branch_override: @default_branch_override,
40
+ generate_types: @generate_types || settings.dig(:deploy, :generate_types) || false,
41
+ preload_environments: true
42
+ },
43
+ modules: {
44
+ requested_modules: [],
45
+ deploy_modules: @modules,
46
+ force: !@no_force, # force here is used to make it easier to reason about
47
+ },
48
+ purging: {
49
+ purge_levels: settings.dig(:deploy, :purge_levels) || [],
50
+ purge_allowlist: read_purge_allowlist(settings.dig(:deploy, :purge_whitelist) || [],
51
+ settings.dig(:deploy, :purge_allowlist) || [])
52
+ },
53
+ output: {}
54
+ }
55
+ })
29
56
  end
30
57
 
31
58
  def call
32
59
  @visit_ok = true
33
60
 
34
- expect_config!
35
- deployment = R10K::Deployment.new(@settings)
36
- check_write_lock!(@settings)
61
+ begin
62
+ expect_config!
63
+ deployment = R10K::Deployment.new(@settings)
64
+ check_write_lock!(@settings)
65
+
66
+ deployment.accept(self)
67
+ rescue => e
68
+ @visit_ok = false
69
+ logger.error R10K::Errors::Formatting.format_exception(e, @trace)
70
+ end
37
71
 
38
- deployment.accept(self)
39
72
  @visit_ok
40
73
  end
41
74
 
@@ -43,15 +76,34 @@ module R10K
43
76
 
44
77
  private
45
78
 
79
+ def read_purge_allowlist (whitelist, allowlist)
80
+ whitelist_has_content = !whitelist.empty?
81
+ allowlist_has_content = !allowlist.empty?
82
+ case
83
+ when whitelist_has_content == false && allowlist_has_content == false
84
+ []
85
+ when whitelist_has_content && allowlist_has_content
86
+ raise R10K::Error.new "Values found for both purge_whitelist and purge_allowlist. Setting " <<
87
+ "purge_whitelist is deprecated, please only use purge_allowlist."
88
+ when allowlist_has_content
89
+ allowlist
90
+ else
91
+ logger.warn "Setting purge_whitelist is deprecated; please use purge_allowlist instead."
92
+ whitelist
93
+ end
94
+ end
95
+
46
96
  def visit_deployment(deployment)
47
97
  # Ensure that everything can be preloaded. If we cannot preload all
48
98
  # sources then we can't fully enumerate all environments which
49
99
  # could be dangerous. If this fails then an exception will be raised
50
100
  # and execution will be halted.
51
- deployment.preload!
52
- deployment.validate!
101
+ if @settings.dig(:overrides, :environments, :preload_environments)
102
+ deployment.preload!
103
+ deployment.validate!
104
+ end
53
105
 
54
- undeployable = undeployable_environment_names(deployment.environments, @argv)
106
+ undeployable = undeployable_environment_names(deployment.environments, @settings.dig(:overrides, :environments, :requested_environments))
55
107
  if !undeployable.empty?
56
108
  @visit_ok = false
57
109
  logger.error _("Environment(s) \'%{environments}\' cannot be found in any source and will not be deployed.") % {environments: undeployable.join(", ")}
@@ -59,7 +111,7 @@ module R10K
59
111
 
60
112
  yield
61
113
 
62
- if @purge_levels.include?(:deployment)
114
+ if @settings.dig(:overrides, :purging, :purge_levels).include?(:deployment)
63
115
  logger.debug("Purging unmanaged environments for deployment...")
64
116
  deployment.purge!
65
117
  end
@@ -67,7 +119,8 @@ module R10K
67
119
  if (postcmd = @settings[:postrun])
68
120
  if postcmd.grep('$modifiedenvs').any?
69
121
  envs = deployment.environments.map { |e| e.dirname }
70
- envs.reject! { |e| !@argv.include?(e) } if @argv.any?
122
+ requested_envs = @settings.dig(:overrides, :environments, :requested_environments)
123
+ envs.reject! { |e| !requested_envs.include?(e) } if requested_envs.any?
71
124
  postcmd = postcmd.map { |e| e.gsub('$modifiedenvs', envs.join(' ')) }
72
125
  end
73
126
  subproc = R10K::Util::Subprocess.new(postcmd)
@@ -81,7 +134,8 @@ module R10K
81
134
  end
82
135
 
83
136
  def visit_environment(environment)
84
- if !(@argv.empty? || @argv.any? { |name| environment.dirname == name })
137
+ requested_envs = @settings.dig(:overrides, :environments, :requested_environments)
138
+ if !(requested_envs.empty? || requested_envs.any? { |name| environment.dirname == name })
85
139
  logger.debug1(_("Environment %{env_dir} does not match environment name filter, skipping") % {env_dir: environment.dirname})
86
140
  return
87
141
  end
@@ -95,28 +149,31 @@ module R10K
95
149
  environment.sync
96
150
  logger.info _("Environment %{env_dir} is now at %{env_signature}") % {env_dir: environment.dirname, env_signature: environment.signature}
97
151
 
98
- if status == :absent || @puppetfile
152
+ if status == :absent || @settings.dig(:overrides, :modules, :deploy_modules)
99
153
  if status == :absent
100
154
  logger.debug(_("Environment %{env_dir} is new, updating all modules") % {env_dir: environment.dirname})
101
155
  end
102
156
 
103
157
  previous_ok = @visit_ok
104
158
  @visit_ok = true
105
- yield
159
+
160
+ environment.deploy
161
+
106
162
  @environment_ok = @visit_ok
107
163
  @visit_ok &&= previous_ok
108
164
  end
109
165
 
110
- if @purge_levels.include?(:environment)
166
+
167
+ if @settings.dig(:overrides, :purging, :purge_levels).include?(:environment)
111
168
  if @visit_ok
112
169
  logger.debug("Purging unmanaged content for environment '#{environment.dirname}'...")
113
- environment.purge!(:recurse => true, :whitelist => environment.whitelist(@user_purge_whitelist))
170
+ environment.purge!(:recurse => true, :whitelist => environment.whitelist(@settings.dig(:overrides, :purging, :purge_allowlist)))
114
171
  else
115
172
  logger.debug("Not purging unmanaged content for environment '#{environment.dirname}' due to prior deploy failures.")
116
173
  end
117
174
  end
118
175
 
119
- if @generate_types
176
+ if @settings.dig(:overrides, :environments, :generate_types)
120
177
  if @environment_ok
121
178
  logger.debug("Generating puppet types for environment '#{environment.dirname}'...")
122
179
  environment.generate_types!
@@ -128,34 +185,21 @@ module R10K
128
185
  write_environment_info!(environment, started_at, @visit_ok)
129
186
  end
130
187
 
131
- def visit_puppetfile(puppetfile)
132
- puppetfile.load(@opts[:'default-branch-override'])
133
-
134
- yield
135
-
136
- if @purge_levels.include?(:puppetfile)
137
- logger.debug("Purging unmanaged Puppetfile content for environment '#{puppetfile.environment.dirname}'...")
138
- puppetfile.purge!
139
- end
140
- end
141
-
142
- def visit_module(mod)
143
- logger.info _("Deploying %{origin} content %{path}") % {origin: mod.origin, path: mod.path}
144
- mod.sync(force: @force)
145
- end
146
-
147
188
  def write_environment_info!(environment, started_at, success)
148
- module_deploys = []
149
- begin
150
- environment.modules.each do |mod|
151
- name = mod.name
152
- version = mod.version
153
- sha = mod.repo.head rescue nil
154
- module_deploys.push({:name => name, :version => version, :sha => sha})
189
+ module_deploys =
190
+ begin
191
+ environment.modules.map do |mod|
192
+ props = mod.properties
193
+ {
194
+ name: mod.name,
195
+ version: props[:expected],
196
+ sha: props[:type] == :git ? props[:actual] : nil
197
+ }
198
+ end
199
+ rescue
200
+ logger.debug("Unable to get environment module deploy data for .r10k-deploy.json at #{environment.path}")
201
+ []
155
202
  end
156
- rescue
157
- logger.debug("Unable to get environment module deploy data for .r10k-deploy.json at #{environment.path}")
158
- end
159
203
 
160
204
  # make this file write as atomic as possible in pure ruby
161
205
  final = "#{environment.path}/.r10k-deploy.json"
@@ -183,11 +227,15 @@ module R10K
183
227
  end
184
228
 
185
229
  def allowed_initialize_opts
186
- super.merge(puppetfile: :self,
230
+ super.merge(puppetfile: :modules,
231
+ modules: :self,
187
232
  cachedir: :self,
188
233
  'no-force': :self,
189
234
  'generate-types': :self,
190
235
  'puppet-path': :self,
236
+ 'puppet-conf': :self,
237
+ 'private-key': :self,
238
+ 'oauth-token': :self,
191
239
  'default-branch-override': :self)
192
240
  end
193
241
  end
@@ -10,25 +10,53 @@ module R10K
10
10
 
11
11
  include R10K::Action::Deploy::DeployHelpers
12
12
 
13
+ # Deprecated
13
14
  attr_reader :force
14
15
 
15
- def initialize(opts, argv, settings = nil)
16
- settings ||= {}
16
+ attr_reader :settings
17
17
 
18
+ # @param opts [Hash] A hash of options defined in #allowed_initialized_opts
19
+ # and managed by the SetOps mixin within the Action::Base class.
20
+ # Corresponds to the CLI flags and options.
21
+ # @param argv [CRI::ArgumentList] A list-like collection of the remaining
22
+ # arguments to the CLI invocation (after removing flags and options).
23
+ # @param settings [Hash] A hash of configuration loaded from the relevant
24
+ # config (r10k.yaml).
25
+ def initialize(opts, argv, settings)
18
26
  super
19
27
 
20
- # @force here is used to make it easier to reason about
21
- @force = !@no_force
28
+ requested_env = @opts[:environment] ? [@opts[:environment].gsub(/\W/, '_')] : []
29
+
30
+ @settings = @settings.merge({
31
+ overrides: {
32
+ environments: {
33
+ requested_environments: requested_env,
34
+ generate_types: @generate_types
35
+ },
36
+ modules: {
37
+ requested_modules: @argv.map.to_a,
38
+ # force here is used to make it easier to reason about
39
+ force: !@no_force
40
+ },
41
+ purging: {},
42
+ output: {}
43
+ }
44
+ })
22
45
  end
23
46
 
24
47
  def call
25
48
  @visit_ok = true
49
+ begin
50
+ expect_config!
51
+ deployment = R10K::Deployment.new(@settings)
52
+ check_write_lock!(@settings)
53
+
54
+ deployment.accept(self)
55
+ rescue => e
56
+ @visit_ok = false
57
+ logger.error R10K::Errors::Formatting.format_exception(e, @trace)
58
+ end
26
59
 
27
- expect_config!
28
- deployment = R10K::Deployment.new(@settings)
29
- check_write_lock!(@settings)
30
-
31
- deployment.accept(self)
32
60
  @visit_ok
33
61
  end
34
62
 
@@ -45,29 +73,20 @@ module R10K
45
73
  end
46
74
 
47
75
  def visit_environment(environment)
48
- if @opts[:environment] && (@opts[:environment] != environment.dirname)
49
- logger.debug1(_("Only updating modules in environment %{opt_env} skipping environment %{env_path}") % {opt_env: @opts[:environment], env_path: environment.path})
76
+ requested_envs = @settings.dig(:overrides, :environments, :requested_environments)
77
+ if !requested_envs.empty? && !requested_envs.include?(environment.dirname)
78
+ logger.debug1(_("Only updating modules in environment(s) %{opt_env} skipping environment %{env_path}") % {opt_env: requested_envs.inspect, env_path: environment.path})
50
79
  else
51
- logger.debug1(_("Updating modules %{modules} in environment %{env_path}") % {modules: @argv.inspect, env_path: environment.path})
52
- yield
53
- end
54
- end
80
+ logger.debug1(_("Updating modules %{modules} in environment %{env_path}") % {modules: @settings.dig(:overrides, :modules, :requested_modules).inspect, env_path: environment.path})
55
81
 
56
- def visit_puppetfile(puppetfile)
57
- puppetfile.load
58
- yield
59
- end
82
+ environment.deploy
60
83
 
61
- def visit_module(mod)
62
- if @argv.include?(mod.name)
63
- logger.info _("Deploying module %{mod_path}") % {mod_path: mod.path}
64
- mod.sync(force: @force)
65
- if mod.environment && @generate_types
66
- logger.debug("Generating puppet types for environment '#{mod.environment.dirname}'...")
67
- mod.environment.generate_types!
84
+ requested_mods = @settings.dig(:overrides, :modules, :requested_modules) || []
85
+ generate_types = @settings.dig(:overrides, :environments, :generate_types)
86
+ if generate_types && !((environment.modules.map(&:name) & requested_mods).empty?)
87
+ logger.debug("Generating puppet types for environment '#{environment.dirname}'...")
88
+ environment.generate_types!
68
89
  end
69
- else
70
- logger.debug1(_("Only updating modules %{modules}, skipping module %{mod_name}") % {modules: @argv.inspect, mod_name: mod.name})
71
90
  end
72
91
  end
73
92
 
@@ -76,7 +95,10 @@ module R10K
76
95
  cachedir: :self,
77
96
  'no-force': :self,
78
97
  'generate-types': :self,
79
- 'puppet-path': :self)
98
+ 'puppet-path': :self,
99
+ 'puppet-conf': :self,
100
+ 'private-key': :self,
101
+ 'oauth-token': :self)
80
102
  end
81
103
  end
82
104
  end