Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Aug 16, 2016

Thanks! That helps a lot!

@rileytg

This comment has been minimized.

Copy link

commented Sep 20, 2016

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

@rileytg

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented May 3, 2017

@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
You can’t perform that action at this time.