smart_proxy_ansible 3.5.7 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60ea073b5f26ee9b4a1f39f09658d89f54c126e16914f1139fb105a197714bbd
4
- data.tar.gz: e1e95bed81cc2cf6cf180852f010905f38790cee89a511207e45cfd449123688
3
+ metadata.gz: c94b0334ddc75bab338d79841ac4cc17d813b5f40c5e06c6f739cfd531d88320
4
+ data.tar.gz: bcf96f811ef107f4737bfa5f37ee9f2ac757bf50ac4a7b64b3e8c31397f60fc0
5
5
  SHA512:
6
- metadata.gz: 4829fdcc76602817f4e8fd1ce103cfbdd213bd492fa90fc0f280940a08cd094e1713d4e2dcf05b5500ec707166fb41428eb1f53616193110af6a5de120039c4c
7
- data.tar.gz: b943569f68bb3153167fd6ebc2746861e95525da5f86f9cbbdc1a577f98051142839e95cbed1cd87a76b62d0b7cff75ac4bc02bb3d3d96b45b0dc51f04c14d74
6
+ metadata.gz: f4f41d9c0a2875c5f33d245d8fec3fb8a15b457102c344bd20bd801e54911de91eabdced4816c968b3ce655ebae3e9292a822f2d75d57553c073aee93e4ac1a6
7
+ data.tar.gz: 8fbbf65cb55fc9082ed7194fee478f8334a15a90a1ab3302fef22cde827e920dce29aac775b374b2ba5d651240425c233a08ec72fe6404329137b148aa453e85
@@ -14,13 +14,13 @@ module Proxy
14
14
  end
15
15
 
16
16
  def get_playbooks_names(collections_path)
17
- Dir.glob("#{collections_path}/ansible_collections/*/*/playbooks/*").map do |path|
17
+ glob_path("#{collections_path}/ansible_collections/*/*/playbooks/*").map do |path|
18
18
  ReaderHelper.playbook_or_role_full_name(path)
19
19
  end
20
20
  end
21
21
 
22
22
  def read_collection_playbooks(collections_path, playbooks_to_import = nil)
23
- Dir.glob("#{collections_path}/ansible_collections/*/*/playbooks/*").map do |path|
23
+ glob_path("#{collections_path}/ansible_collections/*/*/playbooks/*").map do |path|
24
24
  name = ReaderHelper.playbook_or_role_full_name(path)
25
25
  {
26
26
  name: name,
@@ -31,6 +31,12 @@ module Proxy
31
31
  message = "Could not read Ansible playbooks #{collections_path} - #{e.message}"
32
32
  raise ReadPlaybooksException, message
33
33
  end
34
+
35
+ private
36
+
37
+ def glob_path(path)
38
+ Dir.glob path
39
+ end
34
40
  end
35
41
  end
36
42
  end
@@ -44,7 +44,7 @@ module Proxy
44
44
  end
45
45
 
46
46
  def read_collection_roles(collections_path)
47
- Dir.glob("#{collections_path}/ansible_collections/*/*/roles/*").map do |path|
47
+ glob_path("#{collections_path}/ansible_collections/*/*/roles/*").map do |path|
48
48
  ReaderHelper.playbook_or_role_full_name(path)
49
49
  end
50
50
  rescue Errno::ENOENT, Errno::EACCES => e
@@ -22,6 +22,7 @@ module Proxy::Ansible
22
22
  @verbosity_level = action_input[:verbosity_level]
23
23
  @rex_command = action_input[:remote_execution_command]
24
24
  @check_mode = action_input[:check_mode]
25
+ @job_check_mode = action_input[:job_check_mode]
25
26
  @tags = action_input[:tags]
26
27
  @tags_flag = action_input[:tags_flag]
27
28
  @passphrase = action_input['secrets']['key_passphrase']
@@ -147,9 +148,17 @@ module Proxy::Ansible
147
148
  header, *rows = event['stdout'].strip.lines.map(&:rstrip)
148
149
  # #lines strips the leading newline that precedes the header
149
150
  broadcast_data("\n" + header + "\n", 'stdout')
150
- @outputs.keys.select { |key| key.is_a? String }.each do |host|
151
- line = rows.find { |row| row =~ /#{host}/ }
152
- publish_data_for(host, line + "\n", 'stdout')
151
+
152
+ inventory_hosts = @outputs.keys.select { |key| key.is_a? String }
153
+ rows.each do |row|
154
+ host = inventory_hosts.find { |host| row =~ /#{host}/ }
155
+ line = row + "\n"
156
+ unless host
157
+ broadcast_data(line, 'stdout')
158
+ next
159
+ end
160
+
161
+ publish_data_for(host, line, 'stdout')
153
162
 
154
163
  # If the task has been rescued, it won't consider a failure
155
164
  if @exit_statuses[host].to_i != 0 && failures[host].to_i <= 0 && unreachable[host].to_i <= 0 && rescued[host].to_i > 0
@@ -216,7 +225,11 @@ module Proxy::Ansible
216
225
  end
217
226
 
218
227
  def check_cmd
219
- check_mode? ? '"--check"' : ''
228
+ if check_mode? || job_check_mode?
229
+ '"--check"'
230
+ else
231
+ ''
232
+ end
220
233
  end
221
234
 
222
235
  def verbosity
@@ -231,6 +244,10 @@ module Proxy::Ansible
231
244
  @check_mode == true && @rex_command == false
232
245
  end
233
246
 
247
+ def job_check_mode?
248
+ @job_check_mode == true
249
+ end
250
+
234
251
  def prepare_directory_structure
235
252
  inner = %w[inventory project env].map { |part| File.join(@root, part) }
236
253
  ([@root] + inner).each do |path|
@@ -2,6 +2,6 @@ module Proxy
2
2
  # Version, this allows the proxy and other plugins know
3
3
  # what version of the Ansible plugin is running
4
4
  module Ansible
5
- VERSION = '3.5.7'
5
+ VERSION = '3.6.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.7
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-09-25 00:00:00.000000000 Z
12
+ date: 2025-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -25,90 +25,6 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '13.0'
28
- - !ruby/object:Gem::Dependency
29
- name: mocha
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '1'
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: '1'
42
- - !ruby/object:Gem::Dependency
43
- name: webmock
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '3'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '3'
56
- - !ruby/object:Gem::Dependency
57
- name: rack-test
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- - !ruby/object:Gem::Dependency
71
- name: logger
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: smart_proxy
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: net-ssh
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- type: :runtime
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
28
  - !ruby/object:Gem::Dependency
113
29
  name: smart_proxy_dynflow
114
30
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +85,7 @@ files:
169
85
  - settings.d/ansible.yml.example
170
86
  homepage: https://github.com/theforeman/smart_proxy_ansible
171
87
  licenses:
172
- - GPL-3.0
88
+ - GPL-3.0-only
173
89
  metadata: {}
174
90
  post_install_message:
175
91
  rdoc_options: []
@@ -179,14 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
95
  requirements:
180
96
  - - ">="
181
97
  - !ruby/object:Gem::Version
182
- version: '2.5'
98
+ version: '2.7'
183
99
  required_rubygems_version: !ruby/object:Gem::Requirement
184
100
  requirements:
185
101
  - - ">="
186
102
  - !ruby/object:Gem::Version
187
103
  version: '0'
188
104
  requirements: []
189
- rubygems_version: 3.2.3
105
+ rubygems_version: 3.5.23
190
106
  signing_key:
191
107
  specification_version: 4
192
108
  summary: Smart-Proxy Ansible plugin