opswalrus 1.0.43 → 1.0.45

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c95b5c18a56463ccb9dd8db68875978eb57e3e5311a73825e27b1c893486d1ec
4
- data.tar.gz: '05889e0f2398083e580406575914265488eb97ce98db67aeac92536dc6bc1294'
3
+ metadata.gz: ab0f69f8661c6d29f48d0ad70f4046b6d53a3dbe167958668e09005b2086f175
4
+ data.tar.gz: 5159cfc4bb7cb0ed366b9f3197d3926c77bd22a6482f2a376c9f6baf4fb36238
5
5
  SHA512:
6
- metadata.gz: 8147ed4fa64cdd0c8125ef6c885fac72075fe4e211e8b31275b7961689d370f44ea10cde45f83df352e35dab4d06c1a4cadd063286bb34d9d29312f8a943213c
7
- data.tar.gz: fdb7a00079382392fc1631f85a64f8939936e9731586fed8c9a63c42557f59540665889376f4e2deec382c08c39d32bab52ce9e62dabbfd50eba87bd1d1397be
6
+ metadata.gz: 445960c704e60c61b49a54eb3ea9950fda2f8b0c124bb7d7876849a5d9985fc3eeba80d907d6fb0a90305eff6139bfde886756bdf5dc2d43b04685191dd872ad
7
+ data.tar.gz: c78e9d383c7f9351d47b67b92664d5e407344ed305fc78bc15fb74829a68033c7d0f754c8f1e5d26ab06d61325a6ba9a09d7f9324d5676ec08008dd9b6d497d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.43)
4
+ opswalrus (1.0.45)
5
5
  bcrypt_pbkdf (~> 1.1)
6
6
  binding_of_caller (~> 1.0)
7
7
  citrus (~> 3.0)
data/build.ops CHANGED
@@ -53,6 +53,6 @@ if bw_status_json['status'] != 'unlocked'
53
53
  end
54
54
 
55
55
  totp = sh("Get Rubygems OTP") { 'bw get totp Rubygems' }
56
- sh("Push gem", input: {"You have enabled multi-factor authentication. Please enter OTP code." => "#{totp}\n"}) { 'gem push opswalrus-{{ version }}.gem' }
56
+ sh("Push gem", input: {/You have enabled multi-factor authentication. Please enter OTP code./ => "#{totp}\n"}) { 'gem push opswalrus-{{ version }}.gem' }
57
57
  sh("Build docker image") { 'docker build -t ghcr.io/opswalrus/ops:latest -t ghcr.io/opswalrus/ops:{{ version }} -t opswalrus/ops:latest -t opswalrus/ops:{{ version }} .' }
58
58
  sh("Push docker image to ghcr.io/opswalrus/ops") { 'docker push ghcr.io/opswalrus/ops:latest' }
@@ -427,7 +427,7 @@ module OpsWalrus
427
427
  sudo_password_args = {}
428
428
  sudo_password_args[:sudo_password] = ssh_password unless ops_prompt_for_sudo_password
429
429
  sudo_password_args[:ops_sudo_password] = ssh_password if ops_prompt_for_sudo_password
430
- @runtime_env.handle_input(input_mapping, **sudo_password_args) do |interaction_handler|
430
+ @runtime_env.handle_input(input_mapping, **sudo_password_args, inherit_existing_mappings: false) do |interaction_handler|
431
431
  # @sshkit_backend.capture(*args, interaction_handler: interaction_handler, verbosity: SSHKit.config.output_verbosity)
432
432
  App.instance.debug("Host#execute_cmd(#{args.inspect}) with input mappings #{interaction_handler.input_mappings.inspect} given sudo_password_args: #{sudo_password_args.inspect})")
433
433
  @sshkit_backend.capture(*args, interaction_handler: interaction_handler)
@@ -443,7 +443,7 @@ module OpsWalrus
443
443
  sudo_password_args = {}
444
444
  sudo_password_args[:sudo_password] = ssh_password unless ops_prompt_for_sudo_password
445
445
  sudo_password_args[:ops_sudo_password] = ssh_password if ops_prompt_for_sudo_password
446
- @runtime_env.handle_input(input_mapping, **sudo_password_args) do |interaction_handler|
446
+ @runtime_env.handle_input(input_mapping, **sudo_password_args, inherit_existing_mappings: false) do |interaction_handler|
447
447
  App.instance.debug("Host#execute_cmd(#{args.inspect}) with input mappings #{interaction_handler.input_mappings.inspect} given sudo_password_args: #{sudo_password_args.inspect})")
448
448
  @sshkit_backend.execute_cmd(*args, interaction_handler: interaction_handler)
449
449
  end
@@ -33,7 +33,7 @@ module OpsWalrus
33
33
  # when the given block returns, then the temporary mapping is removed from the interaction handler
34
34
  #
35
35
  # mapping : Hash[ String | Regex => String ] | Nil
36
- def with_mapping(mapping = nil, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: false)
36
+ def with_mapping(mapping = nil, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true)
37
37
  new_mapping = inherit_existing_mappings ? @input_mappings : {}
38
38
 
39
39
  if mapping
@@ -264,9 +264,10 @@ module OpsWalrus
264
264
  out, err, exit_status = if App.instance.dry_run?
265
265
  ["", "", 0]
266
266
  else
267
- sshkit_cmd = @runtime_env.handle_input(input) do |interaction_handler|
267
+ sshkit_cmd = @runtime_env.handle_input(input, inherit_existing_mappings: true) do |interaction_handler|
268
268
  # self is a Module instance that is serving as the evaluation context in an instance of a subclass of an Invocation; see Invocation#evaluate
269
269
  # backend.execute_cmd(cmd, interaction_handler: interaction_handler, verbosity: SSHKit.config.output_verbosity)
270
+ App.instance.debug("OpsFileScriptDSL#shell! cmd=#{cmd} with input mappings #{interaction_handler.input_mappings.inspect} given input: #{input.inspect})")
270
271
  backend.execute_cmd(cmd, interaction_handler: interaction_handler)
271
272
  end
272
273
  [sshkit_cmd.full_stdout, sshkit_cmd.full_stderr, sshkit_cmd.exit_status]
@@ -258,7 +258,7 @@ module OpsWalrus
258
258
 
259
259
  # input_mapping : Hash[ String | Regex => String ]
260
260
  # sudo_password : String
261
- def handle_input(input_mapping, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: false, &block)
261
+ def handle_input(input_mapping, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true, &block)
262
262
  @interaction_handler.with_mapping(
263
263
  input_mapping,
264
264
  sudo_password: sudo_password,
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.43"
2
+ VERSION = "1.0.45"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opswalrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.43
4
+ version: 1.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis