puppet 0.24.4 → 0.24.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +170 -0
- data/Rakefile +6 -4
- data/bin/filebucket +3 -2
- data/bin/puppet +7 -4
- data/bin/puppetca +32 -14
- data/bin/puppetd +12 -34
- data/bin/puppetmasterd +3 -2
- data/bin/puppetrun +5 -43
- data/bin/ralsh +2 -2
- data/conf/debian/README.source +2 -0
- data/conf/debian/TODO.Debian +1 -0
- data/conf/debian/changelog +257 -0
- data/conf/debian/compat +1 -0
- data/conf/debian/control +45 -0
- data/conf/debian/copyright +17 -0
- data/conf/debian/docs +1 -0
- data/conf/debian/fileserver.conf +12 -0
- data/conf/debian/puppet.NEWS +63 -0
- data/conf/debian/puppet.conf +8 -0
- data/conf/debian/puppet.dirs +7 -0
- data/conf/debian/puppet.files +6 -0
- data/conf/debian/puppet.init +64 -0
- data/conf/debian/puppet.logrotate +11 -0
- data/conf/debian/puppet.postinst +9 -0
- data/conf/debian/puppet.postrm +21 -0
- data/conf/debian/puppet.preinst +25 -0
- data/conf/debian/puppetmaster.files +4 -0
- data/conf/debian/puppetmaster.init +58 -0
- data/conf/debian/rules +115 -0
- data/conf/debian/watch +2 -0
- data/conf/gentoo/init.d/puppet +1 -1
- data/conf/gentoo/init.d/puppetmaster +32 -31
- data/conf/redhat/client.init +10 -2
- data/conf/redhat/puppet.spec +4 -1
- data/conf/redhat/server.init +9 -1
- data/examples/{code/allatonce → allatonce} +0 -0
- data/examples/{code/assignments → assignments} +0 -0
- data/examples/{code/components → components} +0 -0
- data/examples/{root/etc → etc}/init.d/sleeper +0 -0
- data/examples/{root/etc → etc}/otherfile +0 -0
- data/examples/{root/etc → etc}/puppet/fileserver.conf +0 -0
- data/examples/{root/etc → etc}/puppet/namespaceauth.conf +0 -0
- data/examples/{root/etc → etc}/puppet/puppet.conf +0 -0
- data/examples/{root/etc → etc}/puppet/tagmail.conf +0 -0
- data/examples/{code/execs → execs} +0 -0
- data/examples/{code/file.bl → file.bl} +0 -0
- data/examples/{code/filedefaults → filedefaults} +0 -0
- data/examples/{code/fileparsing → fileparsing} +0 -0
- data/examples/{code/filerecursion → filerecursion} +0 -0
- data/examples/{code/functions → functions} +0 -0
- data/examples/{code/groups → groups} +0 -0
- data/examples/{code/head → head} +0 -0
- data/examples/{code/importing → importing} +0 -0
- data/examples/{code/mac_automount.pp → mac_automount.pp} +0 -0
- data/examples/{code/mac_dscl.pp → mac_dscl.pp} +0 -0
- data/examples/{code/mac_dscl_revert.pp → mac_dscl_revert.pp} +0 -0
- data/examples/{code/mac_netinfo.pp → mac_netinfo.pp} +0 -0
- data/examples/{code/mac_pkgdmg.pp → mac_pkgdmg.pp} +0 -0
- data/examples/{code/modules → modules}/sample-module.pp +0 -0
- data/examples/{code/modules → modules}/sample-module/README.txt +0 -0
- data/examples/{code/modules → modules}/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
- data/examples/{code/modules → modules}/sample-module/manifests/init.pp +0 -0
- data/examples/{code/modules → modules}/sample-module/templates/sample.erb +0 -0
- data/examples/{code/nodes → nodes} +0 -0
- data/examples/{code/one → one} +0 -0
- data/examples/{code/relationships → relationships} +0 -0
- data/examples/{code/selectors → selectors} +0 -0
- data/examples/{code/simpletests → simpletests} +0 -0
- data/examples/{code/svncommit → svncommit} +0 -0
- data/ext/autotest/Rakefile +8 -0
- data/ext/autotest/config +43 -0
- data/ext/autotest/readme.rst +16 -0
- data/{examples/root → ext}/bin/sleeper +1 -1
- data/ext/emacs/puppet-mode.el +246 -184
- data/ext/ldap/puppet.schema +7 -2
- data/ext/module_puppet +4 -3
- data/ext/nagios/check_puppet.rb +117 -0
- data/ext/puppetlast +40 -0
- data/install.rb +12 -3
- data/lib/puppet.rb +1 -44
- data/lib/puppet/defaults.rb +23 -10
- data/lib/puppet/dsl.rb +2 -2
- data/lib/puppet/executables/client/certhandler.rb +77 -0
- data/lib/puppet/external/nagios.rb +1 -1
- data/lib/puppet/external/nagios/base.rb +60 -46
- data/lib/puppet/file_serving/indirection_hooks.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +0 -9
- data/lib/puppet/file_serving/terminus_helper.rb +4 -4
- data/lib/puppet/indirector.rb +26 -28
- data/lib/puppet/indirector/catalog/compiler.rb +6 -28
- data/lib/puppet/indirector/checksum/file.rb +2 -2
- data/lib/puppet/indirector/direct_file_server.rb +7 -7
- data/lib/puppet/indirector/envelope.rb +13 -0
- data/lib/puppet/indirector/exec.rb +2 -2
- data/lib/puppet/indirector/facts/facter.rb +2 -2
- data/lib/puppet/indirector/file.rb +17 -14
- data/lib/puppet/indirector/file_metadata/file.rb +2 -2
- data/lib/puppet/indirector/file_server.rb +14 -14
- data/lib/puppet/indirector/indirection.rb +113 -48
- data/lib/puppet/indirector/ldap.rb +13 -25
- data/lib/puppet/indirector/memory.rb +7 -7
- data/lib/puppet/indirector/module_files.rb +14 -14
- data/lib/puppet/indirector/node/exec.rb +3 -10
- data/lib/puppet/indirector/node/ldap.rb +138 -41
- data/lib/puppet/indirector/node/plain.rb +1 -8
- data/lib/puppet/indirector/node/rest.rb +1 -1
- data/lib/puppet/indirector/plain.rb +2 -2
- data/lib/puppet/indirector/report/processor.rb +2 -2
- data/lib/puppet/indirector/request.rb +42 -0
- data/lib/puppet/indirector/rest.rb +51 -3
- data/lib/puppet/indirector/terminus.rb +0 -27
- data/lib/puppet/indirector/yaml.rb +12 -17
- data/lib/puppet/metatype/attributes.rb +3 -7
- data/lib/puppet/metatype/evaluation.rb +2 -2
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/network/client/master.rb +29 -81
- data/lib/puppet/network/handler/master.rb +12 -43
- data/lib/puppet/network/http.rb +8 -6
- data/lib/puppet/network/http/handler.rb +42 -32
- data/lib/puppet/network/http/mongrel.rb +8 -9
- data/lib/puppet/network/http/mongrel/rest.rb +42 -15
- data/lib/puppet/network/http/webrick.rb +27 -16
- data/lib/puppet/network/http/webrick/rest.rb +38 -14
- data/lib/puppet/network/http_pool.rb +3 -2
- data/lib/puppet/network/server.rb +24 -22
- data/lib/puppet/network/xmlrpc/client.rb +6 -1
- data/lib/puppet/node.rb +38 -79
- data/lib/puppet/node/catalog.rb +9 -0
- data/lib/puppet/node/facts.rb +9 -1
- data/lib/puppet/parser/ast/function.rb +1 -1
- data/lib/puppet/parser/collector.rb +6 -0
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +25 -1
- data/lib/puppet/parser/interpreter.rb +2 -17
- data/lib/puppet/parser/parser.rb +4 -4
- data/lib/puppet/parser/parser_support.rb +6 -2
- data/lib/puppet/parser/resource.rb +6 -0
- data/lib/puppet/parser/templatewrapper.rb +9 -0
- data/lib/puppet/pgraph.rb +1 -1
- data/lib/puppet/property.rb +0 -1
- data/lib/puppet/provider.rb +9 -95
- data/lib/puppet/provider/confine.rb +77 -0
- data/lib/puppet/provider/confine/exists.rb +22 -0
- data/lib/puppet/provider/confine/false.rb +19 -0
- data/lib/puppet/provider/confine/feature.rb +17 -0
- data/lib/puppet/provider/confine/true.rb +20 -0
- data/lib/puppet/provider/confine/variable.rb +42 -0
- data/lib/puppet/provider/confine_collection.rb +47 -0
- data/lib/puppet/provider/confiner.rb +20 -0
- data/lib/puppet/provider/cron/crontab.rb +6 -2
- data/lib/puppet/provider/group/groupadd.rb +1 -1
- data/lib/puppet/provider/group/ldap.rb +48 -0
- data/lib/puppet/provider/ldap.rb +137 -0
- data/lib/puppet/provider/nameservice.rb +1 -2
- data/lib/puppet/provider/nameservice/objectadd.rb +2 -5
- data/lib/puppet/provider/package/dpkg.rb +16 -1
- data/lib/puppet/provider/package/freebsd.rb +15 -4
- data/lib/puppet/provider/package/gem.rb +33 -12
- data/lib/puppet/provider/package/pkgdmg.rb +1 -60
- data/lib/puppet/provider/package/ports.rb +6 -1
- data/lib/puppet/provider/package/rpm.rb +14 -13
- data/lib/puppet/provider/package/urpmi.rb +3 -3
- data/lib/puppet/provider/service/base.rb +4 -4
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +5 -3
- data/lib/puppet/provider/service/redhat.rb +35 -7
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +69 -0
- data/lib/puppet/provider/user/ldap.rb +133 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +14 -14
- data/lib/puppet/rails/database/schema.rb +9 -0
- data/lib/puppet/rails/resource.rb +1 -0
- data/lib/puppet/reference/providers.rb +8 -2
- data/lib/puppet/reference/report.rb +23 -0
- data/lib/puppet/reports/rrdgraph.rb +4 -2
- data/lib/puppet/sslcertificates/ca.rb +9 -4
- data/lib/puppet/sslcertificates/support.rb +26 -2
- data/lib/puppet/transaction.rb +11 -16
- data/lib/puppet/transaction/change.rb +94 -0
- data/lib/puppet/transaction/event.rb +21 -0
- data/lib/puppet/transaction/report.rb +4 -0
- data/lib/puppet/type.rb +0 -2
- data/lib/puppet/type/file/ensure.rb +0 -5
- data/lib/puppet/type/file/group.rb +13 -7
- data/lib/puppet/type/file/source.rb +8 -15
- data/lib/puppet/type/file/target.rb +2 -0
- data/lib/puppet/type/group.rb +1 -1
- data/lib/puppet/type/mount.rb +4 -2
- data/lib/puppet/type/nagios_hostescalation.rb +3 -0
- data/lib/puppet/type/nagios_servicegroup.rb +3 -0
- data/lib/puppet/type/ssh_authorized_key.rb +56 -0
- data/lib/puppet/type/user.rb +3 -0
- data/lib/puppet/type/yumrepo.rb +0 -1
- data/lib/puppet/util.rb +1 -1
- data/lib/puppet/util/ldap.rb +5 -0
- data/lib/puppet/util/ldap/connection.rb +69 -0
- data/lib/puppet/util/ldap/generator.rb +45 -0
- data/lib/puppet/util/ldap/manager.rb +281 -0
- data/lib/puppet/util/posix.rb +2 -2
- data/lib/puppet/util/resource_template.rb +61 -0
- data/lib/puppet/util/settings.rb +63 -3
- data/lib/puppet/util/storage.rb +4 -0
- data/lib/puppet/util/warnings.rb +7 -0
- data/man/man8/filebucket.8 +116 -0
- data/man/man8/pi.8 +34 -0
- data/man/man8/puppet.8 +78 -0
- data/man/man8/puppet.conf.8 +1747 -0
- data/man/man8/puppetca.8 +118 -0
- data/man/man8/puppetd.8 +184 -0
- data/man/man8/puppetdoc.8 +62 -0
- data/man/man8/puppetmasterd.8 +87 -0
- data/man/man8/puppetrun.8 +151 -0
- data/man/man8/ralsh.8 +135 -0
- data/test/README +24 -0
- data/test/certmgr/support.rb +28 -1
- data/test/data/failers/badclassnoparam +10 -0
- data/test/data/failers/badclassparam +10 -0
- data/test/data/failers/badcompnoparam +9 -0
- data/test/data/failers/badcompparam +9 -0
- data/test/data/failers/badtypeparam +3 -0
- data/test/data/failers/noobjectrvalue +1 -0
- data/test/data/providers/cron/crontab.allthree +17 -0
- data/test/data/providers/cron/crontab.envNcomment +12 -0
- data/test/data/providers/cron/crontab.envNname +11 -0
- data/test/data/providers/cron/crontab.multirecords +12 -0
- data/test/data/providers/cron/crontab_collections.yaml +44 -0
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +54 -0
- data/test/data/providers/cron/crontab_sample_records.yaml +272 -0
- data/test/data/providers/cron/examples/freebsd +2 -0
- data/test/data/providers/cron/examples/one +14 -0
- data/test/data/providers/cron/examples/openbsd +20 -0
- data/test/data/providers/package/testpackages.yaml +65 -0
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +5 -0
- data/test/data/reports/1.yaml +108 -0
- data/test/data/reports/2.yaml +108 -0
- data/test/data/reports/tagmail_failers.conf +3 -0
- data/test/data/reports/tagmail_passers.conf +30 -0
- data/test/data/snippets/aliastest.pp +16 -0
- data/test/data/snippets/argumentdefaults +14 -0
- data/test/data/snippets/casestatement.pp +58 -0
- data/test/data/snippets/classheirarchy.pp +15 -0
- data/test/data/snippets/classincludes.pp +17 -0
- data/test/data/snippets/classpathtest +11 -0
- data/test/data/snippets/collection.pp +10 -0
- data/test/data/snippets/collection_within_virtual_definitions.pp +20 -0
- data/test/data/snippets/componentmetaparams.pp +11 -0
- data/test/data/snippets/componentrequire.pp +8 -0
- data/test/data/snippets/deepclassheirarchy.pp +23 -0
- data/test/data/snippets/defineoverrides.pp +17 -0
- data/test/data/snippets/emptyclass.pp +9 -0
- data/test/data/snippets/emptyexec.pp +3 -0
- data/test/data/snippets/falsevalues.pp +3 -0
- data/test/data/snippets/filecreate +11 -0
- data/test/data/snippets/fqdefinition.pp +5 -0
- data/test/data/snippets/fqparents.pp +11 -0
- data/test/data/snippets/implicititeration +15 -0
- data/test/data/snippets/multipleinstances +7 -0
- data/test/data/snippets/multisubs.pp +13 -0
- data/test/data/snippets/namevartest +9 -0
- data/test/data/snippets/scopetest +13 -0
- data/test/data/snippets/selectorvalues.pp +42 -0
- data/test/data/snippets/simpledefaults +5 -0
- data/test/data/snippets/simpleselector +38 -0
- data/test/data/snippets/singleary.pp +19 -0
- data/test/data/snippets/singlequote.pp +11 -0
- data/test/data/snippets/singleselector.pp +22 -0
- data/test/data/snippets/subclass_name_duplication.pp +11 -0
- data/test/data/snippets/tag.pp +9 -0
- data/test/data/snippets/tagged.pp +35 -0
- data/test/data/snippets/virtualresources.pp +14 -0
- data/test/data/types/hosts/1 +3 -0
- data/test/data/types/hosts/2 +13 -0
- data/test/data/types/hosts/solaris +5 -0
- data/test/data/types/mailalias/file1 +183 -0
- data/test/data/types/mount/freebsd.fstab +7 -0
- data/test/data/types/mount/linux.fstab +11 -0
- data/test/data/types/mount/solaris.fstab +11 -0
- data/test/data/types/port/1 +533 -0
- data/test/data/types/port/darwin +11866 -0
- data/test/data/types/ssh_authorized_key/1 +2 -0
- data/test/data/types/sshkey/1 +21 -0
- data/test/data/types/yumrepos/fedora-devel.repo +26 -0
- data/test/data/types/yumrepos/fedora.repo +9 -0
- data/test/language/parser.rb +8 -1
- data/test/lib/puppettest/runnable_test.rb +3 -0
- data/test/lib/puppettest/support/utils.rb +1 -1
- data/test/lib/rake/puppet_testtask.rb +3 -0
- data/test/lib/stubba.rb +1 -1
- data/test/network/client/ca.rb +1 -0
- data/test/network/client/master.rb +13 -127
- data/test/network/handler/master.rb +61 -80
- data/test/other/provider.rb +0 -45
- data/test/other/transactions.rb +53 -15
- data/test/rails/host.rb +0 -37
- data/test/ral/providers/cron/crontab.rb +32 -3
- data/test/ral/providers/provider.rb +28 -7
- data/test/ral/type/filesources.rb +2 -18
- data/test/ral/type/sshkey.rb +0 -1
- data/test/ral/type/user.rb +6 -0
- data/test/test +241 -0
- metadata +289 -113
- data/examples/root/etc/configfile +0 -0
- data/examples/root/etc/debian-passwd +0 -29
- data/examples/root/etc/debian-syslog.conf +0 -71
- data/lib/puppet/event.rb +0 -28
- data/lib/puppet/network/handler/configuration.rb +0 -184
- data/lib/puppet/network/http/mongrel/xmlrpc.rb +0 -4
- data/lib/puppet/network/http/webrick/xmlrpc.rb +0 -4
- data/lib/puppet/propertychange.rb +0 -141
- data/lib/puppet/provider/interface/redhat.rb +0 -250
- data/lib/puppet/provider/interface/sunos.rb +0 -133
- data/lib/puppet/type/interface.rb +0 -60
- data/lib/puppet/util/variables.rb +0 -38
- data/test/network/handler/configuration.rb +0 -160
- data/test/other/propertychange.rb +0 -140
- data/test/util/loadedfile.rb +0 -121
@@ -0,0 +1,64 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
|
3
|
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
4
|
+
DAEMON=/usr/sbin/puppetd
|
5
|
+
DAEMON_OPTS="-w 0"
|
6
|
+
NAME=puppetd
|
7
|
+
DESC="puppet configuration management tool"
|
8
|
+
|
9
|
+
test -x $DAEMON || exit 0
|
10
|
+
|
11
|
+
[ -r /etc/default/puppet ] && . /etc/default/puppet
|
12
|
+
|
13
|
+
. /lib/lsb/init-functions
|
14
|
+
|
15
|
+
reload_puppet() {
|
16
|
+
start-stop-daemon --stop --quiet --signal HUP --pidfile /var/run/puppet/$NAME.pid
|
17
|
+
}
|
18
|
+
|
19
|
+
start_puppet() {
|
20
|
+
start-stop-daemon --start --quiet --pidfile /var/run/puppet/$NAME.pid \
|
21
|
+
--startas $DAEMON -- $DAEMON_OPTS
|
22
|
+
}
|
23
|
+
|
24
|
+
stop_puppet() {
|
25
|
+
start-stop-daemon --stop --quiet --pidfile /var/run/puppet/$NAME.pid
|
26
|
+
}
|
27
|
+
|
28
|
+
if [ ! -d /var/run/puppet ]; then
|
29
|
+
rm -rf /var/run/puppet
|
30
|
+
mkdir -p /var/run/puppet
|
31
|
+
fi
|
32
|
+
|
33
|
+
chown puppet:puppet /var/run/puppet
|
34
|
+
|
35
|
+
case "$1" in
|
36
|
+
start)
|
37
|
+
log_begin_msg "Starting $DESC"
|
38
|
+
start_puppet
|
39
|
+
log_end_msg 0
|
40
|
+
;;
|
41
|
+
stop)
|
42
|
+
log_begin_msg "Stopping $DESC"
|
43
|
+
stop_puppet
|
44
|
+
log_end_msg 0
|
45
|
+
;;
|
46
|
+
reload)
|
47
|
+
log_begin_msg "Reloading $DESC"
|
48
|
+
reload_puppet
|
49
|
+
log_end_msg 0
|
50
|
+
;;
|
51
|
+
restart|force-reload)
|
52
|
+
log_begin_msg "Restarting $DESC"
|
53
|
+
stop_puppet
|
54
|
+
sleep 1
|
55
|
+
start_puppet
|
56
|
+
log_end_msg 0
|
57
|
+
;;
|
58
|
+
*)
|
59
|
+
echo "Usage: $0 {start|stop|restart|force-reload|reload}" >&2
|
60
|
+
exit 1
|
61
|
+
;;
|
62
|
+
esac
|
63
|
+
|
64
|
+
exit 0
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/var/log/puppet/*log {
|
2
|
+
missingok
|
3
|
+
create 0644 puppet puppet
|
4
|
+
compress
|
5
|
+
rotate 4
|
6
|
+
|
7
|
+
postrotate
|
8
|
+
[ -e /etc/init.d/puppetmaster ] && /etc/init.d/puppetmaster restart >/dev/null 2>&1 || true
|
9
|
+
[ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true
|
10
|
+
endscript
|
11
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
|
3
|
+
case "$1" in
|
4
|
+
purge)
|
5
|
+
rm -rf /var/lib/puppet
|
6
|
+
/usr/sbin/deluser --system puppet
|
7
|
+
;;
|
8
|
+
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
9
|
+
|
10
|
+
|
11
|
+
;;
|
12
|
+
|
13
|
+
*)
|
14
|
+
echo "postrm called with unknown argument \`$1'" >&2
|
15
|
+
exit 1
|
16
|
+
|
17
|
+
esac
|
18
|
+
|
19
|
+
#DEBHELPER#
|
20
|
+
|
21
|
+
exit 0
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
|
3
|
+
case "$1" in
|
4
|
+
install|upgrade)
|
5
|
+
/usr/sbin/adduser --system \
|
6
|
+
--group \
|
7
|
+
--home /var/lib/puppet \
|
8
|
+
--gecos "Puppet configuration management daemon" \
|
9
|
+
puppet > /dev/null
|
10
|
+
;;
|
11
|
+
|
12
|
+
abort-upgrade)
|
13
|
+
;;
|
14
|
+
|
15
|
+
*)
|
16
|
+
echo "preinst called with unknown argument \`$1'" >&2
|
17
|
+
exit 1
|
18
|
+
;;
|
19
|
+
esac
|
20
|
+
|
21
|
+
#DEBHELPER#
|
22
|
+
|
23
|
+
exit 0
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
|
3
|
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
4
|
+
DAEMON=/usr/sbin/puppetmasterd
|
5
|
+
DAEMON_OPTS=""
|
6
|
+
NAME=puppetmasterd
|
7
|
+
DESC="puppet configuration management tool master server"
|
8
|
+
|
9
|
+
test -x $DAEMON || exit 0
|
10
|
+
|
11
|
+
[ -r /etc/default/puppetmaster ] && . /etc/default/puppetmaster
|
12
|
+
|
13
|
+
. /lib/lsb/init-functions
|
14
|
+
|
15
|
+
if [ ! -d /var/run/puppet ]; then
|
16
|
+
rm -rf /var/run/puppet
|
17
|
+
mkdir -p /var/run/puppet
|
18
|
+
fi
|
19
|
+
|
20
|
+
chown puppet:puppet /var/run/puppet
|
21
|
+
|
22
|
+
start_puppetmaster() {
|
23
|
+
start-stop-daemon --start --quiet --pidfile /var/run/puppet/$NAME.pid \
|
24
|
+
--startas $DAEMON -- $DAEMON_OPTS
|
25
|
+
}
|
26
|
+
|
27
|
+
stop_puppetmaster() {
|
28
|
+
start-stop-daemon --stop --quiet --pidfile /var/run/puppet/$NAME.pid
|
29
|
+
}
|
30
|
+
|
31
|
+
case "$1" in
|
32
|
+
start)
|
33
|
+
log_begin_msg "Starting $DESC"
|
34
|
+
start_puppetmaster
|
35
|
+
log_end_msg $?
|
36
|
+
;;
|
37
|
+
stop)
|
38
|
+
log_begin_msg "Stopping $DESC"
|
39
|
+
stop_puppetmaster
|
40
|
+
log_end_msg $?
|
41
|
+
;;
|
42
|
+
reload)
|
43
|
+
# Do nothing, as Puppetmaster rechecks its config automatically
|
44
|
+
;;
|
45
|
+
restart|force-reload)
|
46
|
+
log_begin_msg "Restarting $DESC"
|
47
|
+
stop_puppetmaster
|
48
|
+
sleep 1
|
49
|
+
start_puppetmaster
|
50
|
+
log_end_msg 0
|
51
|
+
;;
|
52
|
+
*)
|
53
|
+
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
|
54
|
+
exit 1
|
55
|
+
;;
|
56
|
+
esac
|
57
|
+
|
58
|
+
exit 0
|
data/conf/debian/rules
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/make -f
|
2
|
+
# -*- makefile -*-
|
3
|
+
|
4
|
+
# Uncomment this to turn on verbose mode.
|
5
|
+
#export DH_VERBOSE=1
|
6
|
+
|
7
|
+
INSTALL=install -Dp
|
8
|
+
|
9
|
+
prefix := $(CURDIR)/debian/tmp
|
10
|
+
bindir := $(prefix)/usr/bin
|
11
|
+
sbindir := $(prefix)/usr/sbin
|
12
|
+
libdir := $(prefix)/usr/lib
|
13
|
+
localstatedir := $(prefix)/var
|
14
|
+
rubylibdir := $(libdir)/ruby/1.8
|
15
|
+
sysconfdir := $(prefix)/etc
|
16
|
+
pkgconfdir := $(sysconfdir)/puppet
|
17
|
+
|
18
|
+
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
19
|
+
CFLAGS += -O0
|
20
|
+
else
|
21
|
+
CFLAGS += -O2
|
22
|
+
endif
|
23
|
+
|
24
|
+
configure: configure-stamp
|
25
|
+
configure-stamp:
|
26
|
+
dh_testdir
|
27
|
+
touch configure-stamp
|
28
|
+
|
29
|
+
|
30
|
+
build: build-stamp
|
31
|
+
build-stamp: configure-stamp
|
32
|
+
dh_testdir
|
33
|
+
touch build-stamp
|
34
|
+
|
35
|
+
clean:
|
36
|
+
dh_testdir
|
37
|
+
dh_testroot
|
38
|
+
rm -f build-stamp configure-stamp
|
39
|
+
dh_clean
|
40
|
+
|
41
|
+
install: build
|
42
|
+
dh_testdir
|
43
|
+
dh_testroot
|
44
|
+
dh_clean -k
|
45
|
+
dh_installdirs
|
46
|
+
|
47
|
+
# ripped from the redhat spec
|
48
|
+
# this sucks, who wants to maintain this?
|
49
|
+
# note to self, fix the install.rb to handle DESTDIR and change
|
50
|
+
# library path
|
51
|
+
install -d -m0755 $(sbindir)
|
52
|
+
install -d -m0755 $(bindir)
|
53
|
+
install -d -m0755 $(rubylibdir)
|
54
|
+
install -d -m0755 $(pkgconfdir)/manifests
|
55
|
+
install -d -m0755 $(localstatedir)/lib/puppet
|
56
|
+
install -d -m0755 $(localstatedir)/run
|
57
|
+
install -d -m0755 $(localstatedir)/log/puppet
|
58
|
+
|
59
|
+
$(INSTALL) -m0755 bin/puppet bin/puppetdoc $(bindir)
|
60
|
+
$(INSTALL) -m0755 bin/puppetd bin/puppetmasterd bin/puppetca bin/puppetrun $(sbindir)
|
61
|
+
$(INSTALL) -m0644 lib/puppet.rb $(rubylibdir)/puppet.rb
|
62
|
+
cp -a lib/puppet $(rubylibdir)
|
63
|
+
find $(rubylibdir) -type f -perm +ugo+x -exec chmod a-x {} \;
|
64
|
+
|
65
|
+
$(INSTALL) -m0644 debian/fileserver.conf $(pkgconfdir)/fileserver.conf
|
66
|
+
$(INSTALL) -m0644 debian/puppet.conf $(pkgconfdir)/puppet.conf
|
67
|
+
|
68
|
+
# Vim auto-syntax-highlighting stuff
|
69
|
+
$(INSTALL) -m0644 ext/vim/syntax/puppet.vim \
|
70
|
+
$(CURDIR)/debian/puppet/usr/share/vim/vim71/syntax/
|
71
|
+
$(INSTALL) -m0644 ext/vim/ftdetect/puppet.vim \
|
72
|
+
$(CURDIR)/debian/puppet/usr/share/vim/addons/ftdetect/
|
73
|
+
|
74
|
+
# Emacs keeping up with the Joneses
|
75
|
+
$(INSTALL) -m0644 ext/emacs/puppet-mode-init.el \
|
76
|
+
$(CURDIR)/debian/puppet/etc/emacs/site-start.d/50puppet-mode-init.el
|
77
|
+
$(INSTALL) -m0644 ext/emacs/puppet-mode.el \
|
78
|
+
$(CURDIR)/debian/puppet/usr/share/emacs/site-lisp/puppet-mode.el
|
79
|
+
|
80
|
+
dh_installexamples examples/*
|
81
|
+
|
82
|
+
# Logcheck rules. Gee I wish you could specify a file to source
|
83
|
+
# in dh_installlogcheck.
|
84
|
+
cp ext/logcheck/puppet debian/puppet.logcheck.ignore.server
|
85
|
+
cp ext/logcheck/puppet debian/puppet.logcheck.ignore.workstation
|
86
|
+
dh_installlogcheck
|
87
|
+
rm debian/puppet.logcheck.*
|
88
|
+
|
89
|
+
# Clean out any SVN cruft that may still be lingering in our
|
90
|
+
# packages
|
91
|
+
find debian/tmp debian/puppet debian/puppetmaster -name .svn |xargs rm -rf
|
92
|
+
|
93
|
+
# Build architecture-dependent files here.
|
94
|
+
binary-arch: build install
|
95
|
+
|
96
|
+
# Build architecture-independent files here.
|
97
|
+
binary-indep: build install
|
98
|
+
dh_testdir
|
99
|
+
dh_testroot
|
100
|
+
dh_movefiles -i
|
101
|
+
dh_installchangelogs -i CHANGELOG
|
102
|
+
dh_installdocs -i
|
103
|
+
dh_installinit -ppuppetmaster
|
104
|
+
dh_installinit -ppuppet -- defaults 21
|
105
|
+
dh_installlogrotate -i
|
106
|
+
dh_compress -i
|
107
|
+
dh_fixperms -i
|
108
|
+
dh_installdeb -i
|
109
|
+
dh_shlibdeps -i
|
110
|
+
dh_gencontrol -i
|
111
|
+
dh_md5sums -i
|
112
|
+
dh_builddeb -i
|
113
|
+
|
114
|
+
binary: binary-indep binary-arch
|
115
|
+
.PHONY: build clean binary-indep binary-arch binary install configure
|
data/conf/debian/watch
ADDED
data/conf/gentoo/init.d/puppet
CHANGED
@@ -24,7 +24,7 @@ start() {
|
|
24
24
|
[[ -n "${PUPPET_EXTRA_OPTS}" ]] && options="${options} ${PUPPET_EXTRA_OPTS}"
|
25
25
|
|
26
26
|
ebegin "Starting puppet"
|
27
|
-
start-stop-daemon --start --quiet --exec /usr/bin/puppetd -- ${options}
|
27
|
+
start-stop-daemon --start --quiet --exec /usr/bin/ruby /usr/bin/puppetd -- ${options}
|
28
28
|
eend $? "Failed to start puppet"
|
29
29
|
}
|
30
30
|
|
@@ -1,50 +1,51 @@
|
|
1
1
|
#!/sbin/runscript
|
2
|
-
# Copyright 1999-
|
2
|
+
# Copyright 1999-2008 Gentoo Foundation
|
3
3
|
# Distributed under the terms of the GNU General Public License v2
|
4
|
-
# $Header$
|
5
4
|
|
6
5
|
depend() {
|
7
|
-
|
8
|
-
|
6
|
+
need net
|
7
|
+
before puppet
|
8
|
+
use dns logger
|
9
9
|
}
|
10
10
|
|
11
11
|
checkconfig() {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
if [[ ! -d "${PUPPETMASTER_PID_DIR}" ]] ; then
|
13
|
+
eerror "Please make sure PUPPETMASTER_PID_DIR is defined and points to a existing directory"
|
14
|
+
return 1
|
15
|
+
fi
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
local site_manifest="/etc/puppet/manifests/site.pp"
|
18
|
+
[[ -n "${PUPPETMASTER_MANIFEST}" ]] && site_manifest="${PUPPETMASTER_MANIFEST}"
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
if [ ! -f "${site_manifest}" ] ; then
|
21
|
+
eerror "Please create ${site_manifest} before running puppet"
|
22
|
+
return 1
|
23
|
+
fi
|
24
24
|
|
25
|
-
|
25
|
+
return 0
|
26
26
|
}
|
27
27
|
|
28
28
|
start() {
|
29
|
-
|
29
|
+
checkconfig || return $?
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
local options=""
|
32
|
+
[[ -n "${PUPPETMASTER_MANIFEST}" ]] && options="${options} --manifest=${PUPPETMASTER_MANIFEST}"
|
33
|
+
[[ -n "${PUPPETMASTER_LOG}" ]] && options="${options} --logdest=${PUPPETMASTER_LOG}"
|
34
|
+
[[ -n "${PUPPETMASTER_EXTRA_OPTS}" ]] && options="${options} ${PUPPETMASTER_EXTRA_OPTS}"
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
ebegin "Starting puppetmaster"
|
37
|
+
start-stop-daemon --start --quiet --exec /usr/bin/ruby /usr/bin/puppetmasterd \
|
38
|
+
-- ${options}
|
39
|
+
eend $? "Failed to start puppetmaster"
|
40
40
|
}
|
41
41
|
|
42
42
|
stop() {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
ebegin "Stopping puppetmaster"
|
44
|
+
start-stop-daemon --stop --quiet \
|
45
|
+
--pidfile ${PUPPETMASTER_PID_DIR}/puppetmasterd.pid
|
46
|
+
local ret=$?
|
47
|
+
eend ${ret} "Failed to stop puppetmaster"
|
48
|
+
rm -f ${PUPPETMASTER_PID_DIR}/puppetmasterd.pid
|
49
|
+
return ${ret}
|
50
50
|
}
|
51
|
+
|
data/conf/redhat/client.init
CHANGED
@@ -15,7 +15,7 @@ export PATH
|
|
15
15
|
|
16
16
|
[ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
|
17
17
|
lockfile=${LOCKFILE-/var/lock/subsys/puppet}
|
18
|
-
pidfile=${PIDFILE-/var/run/puppet/
|
18
|
+
pidfile=${PIDFILE-/var/run/puppet/puppetd.pid}
|
19
19
|
puppetd=${PUPPETD-/usr/sbin/puppetd}
|
20
20
|
RETVAL=0
|
21
21
|
|
@@ -62,6 +62,11 @@ restart() {
|
|
62
62
|
start
|
63
63
|
}
|
64
64
|
|
65
|
+
genconfig() {
|
66
|
+
echo -n $"Generate configuration puppet: "
|
67
|
+
$puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} --genconfig
|
68
|
+
}
|
69
|
+
|
65
70
|
case "$1" in
|
66
71
|
start)
|
67
72
|
start
|
@@ -86,8 +91,11 @@ case "$1" in
|
|
86
91
|
shift
|
87
92
|
$puppetd -o ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} $@
|
88
93
|
;;
|
94
|
+
genconfig)
|
95
|
+
genconfig
|
96
|
+
;;
|
89
97
|
*)
|
90
|
-
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once}"
|
98
|
+
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once|genconfig}"
|
91
99
|
exit 1
|
92
100
|
esac
|
93
101
|
|