title: puppet apply error: Could not find default node or by name with 'uys0115' on node uys0115
body: <p>I have installed puppet on two nodes, and the server node hostname is "uys0115", and the cient node hostname is "uys0119", and the server node have siged the client node. When I exec the commad: <code>puppet cert list --all</code>, we can see:</p>
  
  <pre><code>+ "uys0115" (24:55:95:77:8E:60:33:77:C8:D4:74:EA:01:21:BD:5A)
  + "uys0119" (86:53:1B:81:E5:4F:88:23:E8:34:E1:AB:03:D4:AE:7C)
  </code></pre>
  
  <p>The puppet main directory is /etc/puppet/, I have write an example and the organization of files as follows:</p>
  
  <pre><code>/etc/puppet/--
               |-/manifests/site.pp
               |-/modules/test/--  
                                |-/files/text.txt
                                |-/manifests/init.pp
                                |-/manifests/test.pp
  </code></pre>
  
  <p>The code in <code>/etc/puppet/modules/test/manifests/test.pp</code> is:</p>
  
  <pre><code>class test1 {
  package { "bison":
          ensure=&gt;"installed",
  }
  exec { "puppet test":
          command=&gt;"/bin/touch /tmp/puppet-test",
  }
  file { "/tmp/test.txt":
          ensure =&gt; "present",
          source =&gt; "puppet:///modules/test/test.txt"
  }
  }
  </code></pre>
  
  <p>and the code in <code>/etc/puppet/modules/test/manifests/init.pp</code> is just <code>import "*"</code>;
  and the code in <code>/etc/puppet/manifests/site.pp</code> as follows:</p>
  
  <pre><code>import "test"
  node default {
          include "test1"
  }
  </code></pre>
  
  <p>When I in the client node uys0119 and exec the command <code>puppet agent --test --server uys0115</code>.
  It executed successfully and created two files puppet-test and test.txt in the directory /tmp/.
  In the server node when I exec the command <code>puppet apply site.pp</code>, it also executed successfully and created two files. However, the terminal out put two warning messages:</p>
  
  <pre><code>warning: Could not retrieve fact fqdn
  warning: Host is missing hostname and/or domain: uys0115
  </code></pre>
  
  <p>When I changed the code in <code>/etc/puppet/manifests/site.pp</code> as follows:</p>
  
  <pre><code>import "test"
  node "uys0119" {
          include "test1"
  }
  </code></pre>
  
  <p>and exec the command <code>puppet apply site.pp</code> in the server node, it failed an output the error messages:</p>
  
  <pre><code>warning: Could not retrieve fact fqdn
  warning: Host is missing hostname and/or domain: uys0115
  warning: Host is missing hostname and/or domain: uys0115
  Could not find default node or by name with 'uys0115' on node uys0115
  </code></pre>
  
  <p>But the client node can sucessfully exec the command <code>puppet agent --test --server uys0115</code> too. Can anybody explain that?
  If I want to the server node send some repuests to the client nodes and drive some client  nodes responses the server and procduces results. How can I do when uses puppet? Can somebody give me an example? thanks very much!!!  </p>