Skip to content

Commit 4959c9f

Browse files
throw error on error code (#14)
* throw error on error code --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 52849a7 commit 4959c9f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Gemfile.lock

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
kitchen-yansible-pusher (0.3.0)
4+
kitchen-yansible-pusher (0.3.1)
55

66
GEM
77
remote: https://rubygems.org/
@@ -59,13 +59,12 @@ GEM
5959
rake (13.2.1)
6060
rbs (3.5.3)
6161
logger
62-
rexml (3.3.6)
63-
strscan
62+
rexml (3.3.7)
6463
rspec (3.13.0)
6564
rspec-core (~> 3.13.0)
6665
rspec-expectations (~> 3.13.0)
6766
rspec-mocks (~> 3.13.0)
68-
rspec-core (3.13.0)
67+
rspec-core (3.13.1)
6968
rspec-support (~> 3.13.0)
7069
rspec-expectations (3.13.2)
7170
diff-lcs (>= 1.2.0, < 2.0)
@@ -82,7 +81,6 @@ GEM
8281
unicode-display_width (>= 1.5, < 3.0)
8382
unicode_utils (~> 1.4)
8483
strings-ansi (0.2.0)
85-
strscan (3.1.0)
8684
test-kitchen (3.7.0)
8785
bcrypt_pbkdf (~> 1.0)
8886
chef-utils (>= 16.4.35)

lib/kitchen/provisioner/yansible_pusher.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'kitchen/provisioner/base'
4+
require 'kitchen/errors'
45
require_relative '../yansible/pusher/version'
56
require 'yaml'
67

@@ -72,6 +73,7 @@ def run_ansible
7273
command = build_ansible_command
7374
info("Running Ansible Command: #{command}")
7475
system(command)
76+
raise Kitchen::ActionFailed, 'Ansible playbook execution failed' unless $?.success?
7577
end
7678

7779
def create_inventory

lib/kitchen/yansible/pusher/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Kitchen
44
module Yansible
55
module Pusher
6-
VERSION = "0.3.0"
6+
VERSION = "0.3.1"
77
end
88
end
99
end

0 commit comments

Comments
 (0)