foreman_ansible_core 2.0.1 → 2.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12eefd8c004fc5fab3ba89e55d6f55a012fd5a8d
|
4
|
+
data.tar.gz: 0f6c6dc40d70761dd0ae7febfbc7e30b19115d07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283cbd551dba171fccfb7d3dd992a4e4f6c86dbd18f3cd2b1078eba877562c2af3d16457d33808cc4f90a8d4a5ffd95fd47edbff2ac09f3a6c2432e273d8d3f0
|
7
|
+
data.tar.gz: d04b049df94c5e507446998d6bb68c6667b3711574276e4544a3dbb27478d0ba1ee4f060f77d317cd61e4e852db96d68d1f716455aeea18a8112bb43eae59a23
|
data/lib/foreman_ansible_core.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'foreman_tasks_core'
|
2
|
+
require 'foreman_remote_execution_core'
|
2
3
|
|
3
4
|
# Core actions for Foreman Ansible, used by both Foreman and Foreman proxy
|
4
5
|
# This comprises running playbooks for the moment
|
@@ -14,15 +15,13 @@ module ForemanAnsibleCore
|
|
14
15
|
require 'foreman_ansible_core/actions'
|
15
16
|
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
)
|
25
|
-
end
|
18
|
+
require 'foreman_remote_execution_core/actions'
|
19
|
+
require 'foreman_ansible_core/remote_execution_core/ansible_runner'
|
20
|
+
require 'foreman_ansible_core/remote_execution_core/settings_override'
|
21
|
+
ForemanRemoteExecutionCore::Actions::RunScript.send(
|
22
|
+
:prepend,
|
23
|
+
ForemanAnsibleCore::RemoteExecutionCore::SettingsOverride
|
24
|
+
)
|
26
25
|
|
27
26
|
require 'foreman_ansible_core/roles_reader'
|
28
27
|
require 'foreman_ansible_core/version'
|
@@ -1,43 +1,41 @@
|
|
1
|
-
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
DEFAULT_REFRESH_INTERVAL = 1
|
1
|
+
module ForemanAnsibleCore
|
2
|
+
module RemoteExecutionCore
|
3
|
+
# Takes an inventory and runs it through REXCore CommandRunner
|
4
|
+
class AnsibleRunner < ::ForemanTasksCore::Runner::CommandRunner
|
5
|
+
DEFAULT_REFRESH_INTERVAL = 1
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
def initialize(options)
|
8
|
+
super(options)
|
9
|
+
@playbook_runner = ForemanAnsibleCore::PlaybookRunner.new(
|
10
|
+
options['ansible_inventory'],
|
11
|
+
options['script'],
|
12
|
+
options
|
13
|
+
)
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
def start
|
17
|
+
@playbook_runner.start
|
18
|
+
rescue StandardError => e
|
19
|
+
logger.error(
|
20
|
+
'error while initalizing command'\
|
21
|
+
" #{e.class} #{e.message}:\n #{e.backtrace.join("\n")}"
|
22
|
+
)
|
23
|
+
publish_exception('Error initializing command', e)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
rescue StandardError => e
|
32
|
-
continuous_output.add_exception(_('Error loading data from proxy'), e)
|
26
|
+
def fill_continuous_output(continuous_output)
|
27
|
+
delegated_output.fetch('result', []).each do |raw_output|
|
28
|
+
continuous_output.add_raw_output(raw_output)
|
33
29
|
end
|
30
|
+
rescue StandardError => e
|
31
|
+
continuous_output.add_exception(_('Error loading data from proxy'), e)
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
34
|
+
def refresh
|
35
|
+
@command_out = @playbook_runner.command_out
|
36
|
+
@command_in = @playbook_runner.command_in
|
37
|
+
@command_pid = @playbook_runner.command_pid
|
38
|
+
super
|
41
39
|
end
|
42
40
|
end
|
43
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_ansible_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Lobato Garcia
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.6.
|
95
|
+
rubygems_version: 2.6.14
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: 'Ansible integration with Foreman (theforeman.org): core bits'
|