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

create_resources does not honor '@@resource' as exported resource

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.6.0
    • Fix Version/s: PUP 4.10.2
    • Component/s: Compiler, Functions
    • Environment:

      CentOS 7
      OSS Puppet Server 2.5.0 with Puppet Agent 1.6.1

    • Template:
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-06-14
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The {{create_resources}} function did not understand that a leading {{@@}} in the resource name should be taken as "exported".
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      Covered by spec test

      Description

      I have an in house nagios module (that will eventually be on the forge) that has a file export defined in it. Every time that export is hit the exporting client side throws an error because it's trying to write the file locally when it shouldn't be. This only happens when Puppet Agent 1.6.1 is installed on the puppet server (I back reved the server to 2.4.0 and installed latest 1.6.1 agent and ran into it as well so it's likely in the agent, but as it requires exported resources working I can't give a test with just the agent)

      Example error:

      Error: Puppet::Util::FileType::FileTypeFlat could not write /etc/nagios/conf.d/host_ldap.home.bardicgrove.org_ldap.home.bardicgrove.org.cfg: No such file or directory @ rb_sysopen - /etc/nagios/conf.d/host_ldap.home.bardicgrove.org_ldap.home.bardicgrove.org.cfg
      Error: /Stage[main]/Nagios::Client/Nagios::Resource[ldap.home.bardicgrove.org]/Nagios::Resource::Host[ldap.home.bardicgrove.org]/Nagios_host[ldap.home.bardicgrove.org]: Could not evaluate: Puppet::Util::FileType::FileTypeFlat could not write /etc/nagios/conf.d/host_ldap.home.bardicgrove.org_ldap.home.bardicgrove.org.cfg: No such file or directory @ rb_sysopen - /etc/nagios/conf.d/host_ldap.home.bardicgrove.org_ldap.home.bardicgrove.org.cfg
      

      The code that is getting called is listed in [0] which gets called by [1] on all systems.

      [0] https://github.com/tykeal/puppet-nagios/blob/master/manifests/resource.pp#L87-L91
      [1] https://github.com/tykeal/puppetserver-mod-profile/blob/master/manifests/nagios/client.pp

      Full lab / environment configuration can be found by a combination of the following 4 repositories:

      https://github.com/tykeal/puppetserver-main
      https://github.com/tykeal/puppetserver-hiera
      https://github.com/tykeal/puppetserver-mod-profile
      https://github.com/tykeal/puppetserver-mod-role

      UPDATE


      The problem here came from use of create_resources with resource type preceded by @@ to indicate that the resource is exported.
      There may also be a problem with virtual resources.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              tykeal Andrew Grimberg
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support