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

cannot export file from puppet client via puppetdb to another puppet client



    • Bug
    • Status: Closed
    • Normal
    • Resolution: Won't Fix
    • None
    • None
    • Catalog Application
    • fedora 20, puppet-3.7.2-1.fc20.noarch, puppetdb-terminux-2.2.2-1.fc20.noarch, puppetdb-2.2.2-1.fc20.noarch, puppet-server-3.7.2-1.fc20.noarch

    • Normal


      I have two hosts, 'puppet' which is also known as 'host1' and another node which resolves to 'host2'.
      Both hosts are run puppet apply via the command line with great success against apache2/rails/puppetmaster.

      The following node definition works very well. the manifest is on disk on puppet/node1. When run via puppet agent on node2, the manifest copies/syncs the content of node2:/tmp/text into node2:/tmp/text2.

      node 'node2'{
                      source => "/tmp/text",

      Extending this idea with puppetdb over both nodes;

      node 'node1'{
              File <<| tag == "thisisatag2" |>>
      node 'node2'{
                      owner => "root",
                      group => "root",
                      source => "/tmp/text",
                      tag => "thisisatag2",

      From my reading and use of puppetdb/exported resources I expect that that the file node1:/tmp/text3 will have the same source file/content/bytes as the first example, that is the content of node2:/tmp/text. In other words, the File resource is treated as an exported resource and stored in puppetdb rather than written directly to disk.
      Once puppet agent is run on node2, then puppet agent is run on node1, the node1:/tmp/text3 should be written to disk with the same content as node2:/tmp/text.

      In this scenario, I receive the trace/barf from a puppet agent run on node1 [1]. I expect that this does not work because puppet master (running on node1) compiles the manifest for a file and there is an implicit scope issue maybe (I've been wrong before). indeed in all the code I've seen in this use case the normal path is to use template(), puppet:///modules/${module_name}/filename, content => "abs string"' or something equally easy for puppet master to address locally.


      Error: /Stage[main]/Main/Node[node1]/File[/tmp/text3]: Could not evaluate: Could not retrieve information from environment production source(s) file:/tmp/text
      /usr/share/ruby/vendor_ruby/puppet/util/errors.rb:104:in `fail'
      /usr/share/ruby/vendor_ruby/puppet/type/file/source.rb:187:in `metadata'
      /usr/share/ruby/vendor_ruby/puppet/type/file/source.rb:111:in `copy_source_values'
      /usr/share/ruby/vendor_ruby/puppet/type/file.rb:711:in `retrieve'
      /usr/share/ruby/vendor_ruby/puppet/type.rb:1076:in `retrieve_resource'
      /usr/share/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `from_resource'
      /usr/share/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:19:in `evaluate'
      /usr/share/ruby/vendor_ruby/puppet/transaction.rb:204:in `apply'
      /usr/share/ruby/vendor_ruby/puppet/transaction.rb:217:in `eval_resource'
      /usr/share/ruby/vendor_ruby/puppet/transaction.rb:147:in `call'
      /usr/share/ruby/vendor_ruby/puppet/transaction.rb:147:in `block (2 levels) in evaluate'
      /usr/share/ruby/vendor_ruby/puppet/util.rb:327:in `block in thinmark'
      /usr/share/ruby/benchmark.rb:296:in `realtime'
      /usr/share/ruby/vendor_ruby/puppet/util.rb:326:in `thinmark'
      /usr/share/ruby/vendor_ruby/puppet/transaction.rb:147:in `block in evaluate'
      /usr/share/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
      /usr/share/ruby/vendor_ruby/puppet/transaction.rb:138:in `evaluate'
      /usr/share/ruby/vendor_ruby/puppet/resource/catalog.rb:169:in `block in apply'
      /usr/share/ruby/vendor_ruby/puppet/util/log.rb:149:in `with_destination'
      /usr/share/ruby/vendor_ruby/puppet/transaction/report.rb:112:in `as_logging_destination'
      /usr/share/ruby/vendor_ruby/puppet/resource/catalog.rb:168:in `apply'
      /usr/share/ruby/vendor_ruby/puppet/configurer.rb:118:in `block in apply_catalog'
      /usr/share/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
      /usr/share/ruby/benchmark.rb:296:in `realtime'




            Unassigned Unassigned
            rmat Rob Mattson
            Eric Thompson Eric Thompson
            0 Vote for this issue
            4 Start watching this issue



              Zendesk Support