foreman_ansible_core 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/foreman_ansible_core/command_creator.rb +26 -11
- data/lib/foreman_ansible_core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c69f61506d641e18d27a22a32514cdb6221174dd
|
4
|
+
data.tar.gz: 9afe8696e6723ad9ab66adf416b457e8fa9dfec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c40433c92f4c4f3d617562cad983a0b116b8240830bb14d6d641aa17187845dc1649a3e4da75f81af6485b66efffc69f8fc2a431212e938989c10fa54604ef3b
|
7
|
+
data.tar.gz: 7080dd69b55873db5305ba237dc7d5e7331cecd1e23c2969125eaf553e115573663205bf0fa46b5331686661330150c44a7dec6fc5278b5f9070498f87e83c5e
|
@@ -1,23 +1,34 @@
|
|
1
1
|
module ForemanAnsibleCore
|
2
2
|
# Creates the actual command to be passed to foreman_tasks_core to run
|
3
3
|
class CommandCreator
|
4
|
-
attr_reader :command
|
5
|
-
|
6
4
|
def initialize(inventory_file, playbook_file, options = {})
|
7
5
|
@options = options
|
8
|
-
@
|
9
|
-
@
|
10
|
-
|
11
|
-
|
6
|
+
@playbook_file = playbook_file
|
7
|
+
@inventory_file = inventory_file
|
8
|
+
command
|
9
|
+
end
|
10
|
+
|
11
|
+
def command
|
12
|
+
parts = [environment_variables]
|
13
|
+
parts << 'ansible-playbook'
|
14
|
+
parts.concat(command_options)
|
15
|
+
parts << @playbook_file
|
16
|
+
parts
|
12
17
|
end
|
13
18
|
|
14
19
|
private
|
15
20
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
def environment_variables
|
22
|
+
defaults = { 'JSON_INVENTORY_FILE' => @inventory_file }
|
23
|
+
defaults['ANSIBLE_CALLBACK_WHITELIST'] = '' if rex_command?
|
24
|
+
defaults
|
25
|
+
end
|
26
|
+
|
27
|
+
def command_options
|
28
|
+
opts = ['-i', json_inventory_script]
|
29
|
+
opts.concat([setup_verbosity]) if verbose?
|
30
|
+
opts.concat(['-T', @options[:timeout]]) unless @options[:timeout].nil?
|
31
|
+
opts
|
21
32
|
end
|
22
33
|
|
23
34
|
def json_inventory_script
|
@@ -40,5 +51,9 @@ module ForemanAnsibleCore
|
|
40
51
|
verbosity_level.to_i > 0
|
41
52
|
# rubocop:enable Rails/Present
|
42
53
|
end
|
54
|
+
|
55
|
+
def rex_command?
|
56
|
+
@options[:remote_execution_command]
|
57
|
+
end
|
43
58
|
end
|
44
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_ansible_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Lobato Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.6.8
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: 'Ansible integration with Foreman (theforeman.org): core bits'
|