foreman_acd 0.9.2.3 → 0.9.3

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: 7444a04a97d0c557274185beac9aad2690a7b2387737e48b2932603143fc13bb
4
- data.tar.gz: 3cff7fecc5b68fa7f038bff0482e40a7964fbc02375b6b09961ca9ff5a13a457
3
+ metadata.gz: dbb3f0546eecd696b0236fc7fc5d939e3c9ba4be45de5f63c3c0b510bdd3a43e
4
+ data.tar.gz: 79a44a598a313b6d9d1883104d5a776e1cf20f43548cc75275bdb68ddc8efc26
5
5
  SHA512:
6
- metadata.gz: 0aa2b65dc7476d0c1791eceb1c568e6c140562262a4f6f496279da2d6a0b65ad19be14b7e519ebbaf5be3724d2483e1ce0c357ba20d443aa705101632215d97a
7
- data.tar.gz: a4d80115ee182a4c9b193afcf43e2ea8a16e4dd715f58120df17d8e5c8c87fb0f2a12dd56883d9f42bdce6298dac074b3a0671fdd9a48f5a6d83ddf940cf3e06
6
+ metadata.gz: 8b1915e923d8571aeabe098e4f6b3539038608bc66276a1a65733df7b1548c0822aa11217b1c545e19dac1e88436cc7e213275bdb0bd488721497553361f6833
7
+ data.tar.gz: e0e62775c7fbd2417edd87febdfe13df1457a037b80746e3c019ed7eef67b3c94012b64397317dafc34d56a5258289f2d0088a86338944c90dde2a248f3925be
@@ -10,7 +10,7 @@ module ForemanAcd
10
10
  if result.success == true
11
11
  @composer = job
12
12
  else
13
- redirect_to(app_instances_path, :error => _("Coult not create remote execution job to configure the app '%{app_instance}': %{msg}") % {
13
+ redirect_to(app_instances_path, :error => _("Could not create remote execution job to configure the app '%{app_instance}': %{msg}") % {
14
14
  :app_instance => @app_instance, :msg => result.error
15
15
  })
16
16
  end
@@ -23,7 +23,7 @@ module ForemanAcd
23
23
  result, job = init_configuration
24
24
 
25
25
  unless result.success == true
26
- return redirect_to(app_instances_path, :error => _("Coult not create remote execution job to configure the app '%{app_instance}': %{msg}") % {
26
+ return redirect_to(app_instances_path, :error => _("Could not create remote execution job to configure the app '%{app_instance}': %{msg}") % {
27
27
  :app_instance => @app_instance, :msg => result.error
28
28
  })
29
29
  end
@@ -36,21 +36,20 @@ module ForemanAcd
36
36
  # proxy which is necessary to connect to the proxy
37
37
  proxy_selector = RemoteExecutionProxySelector.new
38
38
  hosts.each do |h|
39
- begin
40
- unless h.host
41
- result.success = false
42
- result.error = 'App Instance is not deployed'
43
- return [result, job]
44
- end
45
- proxy = proxy_selector.determine_proxy(h.host, 'ACD')
46
- result.success = true
47
- rescue NoMethodError => e
39
+ unless h.host
48
40
  result.success = false
49
- result.error = "#{e}, Install/Update smart-proxies for ACD"
41
+ result.error = 'App Instance is not deployed'
50
42
  return [result, job]
51
43
  end
44
+ proxy = proxy_selector.determine_proxy(h.host, 'ACD')
45
+ raise StandardError.new('Proxy without ACD feature') if proxy.nil? || [:not_available, :not_defined].include?(proxy)
52
46
  proxy_hosts[proxy.name] = [] unless proxy_hosts.key?(proxy.name)
53
47
  proxy_hosts[proxy.name] << h
48
+ result.success = true
49
+ rescue StandardError => e
50
+ result.success = false
51
+ result.error = "#{e}, Install/Update smart-proxies for ACD"
52
+ return [result, job]
54
53
  end
55
54
 
56
55
  # TODO: just for testing...
@@ -90,6 +89,7 @@ module ForemanAcd
90
89
  result.success = false
91
90
  result.error = _('Failed to configure hosts: %{err_msg}' % { :err_msg => e.message })
92
91
  logger.error('Failed to configure hosts: %{err_class}: %{err_msg}' % { :err_class => e.class, :err_msg => e.message })
92
+ logger.error(e.backtrace.join("\n"))
93
93
  job = nil
94
94
  end
95
95
  [result, job]
@@ -36,7 +36,7 @@ module ForemanAcd
36
36
 
37
37
  # in case there is no ansible_user defined, set "root" as default.
38
38
  ansible_vars['ansible_user'] = 'root' unless ansible_vars.key?('ansible_user')
39
- ansible_vars['ansible_ssh_private_key_file'] = ansible_or_rex_ssh_private_key(foreman_host.host)
39
+ ansible_vars['ansible_ssh_private_key_file'] = ansible_ssh_private_key(foreman_host.host)
40
40
 
41
41
  children[ansible_group]['hosts'][foreman_host.host.name] = ansible_vars
42
42
  end
@@ -56,13 +56,9 @@ module ForemanAcd
56
56
  resolved_value
57
57
  end
58
58
 
59
- def ansible_or_rex_ssh_private_key(host)
59
+ def ansible_ssh_private_key(host)
60
60
  ansible_private_file = host_setting(host, 'ansible_ssh_private_key_file')
61
- if !ansible_private_file.empty?
62
- ansible_private_file
63
- else
64
- ForemanRemoteExecutionCore.settings[:ssh_identity_key_file]
65
- end
61
+ ansible_private_file unless ansible_private_file.empty?
66
62
  end
67
63
 
68
64
  def host_setting(host, setting)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanAcd
4
- VERSION = '0.9.2.3'
4
+ VERSION = '0.9.3'
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_acd",
3
- "version": "0.9.2.3",
3
+ "version": "0.9.3",
4
4
  "description": "foreman application centric deployment",
5
5
  "main": "index.js",
6
6
  "directories": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_acd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2.3
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-02 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop