Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created October 15, 2010 19:56
Show Gist options
  • Save jordansissel/628837 to your computer and use it in GitHub Desktop.
Save jordansissel/628837 to your computer and use it in GitHub Desktop.
Simplest example of a masterless puppet invocation using module paths
.
./modules
./modules/foo
./modules/foo/files
./modules/foo/files/hello
./modules/foo/manifests
./modules/foo/manifests/init.pp
./manifests
./manifests/site.pp
Hello world
class foo {
file {
"/tmp/hello":
ensure => file,
source => "puppet:///modules/foo/hello";
}
}
snack(/tmp/z) % puppet apply --modulepath modules manifests/site.pp
notice: /Stage[main]/Foo/File[/tmp/hello]/ensure: defined content as '{md5}f0ef7081e1539ac00ef5b761b4fb01b3'
include foo
@wangyuesong
Copy link

Thanks! That helps a lot!

@rileytg
Copy link

rileytg commented Sep 20, 2016

so helpful... after years of kinda ignoring puppet, starting with this made it all click.

@rileytg
Copy link

rileytg commented Sep 20, 2016

👍 on the file list, tripped up on that part with puppet for ages. where on their docs is this list??

@g19fanatic
Copy link

@rileytg
The information is buried in the docs with a combination of https://docs.puppet.com/puppet/4.10/modules_fundamentals.html#example, https://docs.puppet.com/puppet/4.10/dirs_manifest.html and https://docs.puppet.com/puppet/4.10/dirs_modulepath.html.

A simple gathering of things isn't really present in the docs and is a good reason why the above gist is awesome for starting out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment