-
-
Save djhaskin987/6302209 to your computer and use it in GitHub Desktop.
A suggested layout for an RPM or a DEB package which installs a masterless puppet module named 'foo'.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if ! which fpm | |
then | |
# I hope you have ruby gems installed | |
gem install fpm | |
fi | |
mkdir pkg | |
mkdir -p pkg/usr/share/puppet/masterless | |
mv foo.pp pkg/usr/share/puppet/masterless | |
mkdir -p pkg/usr/share/puppet/modules/foo/manifests | |
mv init.pp pkg/usr/share/puppet/foo/manifests | |
mkdir -p pkg/usr/share/puppet/modules/foo/files | |
mv hello pkg/usr/share/puppet/modules/foo/files | |
cd pkg | |
tar czf foo.tar.gz $(ls -A) | |
# If you're on an enterprise linux machine: | |
fpm -s tar -t rpm -n puppet-masterless-foo -v 0.1 --iteration 1 -d puppet foo.tar.gz | |
# Or, if you're on a debian based machine: | |
fpm -s tar -t deb -n puppet-masterless-foo -v 0.1 --iteration 1 -d puppet foo.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class foo { | |
file { | |
"/tmp/hello": | |
ensure => file, | |
source => "puppet:///modules/foo/hello"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/share/puppet/modules/foo | |
/usr/share/puppet/modules/foo/manifests | |
/usr/share/puppet/modules/foo/manifests/init.pp | |
/usr/share/puppet/modules/foo/files | |
/usr/share/puppet/modules/foo/files/hello | |
/usr/share/puppet/masterless/foo.pp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /usr/share/puppet/modules is usually the default puppet module directory, | |
# so the '--modulepath' argument previously written here is omitted below | |
$ puppet apply /usr/share/puppet/masterless/foo.pp | |
notice: /Stage[main]/Foo/File[/tmp/hello]/ensure: defined content as '{md5}f0ef7081e1539ac00ef5b761b4fb01b3' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What do you think, @jordansissel ?