kitchen-yansible-pusher 0.3.0 → 0.3.2

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: b71ce84978f4c0c04f3bf960f22cb555ebd102da45854477215e8fec8c2dc030
4
- data.tar.gz: f36dd7eb60a4e3ffb01990ca40cb6d6049503eaa47e3af751abedc4f0036aed4
3
+ metadata.gz: 11fa36391470d9fc69222ba0009831a25af5cf03942eeba49b515df133d2f0d8
4
+ data.tar.gz: f7ec2a2c220c897e221cd1233686f223133898f93e634e27d9fcc77cbeb1cd3c
5
5
  SHA512:
6
- metadata.gz: e6cc7b7ba60df6febe0c8f96cf86a7349945483e049ad37e3ddbd27afd36f6ef9c621514d9321f256476a42220396da864a93459b98890ceb010805f29a02025
7
- data.tar.gz: 50ec8b60ecc6595597a1ea6c4d7cb74eaead95719bd1308a5954e9a40a0bd2f7750a4f81289fefac27ec3e983ec957973fa7437ba73e76538e80ae1f322cf8ca
6
+ metadata.gz: cbdfb4d9258cc47e26c2414a732e84c717a65bec8b072a4472a9bab7623caeca160c14d1c72141b8f72ae034275be3e8c30a7b8660482becae2e6ca1c5a11244
7
+ data.tar.gz: 5bae348c9fc6d424c24ff4f27aa92133bf390774418b5bd06dd86d4fa994dbcc49e19dd2a0bc86ce13746030989df6a35471bee046488697aa840b470221d527
data/CHANGELOG.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/jmtx1020/kitchen-yansible-pusher/tree/HEAD)
3
+ ## [v0.3.1](https://github.com/jmtx1020/kitchen-yansible-pusher/tree/v0.3.1) (2024-09-04)
4
4
 
5
- [Full Changelog](https://github.com/jmtx1020/kitchen-yansible-pusher/compare/v0.2.0...HEAD)
5
+ [Full Changelog](https://github.com/jmtx1020/kitchen-yansible-pusher/compare/v0.3.0...v0.3.1)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - throw error on error code [\#14](https://github.com/jmtx1020/kitchen-yansible-pusher/pull/14) ([jmtx1020](https://github.com/jmtx1020))
10
+
11
+ ## [v0.3.0](https://github.com/jmtx1020/kitchen-yansible-pusher/tree/v0.3.0) (2024-09-04)
12
+
13
+ [Full Changelog](https://github.com/jmtx1020/kitchen-yansible-pusher/compare/v0.2.0...v0.3.0)
6
14
 
7
15
  **Merged pull requests:**
8
16
 
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'kitchen/provisioner/base'
4
+ require 'kitchen/errors'
4
5
  require_relative '../yansible/pusher/version'
5
6
  require 'yaml'
7
+ require 'English'
6
8
 
7
9
  module Kitchen
8
10
  module Provisioner
@@ -71,7 +73,8 @@ module Kitchen
71
73
  def run_ansible
72
74
  command = build_ansible_command
73
75
  info("Running Ansible Command: #{command}")
74
- system(command)
76
+ system(ansible_env_vars, command)
77
+ raise Kitchen::ActionFailed, 'Ansible playbook execution failed' unless $CHILD_STATUS.success?
75
78
  end
76
79
 
77
80
  def create_inventory
@@ -144,8 +147,6 @@ module Kitchen
144
147
 
145
148
  def ansible_options
146
149
  %i[
147
- ansible_config
148
- ansible_env_vars
149
150
  ansible_use_private_key
150
151
  ansible_use_vault_password_file
151
152
  ansible_extra_flags
@@ -155,14 +156,13 @@ module Kitchen
155
156
  ]
156
157
  end
157
158
 
158
- def ansible_config(cmd)
159
- cmd.prepend("ANSIBLE_CONFIG=#{config[:config]}") if config[:config]
160
- cmd
161
- end
162
-
163
- def ansible_env_vars(cmd)
164
- config[:env_vars]&.each { |k, v| cmd.prepend("#{k}=\"#{v}\"") }
165
- cmd
159
+ def ansible_env_vars
160
+ env = ENV.to_h.dup
161
+ config[:env_vars]&.each do |key, value|
162
+ env[key.to_s] = value.to_s unless value.nil?
163
+ end
164
+ env['ANSIBLE_CONFIG'] = config[:config] unless config[:config].nil?
165
+ env
166
166
  end
167
167
 
168
168
  def ansible_extra_flags(cmd)
@@ -3,7 +3,7 @@
3
3
  module Kitchen
4
4
  module Yansible
5
5
  module Pusher
6
- VERSION = "0.3.0"
6
+ VERSION = "0.3.2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-yansible-pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose M. Tobar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-04 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A modern & minimalistic Ansible provisioner for Test Kitchen.
14
14
  email:
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubygems_version: 3.5.11
52
+ rubygems_version: 3.5.16
53
53
  signing_key:
54
54
  specification_version: 4
55
55
  summary: A modern & minimalistic Ansible provisioner for Test Kitchen.