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

Hiera Data in Module give bad results when environment_timeout is unlimited

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.4.2, PUP 4.5.0
    • Fix Version/s: PUP 4.5.1
    • Component/s: Puppet Server
    • Labels:
      None
    • Environment:

      Puppet Server is running on RHEL 7.2
      Puppet Clients are RHEL 6.8 and 7.2

      puppet-agent-1.5.0-1.el7.x86_64
      puppetdb-termini-4.1.0-1.el7.noarch
      puppetserver-2.4.0-1.el7.noarch

    • Template:
    • Acceptance Criteria:
      Hide

      Data in Modules data in a module that depends on facts or other node/compilation specific data should get the expected data when environment timeout > 0.

      Show
      Data in Modules data in a module that depends on facts or other node/compilation specific data should get the expected data when environment timeout > 0.
    • Story Points:
      1
    • Sprint:
      Language 2016-06-01
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      If data in a module using "data in modules" depended on node/fact/compilation specific input it would not get the correct data if environment timeout > 0. It would instead produce the value for the node for which a catalog was compiled in that environment's life cycle. Modules having only static data were not affected by this problem.
      Show
      If data in a module using "data in modules" depended on node/fact/compilation specific input it would not get the correct data if environment timeout > 0. It would instead produce the value for the node for which a catalog was compiled in that environment's life cycle. Modules having only static data were not affected by this problem.

      Description

      1) Set environment_timeout to unlimited (this does not occur if set to 0)
      2) Setup hiera data in a module that use a FACT to determine what it should do.
      3) Set the fact differently on two or more clients
      4) Run puppet from each of the clients at the same time

      After a few puppet runs they will stop getting the correct hiera data in module values from the PuppetServer.

      eg. server1 could see the server2 value or server2 could see the server1 value.

      SAMPLE module:

      ./test_module
      ./test_module/hieradata
      ./test_module/hieradata/common.yaml
      ./test_module/hieradata/server1.yaml
      ./test_module/hieradata/server2.yaml
      ./test_module/manifests
      ./test_module/manifests/init.pp
      ./test_module/metadata.json
      ./test_module/hiera.yaml
      

      init.pp

      class test_module (
        $my_var = 'not from hiera',
      ){
        notify{"The variable is $my_var":}
      }
      

      hiera.yaml

      ---
      version: 4
      datadir: hieradata
      hierarchy:
        - name: "%{my_fact}"
          backend: yaml
       
        - name: "common"
          backend: yaml
      

      ./test_module/hieradata/common.yaml

      ---
      test_module::my_var: 'In common.yaml'
      

      ./test_module/hieradata/server1.yaml

      ---
      test_module::my_var: 'server1'
      

      ./test_module/hieradata/server2.yaml

      ---
      test_module::my_var: 'server2'
      

      SERVER1
      /etc/puppetlabs/facter/facts.d/my_fact.txt
      my_fact=server1

      SERVER2
      /etc/puppetlabs/facter/facts.d/my_fact.txt
      my_fact=server2

      Error seen in Puppetserver logs

      [puppetserver] Puppet Caching node for server1.mydomain
      [puppetserver] Puppet Class 'settings' is already defined; cannot redefine at :
      [puppetserver] Puppet Compiled catalog for server1.mydomain in environment production in 0.04 seconds
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  csschwe Chuck Schweizer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: