Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7671

Resource definition via Resource["string"] { "title": ... } fails in Puppet 4.10.3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: PUP 4.10.3
    • Fix Version/s: PUP 4.10.4, PUP 5.0.0
    • Component/s: None
    • Environment:

      Puppetserver 2.72 on Debian jessie Puppet Agent 4.10.3 on both Master and Node strict=error strict_variables=true

    • Template:
    • Acceptance Criteria:
      Hide

      I would expect it to create the resources as if they were specified with a static resource type, as documented in https://docs.puppet.com/puppet/4.10/lang_resources_advanced.html#using-an-abstract-resource-type. It still worked in 4.10.2 and 4.10.1.

      Show
      I would expect it to create the resources as if they were specified with a static resource type, as documented in https://docs.puppet.com/puppet/4.10/lang_resources_advanced.html#using-an-abstract-resource-type . It still worked in 4.10.2 and 4.10.1.
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-06-28
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Puppet 4.10.3 contained a regression where resources created using the syntax {{Resource[xx::yy]}} would cause an error as Puppet would not find an existing 'xx::yy' user defined resource type. This was caused by fixing another problem with inconsistent use of upper/lower case in references.
      Show
      Puppet 4.10.3 contained a regression where resources created using the syntax {{Resource[xx::yy]}} would cause an error as Puppet would not find an existing 'xx::yy' user defined resource type. This was caused by fixing another problem with inconsistent use of upper/lower case in references.
    • QA Risk Assessment:
      Automate
    • QA Risk Assessment Reason:
      Thomas requested an acceptance test for this

      Description

      We have been using the following snippet to generate a number of resources dynamically in an each loop for a while now without problems. After the upgrade to 4.10.3 this morning (including a restart of the Puppetserver) we get this error on multiple nodes

      Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'Saltnetwork::Iptables::Service_chain::Icmp' at <location of Resource in snippet below>
      

      The files are still in the

        each([ "icmp"
             , "ssh"
             , "http"
             , "http81"
             , "https"
             , "dhcp_client"
             , "smtp"       
             , "nrpe"
             ]) |$service_chain| {
          $service_chain_dashes = regsubst($service_chain, '_', '-', 'G')
          Resource["saltnetwork::iptables::service_chain::${service_chain}"] { "allow_${service_chain}":
            rule_set_name => 'common'
          , rule_target  => { table => 'filter', chain => "allow-${service_chain_dashes}", target => 'ACCEPT' }
          }                          
        } 
      
      

      For reference, the definition of the resource is in one of our module paths in saltnetwork/manifests/iptables/service_chain/icmp.pp

      define saltnetwork::iptables::service_chain::icmp(
          SaltNetwork::IPTables::Rule_Set_Name $rule_set_name
        , SaltNetwork::IPTables::Rule_Target_Both $rule_target
        , Boolean $return = true
        ) {
       
        $chain_name = $rule_target['chain']
       
        $table = saltnetwork::iptables::table_for_target($rule_target)
       
        saltnetwork::iptables::custom_chain_both { "${rule_set_name}_${table}_${chain_name}":
            rule_set_name => $rule_set_name
          , table      => $table
          , chain_name => $chain_name
          , return     => $return
        }
       
        saltnetwork::iptables::rule_both { "${rule_set_name}_${table}_${chain_name}_icmp":
            rule_set_name => $rule_set_name
          , rule_order => 10
          , rule_matches => [ { match => 'iana_protocol', protocol => 'icmp' } ]
          , rule_target => $rule_target
          , rule_comment => "ICMP"
        }
       
      }
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              mhoermann Matthias Hörmann
              QA Contact:
              Eric Delaney
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support