foreman_acd 0.9.2.3 → 0.9.3
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:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: dbb3f0546eecd696b0236fc7fc5d939e3c9ba4be45de5f63c3c0b510bdd3a43e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 79a44a598a313b6d9d1883104d5a776e1cf20f43548cc75275bdb68ddc8efc26
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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 => _(" 
     | 
| 
      
 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 => _(" 
     | 
| 
      
 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 
     | 
    
         
            -
                       
     | 
| 
       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 =  
     | 
| 
      
 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'] =  
     | 
| 
      
 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  
     | 
| 
      
 59 
     | 
    
         
            +
                def ansible_ssh_private_key(host)
         
     | 
| 
       60 
60 
     | 
    
         
             
                  ansible_private_file = host_setting(host, 'ansible_ssh_private_key_file')
         
     | 
| 
       61 
     | 
    
         
            -
                   
     | 
| 
       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)
         
     | 
    
        data/lib/foreman_acd/version.rb
    CHANGED
    
    
    
        data/package.json
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-07-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rubocop
         
     |