Cannot create simple file with puppet locally or at client node

25 Views Asked by At

I have Puppet v8.5.1 running on Ubuntu 22.04. I have a puppetmaster and puppet agent node communicating with each other. Now I created a simple "helloworld" under the production modules path (/etc/puppetlabs/code/environments/production/modules/helloworld/) and a manifests directory as well. Inside said manifests directory, I have this simple init.pp file:

class helloworld {
  file { '/tmp/foobar.txt':
    ensure  => file,
    mode    => '0644',
    content => 'Hello World \n';
  }
}

Now when I attempt to run the following "puppet apply" command from the puppetmaster, it shows only the following and there is no file being created in the /tmp folder:

root@sandbox-puppetmaster:~# puppet apply /etc/puppetlabs/code/environments/production/modules/helloworld/manifests/init.pp
Notice: Compiled catalog for sandbox-puppetmaster.ddc.local in environment production in 0.02 seconds
Notice: Applied catalog in 0.01 seconds

Over on the puppet node, I ran the command:

root@sandbox-node1:/tmp# puppet agent --test
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Notice: Requesting catalog from sandbox-puppetmaster.ddc.local:8140 (10.20.27.7)
Notice: Catalog compiled by sandbox-puppetmaster.ddc.local
Info: Caching catalog for sandbox-node1
Info: Applying configuration version '1709918930'
Notice: Applied catalog in 0.01 seconds

And no file shows up in /tmp either.

What is it I am doing wrong?

It should be putting a simple file called "foobar.txt" in the /tmp directory.

0

There are 0 best solutions below