Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-11632

[RFE] Kafo installer to ignore disabled modules

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • 6.10.0
    • Installation
    • None
    • None
    • None
    • None

      Description of problem:
      Please trivially enhance the module loading logic in kafo.

      We have hit the below situation many times: some customer disabled some puppet installer module (i.e. docker) by setting:

      foreman_proxy::plugin::docker: false

      to satellite-answers.yaml, but later on, installer fails with "No Puppet module parser is installed" error.

      We noticed it for various plugins both on Sat and Caps and it usually takes some time to identify the source of the problem.

      What is sufficient to change:

      /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:133 :

      def modules
      @modules ||= begin
      register_data_types
      @data.keys.map

      { |mod| PuppetModule.new(mod, configuration: self).parse }

      .sort
      end
      end

      Here, the map is created even for modules having enabled: false, so they are mapped and attempted to parse. But some logix else-where does not load a parser for that module, due to the enabled: false.

      I think it should be enough to filter the map but I failed to write proper ruby code for it.

      Version-Release number of selected component (if applicable):
      Any Sat or Caps version

      How reproducible:
      100%

      Steps to Reproduce:
      1. "disable" an artificial plugin:
      echo "foreman_proxy::plugin::blah: false" >> /etc/foreman-installer/scenarios.d/satellite-answers.yaml

      2. Run installer:
      satellite-installer

      Actual results:
      2. fails with:
      Traceback (most recent call last):
      19: from /usr/sbin/satellite-installer:8:in `<main>'
      18: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:50:in `run'
      17: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
      16: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `new'
      15: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:140:in `initialize'
      14: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hooking.rb:65:in `execute'
      13: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hooking.rb:65:in `each'
      12: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hooking.rb:67:in `block in execute'
      11: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hook_context.rb:19:in `execute'
      10: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hook_context.rb:19:in `instance_eval'
      9: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hooking.rb:36:in `block (4 levels) in load'
      8: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hooking.rb:36:in `instance_eval'
      7: from /usr/share/foreman-installer/hooks/boot/20-certs_update.rb:2:in `block (4 levels) in load'
      6: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/hook_context.rb:113:in `module_present?'
      5: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:257:in `module'
      4: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:253:in `modules'
      3: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:133:in `modules'
      2: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:133:in `map'
      1: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:133:in `block in modules'
      /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/puppet_module.rb:70:in `parse': No Puppet module parser is installed and no cache of the file /usr/share/foreman-installer/modules/foreman_proxy/manifests/plugin/blah.pp is available. Please check debug logs and install optional dependencies for the parser. (Kafo::ParserError)

      Expected results:
      No such backtrace, blah module is ignored.

      Additional info:
      The error appears even if there is a blah.pp file with a proper content.

              jira-bugzilla-migration RH Bugzilla Integration
              jira-bugzilla-migration RH Bugzilla Integration
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: