title: How do I apply only one file or two classes from a Puppet Master server?
body: <p>Let us say that I have a case in which I need to apply only two files from a Puppet configuration on some production servers, without touching the rest of the configuration. </p>
  
  <p>/opt/aservice/myfile/thekey.conf
  /opt/myfile/thekey.salt</p>
  
  <p>Let's also say that these are controlled by the following Puppet manifest: </p>
  
  <pre><code>#
  # author: Nathan Basanese (nathan@basanese.com)
  # date: 04/17/2048
  #
  
  class keyconfig ( $cluster ){
      notify {"Deploying key config. files to $fqdn":}
  
  
      file {'/opt/aservice/key/config/thekey.conf':
                  ensure =&gt; present,
                  mode =&gt; '0644',
                  owner =&gt; 'aservice-serv',
                  group =&gt; 'aservice-serv',
                  source =&gt; "puppet:///modules/keyconfig/$cluster/thekey.conf",
          }
      file {'/opt/aservice/key/config/thekey.salt':
                  ensure =&gt; present,
                  mode =&gt; '0644',
                  owner =&gt; 'aservice-serv',
                  group =&gt; 'aservice-serv',
                  source =&gt; "puppet:///modules/keyconfig/$cluster/thekey.salt",
          }
  }
  </code></pre>
  
  <p>How would I apply ONLY these two files to a given server from a Puppet Master? </p>
  
  <p>Perhaps, in the <code>puppet agent</code> command that is run on the target server, could I specify a specific Puppet class to use? </p>
  
  <p>I have used the <a href="https://docs.puppetlabs.com/references/4.3.0/man/resource.html" rel="nofollow"><code>puppet resource</code></a> command before, but I'm not sure that would work, here. </p>