diff --git a/Gemfile b/Gemfile index 43cc035a1..d7a7f300b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,100 +1,99 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" def location_for(place, fake_version = nil) if place =~ /^(git[:@][^#]*)#(.*)/ [fake_version, { :git => $1, :branch => $2, :require => false }].compact elsif place =~ /^file:\/\/(.*)/ ['>= 0', { :path => File.expand_path($1), :require => false }] else [place, { :require => false }] end end # C Ruby (MRI) or Rubinius, but NOT Windows platforms :ruby do gem 'pry', :group => :development gem 'yard', :group => :development gem 'redcarpet', '~> 2.0', :group => :development gem "racc", "1.4.9", :group => :development # To enable the augeas feature, use this gem. # Note that it is a native gem, so the augeas headers/libs # are neeed. #gem 'ruby-augeas', :group => :development end if !ENV['PUPPET_LOADED'] gem "puppet", :path => File.dirname(__FILE__), :require => false end gem "facter", *location_for(ENV['FACTER_LOCATION'] || ['> 1.6', '< 3']) gem "hiera", *location_for(ENV['HIERA_LOCATION'] || '~> 1.0') gem "rake", "10.1.1", :require => false group(:development, :test) do gem "rspec", "~> 2.14.0", :require => false # Mocha is not compatible across minor version changes; because of this only # versions matching ~> 0.10.5 are supported. All other versions are unsupported # and can be expected to fail. gem "mocha", "~> 0.10.5", :require => false gem "yarjuf", "~> 1.0" # json-schema does not support windows, so omit it from the platforms list # json-schema uses multi_json, but chokes with multi_json 1.7.9, so prefer 1.7.7 gem "multi_json", "1.7.7", :require => false, :platforms => [:ruby, :jruby] gem "json-schema", "2.1.1", :require => false, :platforms => [:ruby, :jruby] gem "rubocop", :platforms => [:ruby] unless RUBY_VERSION =~ /^1.8/ end group(:development) do if RUBY_PLATFORM != 'java' case RUBY_VERSION when /^1.8/ gem 'ruby-prof', "~> 0.13.1", :require => false else gem 'ruby-prof', :require => false end end end group(:extra) do gem "rack", "~> 1.4", :require => false gem "activerecord", '~> 3.2', :require => false gem "net-ssh", '~> 2.1', :require => false gem "puppetlabs_spec_helper", :require => false - gem "stomp", :require => false gem "tzinfo", :require => false case RUBY_PLATFORM when 'java' gem "jdbc-sqlite3", :require => false gem "msgpack-jruby", :require => false else gem "sqlite3", :require => false gem "msgpack", :require => false end end require 'yaml' data = YAML.load_file(File.join(File.dirname(__FILE__), 'ext', 'project_data.yaml')) bundle_platforms = data['bundle_platforms'] x64_platform = Gem::Platform.local.cpu == 'x64' data['gem_platform_dependencies'].each_pair do |gem_platform, info| next if gem_platform == 'x86-mingw32' && x64_platform next if gem_platform == 'x64-mingw32' && !x64_platform if bundle_deps = info['gem_runtime_dependencies'] bundle_platform = bundle_platforms[gem_platform] or raise "Missing bundle_platform" platform(bundle_platform.intern) do bundle_deps.each_pair do |name, version| gem(name, version, :require => false) end end end end if File.exists? "#{__FILE__}.local" eval(File.read("#{__FILE__}.local"), binding) end # vim:filetype=ruby diff --git a/ext/debian/control b/ext/debian/control index 41e76ea01..7d4653c64 100644 --- a/ext/debian/control +++ b/ext/debian/control @@ -1,144 +1,144 @@ Source: puppet Section: admin Priority: optional Maintainer: Puppet Labs Uploaders: Micah Anderson , Andrew Pollock , Nigel Kersten , Stig Sandbeck Mathisen Build-Depends-Indep: ruby | ruby-interpreter, libopenssl-ruby | libopenssl-ruby1.9.1 | libruby (>= 1:1.9.3.4), facter (>= 1.7.0), hiera (>= 1.0.0) Build-Depends: debhelper (>= 7.0.0), openssl Standards-Version: 3.9.1 Vcs-Git: git://github.com/puppetlabs/puppet Homepage: http://projects.puppetlabs.com/projects/puppet Package: puppet-common Architecture: all Depends: ${misc:Depends}, ruby | ruby-interpreter, libopenssl-ruby | libopenssl-ruby1.9.1 | libruby (>= 1:1.9.3.4), ruby-shadow | libshadow-ruby1.8, libaugeas-ruby | libaugeas-ruby1.9.1 | libaugeas-ruby1.8, adduser, lsb-base, sysv-rc (>= 2.86) | file-rc, hiera (>= 1.0.0), facter (>= 1.7.0), libjson-ruby | ruby-json Recommends: lsb-release, debconf-utils Suggests: ruby-selinux | libselinux-ruby1.8 Breaks: puppet (<< 2.6.0~rc2-1), puppetmaster (<< 0.25.4-1) Provides: hiera-puppet Conflicts: hiera-puppet, puppet (<< 3.3.0-1puppetlabs1) Replaces: hiera-puppet Description: Centralized configuration management Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. . Puppet's simple declarative specification language provides powerful classing abilities for drawing out the similarities between hosts while allowing them to be as specific as necessary, and it handles dependency and prerequisite relationships between objects clearly and explicitly. . This package contains the puppet software and documentation. For the startup scripts needed to run the puppet agent and master, see the "puppet" and "puppetmaster" packages, respectively. Package: puppet Architecture: all Depends: ${misc:Depends}, puppet-common (= ${binary:Version}), ruby | ruby-interpreter Recommends: rdoc Suggests: puppet-el, vim-puppet Conflicts: puppet-common (<< 3.3.0-1puppetlabs1) Description: Centralized configuration management - agent startup and compatibility scripts This package contains the startup script and compatbility scripts for the puppet agent, which is the process responsible for configuring the local node. . Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. . Puppet's simple declarative specification language provides powerful classing abilities for drawing out the similarities between hosts while allowing them to be as specific as necessary, and it handles dependency and prerequisite relationships between objects clearly and explicitly. Package: puppetmaster-common Architecture: all Depends: ${misc:Depends}, ruby | ruby-interpreter, puppet-common (= ${binary:Version}), facter (>= 1.7.0), lsb-base Breaks: puppet (<< 0.24.7-1), puppetmaster (<< 2.6.1~rc2-1) Replaces: puppetmaster (<< 2.6.1~rc2-1) -Suggests: apache2 | nginx, puppet-el, vim-puppet, stompserver, ruby-stomp | libstomp-ruby1.8, +Suggests: apache2 | nginx, puppet-el, vim-puppet, rdoc, ruby-ldap | libldap-ruby1.8, puppetdb-terminus Description: Puppet master common scripts This package contains common scripts for the puppet master, which is the server hosting manifests and files for the puppet nodes. . Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. . Puppet's simple declarative specification language provides powerful classing abilities for drawing out the similarities between hosts while allowing them to be as specific as necessary, and it handles dependency and prerequisite relationships between objects clearly and explicitly. Package: puppetmaster Architecture: all Depends: ${misc:Depends}, ruby | ruby-interpreter, puppetmaster-common (= ${source:Version}), facter (>= 1.7.0), lsb-base Breaks: puppet (<< 0.24.7-1) -Suggests: apache2 | nginx, puppet-el, vim-puppet, stompserver, ruby-stomp | libstomp-ruby1.8, +Suggests: apache2 | nginx, puppet-el, vim-puppet, rdoc, ruby-ldap | libldap-ruby1.8, puppetdb-terminus Description: Centralized configuration management - master startup and compatibility scripts This package contains the startup and compatibility scripts for the puppet master, which is the server hosting manifests and files for the puppet nodes. . Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. . Puppet's simple declarative specification language provides powerful classing abilities for drawing out the similarities between hosts while allowing them to be as specific as necessary, and it handles dependency and prerequisite relationships between objects clearly and explicitly. Package: puppetmaster-passenger Architecture: all Depends: ${misc:Depends}, ruby | ruby-interpreter, puppetmaster-common (= ${source:Version}), facter (>= 1.7.0), lsb-base, apache2, libapache2-mod-passenger Conflicts: puppetmaster (<< 2.6.1~rc2-1) Replaces: puppetmaster (<< 2.6.1~rc2-1) Description: Centralised configuration management - master setup to run under mod passenger This package provides a puppetmaster running under mod passenger. This configuration offers better performance and scalability. . Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. . Puppet's simple declarative specification language provides powerful classing abilities for drawing out the similarities between hosts while allowing them to be as specific as necessary, and it handles dependency and prerequisite relationships between objects clearly and explicitly. . Package: vim-puppet Architecture: all Depends: ${misc:Depends} Recommends: vim-addon-manager Conflicts: puppet (<< ${source:Version}) Description: syntax highlighting for puppet manifests in vim The vim-puppet package provides filetype detection and syntax highlighting for puppet manifests (files ending with ".pp"). Package: puppet-el Architecture: all Depends: ${misc:Depends}, emacsen-common Conflicts: puppet (<< ${source:Version}) Description: syntax highlighting for puppet manifests in emacs The puppet-el package provides syntax highlighting for puppet manifests Package: puppet-testsuite Architecture: all Depends: ${misc:Depends}, ruby | ruby-interpreter, puppet-common (= ${source:Version}), facter (>= 1.7.0), lsb-base, rails (>= 1.2.3-2), rdoc, ruby-ldap | libldap-ruby1.8, ruby-rspec | librspec-ruby, git-core, ruby-mocha | libmocha-ruby1.8 Recommends: cron Description: Centralized configuration management - test suite This package provides all the tests from the upstream puppet source code. The tests are used for improving the QA of the puppet package. diff --git a/ext/debian/puppet-common.manpages b/ext/debian/puppet-common.manpages index 6ebb5e296..6294f3e63 100644 --- a/ext/debian/puppet-common.manpages +++ b/ext/debian/puppet-common.manpages @@ -1,32 +1,31 @@ man/man5/puppet.conf.5 man/man8/extlookup2hiera.8 man/man8/puppet.8 man/man8/puppet-agent.8 man/man8/puppet-apply.8 man/man8/puppet-catalog.8 man/man8/puppet-cert.8 man/man8/puppet-certificate.8 man/man8/puppet-certificate_request.8 man/man8/puppet-certificate_revocation_list.8 man/man8/puppet-config.8 man/man8/puppet-describe.8 man/man8/puppet-device.8 man/man8/puppet-doc.8 man/man8/puppet-facts.8 man/man8/puppet-file.8 man/man8/puppet-filebucket.8 man/man8/puppet-help.8 man/man8/puppet-inspect.8 man/man8/puppet-key.8 man/man8/puppet-kick.8 man/man8/puppet-man.8 man/man8/puppet-module.8 man/man8/puppet-node.8 man/man8/puppet-parser.8 man/man8/puppet-plugin.8 -man/man8/puppet-queue.8 man/man8/puppet-report.8 man/man8/puppet-resource.8 man/man8/puppet-resource_type.8 man/man8/puppet-secret_agent.8 man/man8/puppet-status.8 diff --git a/ext/debian/puppetmaster-common.postinst b/ext/debian/puppetmaster-common.postinst new file mode 100755 index 000000000..39ca3b6a3 --- /dev/null +++ b/ext/debian/puppetmaster-common.postinst @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +rm -f /etc/init.d/puppetqd +rm -f /etc/default/puppetqd diff --git a/ext/debian/puppetmaster-common.puppetqd.default b/ext/debian/puppetmaster-common.puppetqd.default deleted file mode 100644 index 05e1da6db..000000000 --- a/ext/debian/puppetmaster-common.puppetqd.default +++ /dev/null @@ -1,27 +0,0 @@ -# Defaults for puppetqd - sourced by /etc/init.d/puppetqd - -# Should puppetqd (the storeconfigs queuing broker) be started? -# This can take some load off of the puppetmaster by queuing the -# storeconfig updates to the database with puppetqd. You need -# to have the 'stompserver' package installed and running, and -# the following configured in your puppet.conf: -# -# [main] -# queue_type = stomp -# queue_source = stomp://localhost:61613 -# dbadapter = (sqlite3|mysql|postgresql) -# dbserver=localhost -# dbname=puppet -# dbuser=puppet -# dbpassword=xxxx -# dblocation = /var/lib/puppet/storeconfigs.sqlite <-- only if using sqlite -# -# [master] -# async_storeconfigs = true -# -# See: http://puppetlabs.com/trac/puppet/wiki/UsingStoredConfiguration -# -# Once you have the proper puppet.conf, and stompserver, you can enable -# the following: -PUPPETQD=no -PUPPETQD_OPTS="" diff --git a/ext/debian/puppetmaster-common.puppetqd.init b/ext/debian/puppetmaster-common.puppetqd.init deleted file mode 100644 index 287e25f9d..000000000 --- a/ext/debian/puppetmaster-common.puppetqd.init +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: puppetqd -# Required-Start: $network $named $remote_fs $syslog -# Required-Stop: $network $named $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -### END INIT INFO - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/puppet -DAEMON_OPTS="queue" -NAME=queue -DESC="puppet queue" -PIDFILE="/var/run/puppet/${NAME}.pid" - -test -x $DAEMON || exit 0 - -[ -r /etc/default/puppetqd ] && . /etc/default/puppetqd - -. /lib/lsb/init-functions - -if [ ! -d /var/run/puppet ]; then - mkdir -p /var/run/puppet -fi - -chown puppet:puppet /var/run/puppet - -is_true() { - if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ] ; then - return 0 - else - return 1 - fi -} - -start_puppet_queue() { - if is_true "$PUPPETQD" ; then - start-stop-daemon --start --quiet --pidfile=${PIDFILE} \ - --startas $DAEMON -- $NAME $DAEMON_OPTS $PUPPETQD_OPTS - fi -} - -stop_puppet_queue() { - start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE} - rm -f ${PIDFILE} -} - -status_puppet_queue() { - if is_true "$PUPPETQD" ; then - status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" - else - echo "" - echo "puppetqd not configured to start" - fi -} - - -case "$1" in - start) - log_begin_msg "Starting $DESC" - start_puppet_queue - log_end_msg $? - ;; - stop) - log_begin_msg "Stopping $DESC" - stop_puppet_queue - log_end_msg $? - ;; - status) - status_puppet_queue - ;; - reload|restart|force-reload) - log_begin_msg "Restarting $DESC" - stop_puppet_queue - sleep 1 - start_puppet_queue - log_end_msg $? - ;; - *) - echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 - exit 1 - ;; -esac diff --git a/ext/debian/rules b/ext/debian/rules index acafa7df9..97e58468b 100755 --- a/ext/debian/rules +++ b/ext/debian/rules @@ -1,129 +1,128 @@ #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 INSTALL=install -Dp prefix := $(CURDIR)/debian/tmp bindir := $(prefix)/$(shell /usr/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["bindir"]') libdir := $(prefix)/usr/lib localstatedir := $(prefix)/var rubylibdir := $(shell /usr/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendordir"]') sysconfdir := $(prefix)/etc pkgconfdir := $(sysconfdir)/puppet ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp build-arch: build build-indep: build build: build-stamp build-stamp: configure-stamp dh_testdir touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp rm -f debian/puppet-common.logcheck.ignore.server dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(CURDIR)/install.rb --destdir=debian/tmp --bindir=/usr/bin --sitelibdir=$(rubylibdir) --ruby=/usr/bin/ruby # strip executable bit from all the non-executable files. find $(prefix)/$(rubylibdir) -type f -perm /u+x,g+x,o+x -exec chmod a-x {} \; # fix the permissions on all of the directories find $(prefix)/$(rubylibdir) -type d -exec chmod 755 {} \; # Vim auto-syntax-highlighting stuff $(INSTALL) -m0644 ext/vim/syntax/puppet.vim \ $(CURDIR)/debian/vim-puppet/usr/share/vim/addons/syntax/ $(INSTALL) -m0644 ext/vim/ftdetect/puppet.vim \ $(CURDIR)/debian/vim-puppet/usr/share/vim/addons/ftdetect/ $(INSTALL) -m0644 debian/vim-puppet.yaml \ $(CURDIR)/debian/vim-puppet/usr/share/vim/registry/ # Emacs mode $(INSTALL) -m0644 ext/emacs/puppet-mode.el \ $(CURDIR)/debian/puppet-el/usr/share/emacs/site-lisp/puppet-mode.el # Install the config.ru $(INSTALL) -m0644 ext/rack/config.ru \ $(CURDIR)/debian/puppetmaster-passenger/usr/share/puppet/rack/puppetmasterd # Install apache2 site configuration template $(INSTALL) -m0644 ext/rack/example-passenger-vhost.conf \ $(CURDIR)/debian/puppetmaster-passenger/usr/share/puppetmaster-passenger/apache2.site.conf.tmpl # Install example environment README $(INSTALL) -m0644 ext/README.environment \ $(CURDIR)/debian/puppet-common/etc/puppet/environments/example_env/README.environment # Add ext directory cp -pr ext $(CURDIR)/debian/puppet-common/usr/share/puppet # Remove misc packaging artifacts not applicable to debian rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/gentoo rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/freebsd rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/solaris rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/suse rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/windows rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/redhat rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/ips rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/osx rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/build_defaults.yaml rm -rf $(CURDIR)/debian/puppet-common/usr/share/puppet/ext/project_data.yaml dh_installexamples -p puppet-common examples/* $(INSTALL) -d -m0775 $(pkgconfdir)/templates $(INSTALL) -d -m0775 $(pkgconfdir)/modules # Logcheck rules. Gee I wish you could specify a file to source # in dh_installlogcheck. ln ext/logcheck/puppet debian/puppet-common.logcheck.ignore.server # Build architecture-dependent files here. binary-arch: build install # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_install -i dh_installdocs -i dh_installemacsen dh_installlogcheck dh_installman dh_installinit -ppuppetmaster - dh_installinit --name=puppetqd dh_installinit -ppuppet --error-handler=true -- defaults 21 dh_installlogrotate -i dh_lintian -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_shlibdeps -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/ext/redhat/puppet.spec.erb b/ext/redhat/puppet.spec.erb index 8dc2c5734..d8416e9b5 100644 --- a/ext/redhat/puppet.spec.erb +++ b/ext/redhat/puppet.spec.erb @@ -1,857 +1,854 @@ # Augeas and SELinux requirements may be disabled at build time by passing # --without augeas and/or --without selinux to rpmbuild or mock # Fedora 17 ships with ruby 1.9, RHEL 7 with ruby 2.0, which use vendorlibdir instead # of sitelibdir. Adjust our target if installing on f17 or rhel7. %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?amzn} >= 1 %global puppet_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]') %else %global puppet_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]') %endif %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 %global _with_systemd 1 %else %global _with_systemd 0 %endif # VERSION is subbed out during rake srpm process %global realversion <%= @version %> %global rpmversion <%= @rpmversion %> %global confdir ext/redhat %global pending_upgrade_path %{_localstatedir}/lib/rpm-state/puppet %global pending_upgrade_file %{pending_upgrade_path}/upgrade_pending Name: puppet Version: %{rpmversion} Release: <%= @rpmrelease -%>%{?dist} Vendor: %{?_host_vendor} Summary: A network tool for managing many disparate systems License: ASL 2.0 URL: http://puppetlabs.com Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{realversion}.tar.gz Group: System Environment/Base BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: facter >= 1:1.7.0 # Puppet 3.x drops ruby 1.8.5 support and adds ruby 1.9 support BuildRequires: ruby >= 1.8.7 BuildRequires: hiera >= 1.0.0 BuildArch: noarch Requires: ruby >= 1.8 Requires: ruby-shadow Requires: rubygem-json # Pull in ruby selinux bindings where available %if 0%{?fedora} || 0%{?rhel} >= 6 %{!?_without_selinux:Requires: ruby(selinux), libselinux-utils} %else %if ( 0%{?rhel} && 0%{?rhel} == 5 ) || 0%{?amzn} >= 1 %{!?_without_selinux:Requires: libselinux-ruby, libselinux-utils} %endif %endif Requires: facter >= 1:1.7.0 # Puppet 3.x drops ruby 1.8.5 support and adds ruby 1.9 support # Ruby 1.8.7 available for el5 at: yum.puppetlabs.com/el/5/devel/$ARCH Requires: ruby >= 1.8.7 Requires: hiera >= 1.0.0 Obsoletes: hiera-puppet < 1.0.0 Provides: hiera-puppet >= 1.0.0 %{!?_without_augeas:Requires: ruby-augeas} # Required for %%pre Requires: shadow-utils %if 0%{?_with_systemd} # Required for %%post, %%preun, %%postun Requires: systemd %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 BuildRequires: systemd %else BuildRequires: systemd-units %endif %else # Required for %%post and %%preun Requires: chkconfig # Required for %%preun and %%postun Requires: initscripts %endif %description Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. %package server Group: System Environment/Base Summary: Server for the puppet system management tool Requires: puppet = %{version}-%{release} # chkconfig (%%post, %%preun) and initscripts (%%preun %%postun) are required for non systemd # and systemd (%%post, %%preun, and %%postun) are required for systems with systemd as default # They come along transitively with puppet-%{version}-%{release}. %description server Provides the central puppet server daemon which provides manifests to clients. The server can also function as a certificate authority and file server. %prep %setup -q -n %{name}-%{realversion} %build for f in external/nagios.rb relationship.rb; do sed -i -e '1d' lib/puppet/$f done find examples/ -type f | xargs --no-run-if-empty chmod a-x %install rm -rf %{buildroot} ruby install.rb --destdir=%{buildroot} --quick --no-rdoc --sitelibdir=%{puppet_libdir} install -d -m0755 %{buildroot}%{_sysconfdir}/puppet/environments/example_env/manifests install -d -m0755 %{buildroot}%{_sysconfdir}/puppet/environments/example_env/modules install -d -m0755 %{buildroot}%{_sysconfdir}/puppet/manifests install -d -m0755 %{buildroot}%{_datadir}/%{name}/modules install -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet install -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet/state install -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet/reports install -d -m0755 %{buildroot}%{_localstatedir}/run/puppet # As per redhat bz #495096 install -d -m0750 %{buildroot}%{_localstatedir}/log/puppet %if 0%{?_with_systemd} # Systemd for fedora >= 17 or el 7 %{__install} -d -m0755 %{buildroot}%{_unitdir} install -Dp -m0644 ext/systemd/puppet.service %{buildroot}%{_unitdir}/puppet.service ln -s %{_unitdir}/puppet.service %{buildroot}%{_unitdir}/puppetagent.service install -Dp -m0644 ext/systemd/puppetmaster.service %{buildroot}%{_unitdir}/puppetmaster.service %else # Otherwise init.d for fedora < 17 or el 5, 6 install -Dp -m0644 %{confdir}/client.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppet install -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet install -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppetmaster install -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster -install -Dp -m0755 %{confdir}/queue.init %{buildroot}%{_initrddir}/puppetqueue %endif install -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf install -Dp -m0644 %{confdir}/puppet.conf %{buildroot}%{_sysconfdir}/puppet/puppet.conf install -Dp -m0644 %{confdir}/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet install -Dp -m0644 ext/README.environment %{buildroot}%{_sysconfdir}/puppet/environments/example_env/README.environment # Install the ext/ directory to %%{_datadir}/%%{name} install -d %{buildroot}%{_datadir}/%{name} cp -a ext/ %{buildroot}%{_datadir}/%{name} # emacs and vim bits are installed elsewhere rm -rf %{buildroot}%{_datadir}/%{name}/ext/{emacs,vim} # remove misc packaging artifacts not applicable to rpms rm -rf %{buildroot}%{_datadir}/%{name}/ext/{gentoo,freebsd,solaris,suse,windows,osx,ips,debian} rm -f %{buildroot}%{_datadir}/%{name}/ext/redhat/*.init rm -f %{buildroot}%{_datadir}/%{name}/ext/{build_defaults.yaml,project_data.yaml} # Rpmlint fixup chmod 755 %{buildroot}%{_datadir}/%{name}/ext/regexp_nodes/regexp_nodes.rb chmod 755 %{buildroot}%{_datadir}/%{name}/ext/puppet-load.rb # Install emacs mode files emacsdir=%{buildroot}%{_datadir}/emacs/site-lisp install -Dp -m0644 ext/emacs/puppet-mode.el $emacsdir/puppet-mode.el install -Dp -m0644 ext/emacs/puppet-mode-init.el \ $emacsdir/site-start.d/puppet-mode-init.el # Install vim syntax files vimdir=%{buildroot}%{_datadir}/vim/vimfiles install -Dp -m0644 ext/vim/ftdetect/puppet.vim $vimdir/ftdetect/puppet.vim install -Dp -m0644 ext/vim/syntax/puppet.vim $vimdir/syntax/puppet.vim %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 # Setup tmpfiles.d config mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d echo "D /var/run/%{name} 0755 %{name} %{name} -" > \ %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf %endif # Create puppet modules directory for puppet module tool mkdir -p %{buildroot}%{_sysconfdir}/%{name}/modules # Install a NetworkManager dispatcher script to pickup changes to # # /etc/resolv.conf and such (https://bugzilla.redhat.com/532085). mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d cp -pr ext/puppet-nm-dispatcher \ %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/98-%{name} %files %defattr(-, root, root, 0755) %doc LICENSE README.md examples %{_bindir}/puppet %{_bindir}/extlookup2hiera %{puppet_libdir}/* %dir %{_sysconfdir}/NetworkManager %dir %{_sysconfdir}/NetworkManager/dispatcher.d %{_sysconfdir}/NetworkManager/dispatcher.d/98-puppet %if 0%{?_with_systemd} %{_unitdir}/puppet.service %{_unitdir}/puppetagent.service %else %{_initrddir}/puppet %config(noreplace) %{_sysconfdir}/sysconfig/puppet %endif %dir %{_sysconfdir}/puppet %dir %{_sysconfdir}/%{name}/modules %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf %endif %config(noreplace) %{_sysconfdir}/puppet/puppet.conf %config(noreplace) %{_sysconfdir}/puppet/auth.conf %config(noreplace) %{_sysconfdir}/logrotate.d/puppet # We don't want to require emacs or vim, so we need to own these dirs %{_datadir}/emacs %{_datadir}/vim %{_datadir}/%{name} # man pages %{_mandir}/man5/puppet.conf.5.gz %{_mandir}/man8/puppet.8.gz %{_mandir}/man8/puppet-agent.8.gz %{_mandir}/man8/puppet-apply.8.gz %{_mandir}/man8/puppet-catalog.8.gz %{_mandir}/man8/puppet-describe.8.gz %{_mandir}/man8/puppet-ca.8.gz %{_mandir}/man8/puppet-cert.8.gz %{_mandir}/man8/puppet-certificate.8.gz %{_mandir}/man8/puppet-certificate_request.8.gz %{_mandir}/man8/puppet-certificate_revocation_list.8.gz %{_mandir}/man8/puppet-config.8.gz %{_mandir}/man8/puppet-device.8.gz %{_mandir}/man8/puppet-doc.8.gz %{_mandir}/man8/puppet-facts.8.gz %{_mandir}/man8/puppet-file.8.gz %{_mandir}/man8/puppet-filebucket.8.gz %{_mandir}/man8/puppet-help.8.gz %{_mandir}/man8/puppet-inspect.8.gz %{_mandir}/man8/puppet-key.8.gz %{_mandir}/man8/puppet-kick.8.gz %{_mandir}/man8/puppet-man.8.gz %{_mandir}/man8/puppet-module.8.gz %{_mandir}/man8/puppet-node.8.gz %{_mandir}/man8/puppet-parser.8.gz %{_mandir}/man8/puppet-plugin.8.gz -%{_mandir}/man8/puppet-queue.8.gz %{_mandir}/man8/puppet-report.8.gz %{_mandir}/man8/puppet-resource.8.gz %{_mandir}/man8/puppet-resource_type.8.gz %{_mandir}/man8/puppet-secret_agent.8.gz %{_mandir}/man8/puppet-status.8.gz %{_mandir}/man8/extlookup2hiera.8.gz # These need to be owned by puppet so the server can # write to them. The separate %defattr's are required # to work around RH Bugzilla 681540 %defattr(-, puppet, puppet, 0755) %{_localstatedir}/run/puppet %defattr(-, puppet, puppet, 0750) %{_localstatedir}/log/puppet %{_localstatedir}/lib/puppet %{_localstatedir}/lib/puppet/state %{_localstatedir}/lib/puppet/reports # Return the default attributes to 0755 to # prevent incorrect permission assignment on EL6 %defattr(-, root, root, 0755) %files server %defattr(-, root, root, 0755) %if 0%{?_with_systemd} %{_unitdir}/puppetmaster.service %else %{_initrddir}/puppetmaster -%{_initrddir}/puppetqueue %config(noreplace) %{_sysconfdir}/sysconfig/puppetmaster %endif %config(noreplace) %{_sysconfdir}/puppet/fileserver.conf %dir %{_sysconfdir}/puppet/manifests %dir %{_sysconfdir}/puppet/environments %dir %{_sysconfdir}/puppet/environments/example_env %dir %{_sysconfdir}/puppet/environments/example_env/manifests %dir %{_sysconfdir}/puppet/environments/example_env/modules %{_sysconfdir}/puppet/environments/example_env/README.environment %{_mandir}/man8/puppet-ca.8.gz %{_mandir}/man8/puppet-master.8.gz # Fixed uid/gid were assigned in bz 472073 (Fedora), 471918 (RHEL-5), # and 471919 (RHEL-4) %pre getent group puppet &>/dev/null || groupadd -r puppet -g 52 &>/dev/null getent passwd puppet &>/dev/null || \ useradd -r -u 52 -g puppet -d %{_localstatedir}/lib/puppet -s /sbin/nologin \ -c "Puppet" puppet &>/dev/null # ensure that old setups have the right puppet home dir if [ $1 -gt 1 ] ; then usermod -d %{_localstatedir}/lib/puppet puppet &>/dev/null fi exit 0 %post %if 0%{?_with_systemd} /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ "$1" -ge 1 ]; then # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving # the old process running. oldpid="%{_localstatedir}/run/puppet/puppetd.pid" newpid="%{_localstatedir}/run/puppet/agent.pid" if [ -s "$oldpid" -a ! -s "$newpid" ]; then (kill $(< "$oldpid") && rm -f "$oldpid" && \ /bin/systemctl start puppet.service) >/dev/null 2>&1 || : fi fi %else /sbin/chkconfig --add puppet || : if [ "$1" -ge 1 ]; then # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving # the old process running. oldpid="%{_localstatedir}/run/puppet/puppetd.pid" newpid="%{_localstatedir}/run/puppet/agent.pid" if [ -s "$oldpid" -a ! -s "$newpid" ]; then (kill $(< "$oldpid") && rm -f "$oldpid" && \ /sbin/service puppet start) >/dev/null 2>&1 || : fi # If an old puppet process (one whose binary is located in /sbin) is running, # kill it and then start up a fresh with the new binary. if [ -e "$newpid" ]; then if ps aux | grep `cat "$newpid"` | grep -v grep | awk '{ print $12 }' | grep -q sbin; then (kill $(< "$newpid") && rm -f "$newpid" && \ /sbin/service puppet start) >/dev/null 2>&1 || : fi fi fi %endif %post server %if 0%{?_with_systemd} /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ "$1" -ge 1 ]; then # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving # the old process running. oldpid="%{_localstatedir}/run/puppet/puppetmasterd.pid" newpid="%{_localstatedir}/run/puppet/master.pid" if [ -s "$oldpid" -a ! -s "$newpid" ]; then (kill $(< "$oldpid") && rm -f "$oldpid" && \ /bin/systemctl start puppetmaster.service) > /dev/null 2>&1 || : fi fi %else /sbin/chkconfig --add puppetmaster || : if [ "$1" -ge 1 ]; then # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving # the old process running. oldpid="%{_localstatedir}/run/puppet/puppetmasterd.pid" newpid="%{_localstatedir}/run/puppet/master.pid" if [ -s "$oldpid" -a ! -s "$newpid" ]; then (kill $(< "$oldpid") && rm -f "$oldpid" && \ /sbin/service puppetmaster start) >/dev/null 2>&1 || : fi fi %endif %preun %if 0%{?_with_systemd} if [ "$1" -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable puppetagent.service > /dev/null 2>&1 || : /bin/systemctl --no-reload disable puppet.service > /dev/null 2>&1 || : /bin/systemctl stop puppetagent.service > /dev/null 2>&1 || : /bin/systemctl stop puppet.service > /dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi if [ "$1" == "1" ]; then /bin/systemctl is-enabled puppetagent.service > /dev/null 2>&1 if [ "$?" == "0" ]; then /bin/systemctl --no-reload disable puppetagent.service > /dev/null 2>&1 ||: /bin/systemctl stop puppetagent.service > /dev/null 2>&1 ||: /bin/systemctl daemon-reload >/dev/null 2>&1 ||: if [ ! -d %{pending_upgrade_path} ]; then mkdir -p %{pending_upgrade_path} fi if [ ! -e %{pending_upgrade_file} ]; then touch %{pending_upgrade_file} fi fi fi %else if [ "$1" = 0 ] ; then /sbin/service puppet stop > /dev/null 2>&1 /sbin/chkconfig --del puppet || : fi %endif %preun server %if 0%{?_with_systemd} if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable puppetmaster.service > /dev/null 2>&1 || : /bin/systemctl stop puppetmaster.service > /dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %else if [ "$1" = 0 ] ; then /sbin/service puppetmaster stop > /dev/null 2>&1 /sbin/chkconfig --del puppetmaster || : fi %endif %postun %if 0%{?_with_systemd} if [ $1 -ge 1 ] ; then if [ -e %{pending_upgrade_file} ]; then /bin/systemctl --no-reload enable puppet.service > /dev/null 2>&1 ||: /bin/systemctl start puppet.service > /dev/null 2>&1 ||: /bin/systemctl daemon-reload >/dev/null 2>&1 ||: rm %{pending_upgrade_file} fi # Package upgrade, not uninstall /bin/systemctl try-restart puppetagent.service >/dev/null 2>&1 || : fi %else if [ "$1" -ge 1 ]; then /sbin/service puppet condrestart >/dev/null 2>&1 || : fi %endif %postun server %if 0%{?_with_systemd} if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart puppetmaster.service >/dev/null 2>&1 || : fi %else if [ "$1" -ge 1 ]; then /sbin/service puppetmaster condrestart >/dev/null 2>&1 || : fi %endif %clean rm -rf %{buildroot} %changelog * <%= Time.now.strftime("%a %b %d %Y") %> Puppet Labs Release - <%= @rpmversion %>-<%= @rpmrelease %> - Build for <%= @version %> * Wed Oct 2 2013 Jason Antman - Move systemd service and unit file names back to "puppet" from erroneous "puppetagent" - Add symlink to puppetagent unit file for compatibility with current bug - Alter package removal actions to deactivate and stop both service names * Thu Jun 27 2013 Matthaus Owens - 3.2.3-0.1rc0 - Bump requires on ruby-rgen to 0.6.5 * Fri Apr 12 2013 Matthaus Owens - 3.2.0-0.1rc0 - Add requires on ruby-rgen for new parser in Puppet 3.2 * Fri Jan 25 2013 Matthaus Owens - 3.1.0-0.1rc1 - Add extlookup2hiera.8.gz to the files list * Wed Jan 9 2013 Ryan Uber - 3.1.0-0.1rc1 - Work-around for RH Bugzilla 681540 * Fri Dec 28 2012 Michael Stahnke - 3.0.2-2 - Added a script for Network Manager for bug https://bugzilla.redhat.com/532085 * Tue Dec 18 2012 Matthaus Owens - Remove for loop on examples/ code which no longer exists. Add --no-run-if-empty to xargs invocations. * Sat Dec 1 2012 Ryan Uber - Fix for logdir perms regression (#17866) * Wed Aug 29 2012 Moses Mendoza - 3.0.0-0.1rc5 - Update for 3.0.0 rc5 * Fri Aug 24 2012 Eric Sorenson - 3.0.0-0.1rc4 - Facter requirement is 1.6.11, not 2.0 - Update for 3.0.0 rc4 * Tue Aug 21 2012 Moses Mendoza - 2.7.19-1 - Update for 2.7.19 * Tue Aug 14 2012 Moses Mendoza - 2.7.19-0.1rc3 - Update for 2.7.19rc3 * Tue Aug 7 2012 Moses Mendoza - 2.7.19-0.1rc2 - Update for 2.7.19rc2 * Wed Aug 1 2012 Moses Mendoza - 2.7.19-0.1rc1 - Update for 2.7.19rc1 * Wed Jul 11 2012 William Hopper - 2.7.18-2 - (#15221) Create /etc/puppet/modules for puppet module tool * Mon Jul 9 2012 Moses Mendoza - 2.7.18-1 - Update for 2.7.18 * Tue Jun 19 2012 Matthaus Litteken - 2.7.17-1 - Update for 2.7.17 * Wed Jun 13 2012 Matthaus Litteken - 2.7.16-1 - Update for 2.7.16 * Fri Jun 08 2012 Moses Mendoza - 2.7.16-0.1rc1.2 - Updated facter 2.0 dep to include epoch 1 * Wed Jun 06 2012 Matthaus Litteken - 2.7.16-0.1rc1 - Update for 2.7.16rc1, added generated manpages * Fri Jun 01 2012 Matthaus Litteken - 3.0.0-0.1rc3 - Puppet 3.0.0rc3 Release * Fri Jun 01 2012 Matthaus Litteken - 2.7.15-0.1rc4 - Update for 2.7.15rc4 * Tue May 29 2012 Moses Mendoza - 2.7.15-0.1rc3 - Update for 2.7.15rc3 * Tue May 22 2012 Matthaus Litteken - 3.0.0-0.1rc2 - Puppet 3.0.0rc2 Release * Thu May 17 2012 Matthaus Litteken - 3.0.0-0.1rc1 - Puppet 3.0.0rc1 Release * Wed May 16 2012 Moses Mendoza - 2.7.15-0.1rc2 - Update for 2.7.15rc2 * Tue May 15 2012 Moses Mendoza - 2.7.15-0.1rc1 - Update for 2.7.15rc1 * Wed May 02 2012 Moses Mendoza - 2.7.14-1 - Update for 2.7.14 * Tue Apr 10 2012 Matthaus Litteken - 2.7.13-1 - Update for 2.7.13 * Mon Mar 12 2012 Michael Stahnke - 2.7.12-1 - Update for 2.7.12 * Fri Feb 24 2012 Matthaus Litteken - 2.7.11-2 - Update 2.7.11 from proper tag, including #12572 * Wed Feb 22 2012 Michael Stahnke - 2.7.11-1 - Update for 2.7.11 * Wed Jan 25 2012 Michael Stahnke - 2.7.10-1 - Update for 2.7.10 * Fri Dec 9 2011 Matthaus Litteken - 2.7.9-1 - Update for 2.7.9 * Thu Dec 8 2011 Matthaus Litteken - 2.7.8-1 - Update for 2.7.8 * Wed Nov 30 2011 Michael Stahnke - 2.7.8-0.1rc1 - Update for 2.7.8rc1 * Mon Nov 21 2011 Michael Stahnke - 2.7.7-1 - Relaese 2.7.7 * Tue Nov 01 2011 Michael Stahnke - 2.7.7-0.1rc1 - Update for 2.7.7rc1 * Fri Oct 21 2011 Michael Stahnke - 2.7.6-1 - 2.7.6 final * Thu Oct 13 2011 Michael Stahnke - 2.7.6-.1rc3 - New RC * Fri Oct 07 2011 Michael Stahnke - 2.7.6-0.1rc2 - New RC * Mon Oct 03 2011 Michael Stahnke - 2.7.6-0.1rc1 - New RC * Fri Sep 30 2011 Michael Stahnke - 2.7.5-1 - Fixes for CVE-2011-3869, 3870, 3871 * Wed Sep 28 2011 Michael Stahnke - 2.7.4-1 - Fix for CVE-2011-3484 * Wed Jul 06 2011 Michael Stahnke - 2.7.2-0.2.rc1 - Clean up rpmlint errors - Put man pages in correct package * Wed Jul 06 2011 Michael Stahnke - 2.7.2-0.1.rc1 - Update to 2.7.2rc1 * Wed Jun 15 2011 Todd Zullinger - 2.6.9-0.1.rc1 - Update rc versioning to ensure 2.6.9 final is newer to rpm - sync changes with Fedora/EPEL * Tue Jun 14 2011 Michael Stahnke - 2.6.9rc1-1 - Update to 2.6.9rc1 * Thu Apr 14 2011 Todd Zullinger - 2.6.8-1 - Update to 2.6.8 * Thu Mar 24 2011 Todd Zullinger - 2.6.7-1 - Update to 2.6.7 * Wed Mar 16 2011 Todd Zullinger - 2.6.6-1 - Update to 2.6.6 - Ensure %%pre exits cleanly - Fix License tag, puppet is now GPLv2 only - Create and own /usr/share/puppet/modules (#615432) - Properly restart puppet agent/master daemons on upgrades from 0.25.x - Require libselinux-utils when selinux support is enabled - Support tmpfiles.d for Fedora >= 15 (#656677) * Wed Feb 09 2011 Fedora Release Engineering - 0.25.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Mon May 17 2010 Todd Zullinger - 0.25.5-1 - Update to 0.25.5 - Adjust selinux conditional for EL-6 - Apply rundir-perms patch from tarball rather than including it separately - Update URL's to reflect the new puppetlabs.com domain * Fri Jan 29 2010 Todd Zullinger - 0.25.4-1 - Update to 0.25.4 * Tue Jan 19 2010 Todd Zullinger - 0.25.3-2 - Apply upstream patch to fix cron resources (upstream #2845) * Mon Jan 11 2010 Todd Zullinger - 0.25.3-1 - Update to 0.25.3 * Tue Jan 05 2010 Todd Zullinger - 0.25.2-1.1 - Replace %%define with %%global for macros * Tue Jan 05 2010 Todd Zullinger - 0.25.2-1 - Update to 0.25.2 - Fixes CVE-2010-0156, tmpfile security issue (#502881) - Install auth.conf, puppetqd manpage, and queuing examples/docs * Wed Nov 25 2009 Jeroen van Meeuwen - 0.25.1-1 - New upstream version * Tue Oct 27 2009 Todd Zullinger - 0.25.1-0.3 - Update to 0.25.1 - Include the pi program and man page (R.I.Pienaar) * Sat Oct 17 2009 Todd Zullinger - 0.25.1-0.2.rc2 - Update to 0.25.1rc2 * Tue Sep 22 2009 Todd Zullinger - 0.25.1-0.1.rc1 - Update to 0.25.1rc1 - Move puppetca to puppet package, it has uses on client systems - Drop redundant %%doc from manpage %%file listings * Fri Sep 04 2009 Todd Zullinger - 0.25.0-1 - Update to 0.25.0 - Fix permissions on /var/log/puppet (#495096) - Install emacs mode and vim syntax files (#491437) - Install ext/ directory in %%{_datadir}/%%{name} (/usr/share/puppet) * Mon May 04 2009 Todd Zullinger - 0.25.0-0.1.beta1 - Update to 0.25.0beta1 - Make Augeas and SELinux requirements build time options * Mon Mar 23 2009 Todd Zullinger - 0.24.8-1 - Update to 0.24.8 - Quiet output from %%pre - Use upstream install script - Increase required facter version to >= 1.5 * Tue Dec 16 2008 Todd Zullinger - 0.24.7-4 - Remove redundant useradd from %%pre * Tue Dec 16 2008 Jeroen van Meeuwen - 0.24.7-3 - New upstream version - Set a static uid and gid (#472073, #471918, #471919) - Add a conditional requirement on libselinux-ruby for Fedora >= 9 - Add a dependency on ruby-augeas * Wed Oct 22 2008 Todd Zullinger - 0.24.6-1 - Update to 0.24.6 - Require ruby-shadow on Fedora and RHEL >= 5 - Simplify Fedora/RHEL version checks for ruby(abi) and BuildArch - Require chkconfig and initstripts for preun, post, and postun scripts - Conditionally restart puppet in %%postun - Ensure %%preun, %%post, and %%postun scripts exit cleanly - Create puppet user/group according to Fedora packaging guidelines - Quiet a few rpmlint complaints - Remove useless %%pbuild macro - Make specfile more like the Fedora/EPEL template * Mon Jul 28 2008 David Lutterkort - 0.24.5-1 - Add /usr/bin/puppetdoc * Thu Jul 24 2008 Brenton Leanhardt - New version - man pages now ship with tarball - examples/code moved to root examples dir in upstream tarball * Tue Mar 25 2008 David Lutterkort - 0.24.4-1 - Add man pages (from separate tarball, upstream will fix to include in main tarball) * Mon Mar 24 2008 David Lutterkort - 0.24.3-1 - New version * Wed Mar 5 2008 David Lutterkort - 0.24.2-1 - New version * Sat Dec 22 2007 David Lutterkort - 0.24.1-1 - New version * Mon Dec 17 2007 David Lutterkort - 0.24.0-2 - Use updated upstream tarball that contains yumhelper.py * Fri Dec 14 2007 David Lutterkort - 0.24.0-1 - Fixed license - Munge examples/ to make rpmlint happier * Wed Aug 22 2007 David Lutterkort - 0.23.2-1 - New version * Thu Jul 26 2007 David Lutterkort - 0.23.1-1 - Remove old config files * Wed Jun 20 2007 David Lutterkort - 0.23.0-1 - Install one puppet.conf instead of old config files, keep old configs around to ease update - Use plain shell commands in install instead of macros * Wed May 2 2007 David Lutterkort - 0.22.4-1 - New version * Thu Mar 29 2007 David Lutterkort - 0.22.3-1 - Claim ownership of _sysconfdir/puppet (bz 233908) * Mon Mar 19 2007 David Lutterkort - 0.22.2-1 - Set puppet's homedir to /var/lib/puppet, not /var/puppet - Remove no-lockdir patch, not needed anymore * Mon Feb 12 2007 David Lutterkort - 0.22.1-2 - Fix bogus config parameter in puppetd.conf * Sat Feb 3 2007 David Lutterkort - 0.22.1-1 - New version * Fri Jan 5 2007 David Lutterkort - 0.22.0-1 - New version * Mon Nov 20 2006 David Lutterkort - 0.20.1-2 - Make require ruby(abi) and buildarch: noarch conditional for fedora 5 or later to allow building on older fedora releases * Mon Nov 13 2006 David Lutterkort - 0.20.1-1 - New version * Mon Oct 23 2006 David Lutterkort - 0.20.0-1 - New version * Tue Sep 26 2006 David Lutterkort - 0.19.3-1 - New version * Mon Sep 18 2006 David Lutterkort - 0.19.1-1 - New version * Thu Sep 7 2006 David Lutterkort - 0.19.0-1 - New version * Tue Aug 1 2006 David Lutterkort - 0.18.4-2 - Use /usr/bin/ruby directly instead of /usr/bin/env ruby in executables. Otherwise, initscripts break since pidof can't find the right process * Tue Aug 1 2006 David Lutterkort - 0.18.4-1 - New version * Fri Jul 14 2006 David Lutterkort - 0.18.3-1 - New version * Wed Jul 5 2006 David Lutterkort - 0.18.2-1 - New version * Wed Jun 28 2006 David Lutterkort - 0.18.1-1 - Removed lsb-config.patch and yumrepo.patch since they are upstream now * Mon Jun 19 2006 David Lutterkort - 0.18.0-1 - Patch config for LSB compliance (lsb-config.patch) - Changed config moves /var/puppet to /var/lib/puppet, /etc/puppet/ssl to /var/lib/puppet, /etc/puppet/clases.txt to /var/lib/puppet/classes.txt, /etc/puppet/localconfig.yaml to /var/lib/puppet/localconfig.yaml * Fri May 19 2006 David Lutterkort - 0.17.2-1 - Added /usr/bin/puppetrun to server subpackage - Backported patch for yumrepo type (yumrepo.patch) * Wed May 3 2006 David Lutterkort - 0.16.4-1 - Rebuilt * Fri Apr 21 2006 David Lutterkort - 0.16.0-1 - Fix default file permissions in server subpackage - Run puppetmaster as user puppet - rebuilt for 0.16.0 * Mon Apr 17 2006 David Lutterkort - 0.15.3-2 - Don't create empty log files in post-install scriptlet * Fri Apr 7 2006 David Lutterkort - 0.15.3-1 - Rebuilt for new version * Wed Mar 22 2006 David Lutterkort - 0.15.1-1 - Patch0: Run puppetmaster as root; running as puppet is not ready for primetime * Mon Mar 13 2006 David Lutterkort - 0.15.0-1 - Commented out noarch; requires fix for bz184199 * Mon Mar 6 2006 David Lutterkort - 0.14.0-1 - Added BuildRequires for ruby * Wed Mar 1 2006 David Lutterkort - 0.13.5-1 - Removed use of fedora-usermgmt. It is not required for Fedora Extras and makes it unnecessarily hard to use this rpm outside of Fedora. Just allocate the puppet uid/gid dynamically * Sun Feb 19 2006 David Lutterkort - 0.13.0-4 - Use fedora-usermgmt to create puppet user/group. Use uid/gid 24. Fixed problem with listing fileserver.conf and puppetmaster.conf twice * Wed Feb 8 2006 David Lutterkort - 0.13.0-3 - Fix puppetd.conf * Wed Feb 8 2006 David Lutterkort - 0.13.0-2 - Changes to run puppetmaster as user puppet * Mon Feb 6 2006 David Lutterkort - 0.13.0-1 - Don't mark initscripts as config files * Mon Feb 6 2006 David Lutterkort - 0.12.0-2 - Fix BuildRoot. Add dist to release * Tue Jan 17 2006 David Lutterkort - 0.11.0-1 - Rebuild * Thu Jan 12 2006 David Lutterkort - 0.10.2-1 - Updated for 0.10.2 Fixed minor kink in how Source is given * Wed Jan 11 2006 David Lutterkort - 0.10.1-3 - Added basic fileserver.conf * Wed Jan 11 2006 David Lutterkort - 0.10.1-1 - Updated. Moved installation of library files to sitelibdir. Pulled initscripts into separate files. Folded tools rpm into server * Thu Nov 24 2005 Duane Griffin - Added init scripts for the client * Wed Nov 23 2005 Duane Griffin - First packaging diff --git a/ext/redhat/queue.init b/ext/redhat/queue.init deleted file mode 100644 index ba7cf3d06..000000000 --- a/ext/redhat/queue.init +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -# puppetqueue Init script for running the puppet queue daemon -# -# chkconfig: - 65 45 -# -# description: Processes entities in a queue as they are recieved. -# processname: puppetqd -# config: /etc/sysconfig/puppetqueue - -PATH=/usr/bin:/sbin:/bin:/usr/sbin -export PATH - -[ -f /etc/sysconfig/puppetqueue ] && . /etc/sysconfig/puppetqueue -lockfile=${LOCKFILE-/var/lock/subsys/puppetqd} -pidfile=${PIDFILE-/var/run/puppet/queue.pid} -puppetqd=${PUPPETQD-/usr/bin/puppet} -RETVAL=0 - -# Source function library. -. /etc/rc.d/init.d/functions - -PUPPET_OPTS="queue " -[ -n "${PUPPET_SERVER}" ] && PUPPET_OPTS="${PUPPET_OPTS} --server=${PUPPET_SERVER}" - -# Determine if we can use the -p option to daemon, killproc, and status. -# RHEL < 5 can't. -if status | grep -q -- '-p' 2>/dev/null; then - daemonopts="--pidfile $pidfile" - pidopts="-p $pidfile" -fi - -start() { - echo -n $"Starting puppet queue: " - daemon $daemonopts $puppetqd ${PUPPET_OPTS} - RETVAL=$? - echo - [ $RETVAL = 0 ] && touch ${lockfile} - return $RETVAL -} - -stop() { - echo -n $"Stopping puppet queue: " - killproc $pidopts $puppetqd - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} -} - -reload() { - echo -n $"Restarting puppet queue: " - killproc $pidopts $puppetqd -HUP - RETVAL=$? - echo - return $RETVAL -} - -restart() { - stop - start -} - -rh_status() { - status $pidopts $puppetqd - RETVAL=$? - return $RETVAL -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -genconfig() { - echo -n $"Generate puppet queue configuration: " - $puppetqd ${PUPPET_OPTS} --genconfig -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload|force-reload) - reload - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - status) - rh_status - ;; - genconfig) - genconfig - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}" - exit 1 -esac - -exit $RETVAL diff --git a/lib/puppet/application/queue.rb b/lib/puppet/application/queue.rb deleted file mode 100644 index 33155fc7f..000000000 --- a/lib/puppet/application/queue.rb +++ /dev/null @@ -1,161 +0,0 @@ -require 'puppet/application' -require 'puppet/util' -require 'puppet/daemon' -require 'puppet/util/pidlock' - -class Puppet::Application::Queue < Puppet::Application - - attr_accessor :daemon - - def app_defaults() - super.merge( :pidfile => "$rundir/queue.pid" ) - end - - def preinit - @argv = ARGV.dup - - # Do an initial trap, so that cancels don't get a stack trace. - - # This exits with exit code 1 - Signal.trap(:INT) do - $stderr.puts "Caught SIGINT; shutting down" - exit(1) - end - - # This is a normal shutdown, so code 0 - Signal.trap(:TERM) do - $stderr.puts "Caught SIGTERM; shutting down" - exit(0) - end - - { - :verbose => false, - :debug => false - }.each do |opt,val| - options[opt] = val - end - end - - option("--debug","-d") - option("--verbose","-v") - - def help - <<-HELP - -puppet-queue(8) -- Deprecated queuing daemon for asynchronous storeconfigs -======== - -SYNOPSIS --------- -Retrieves serialized storeconfigs records from a queue and processes -them in order. THIS FEATURE IS DEPRECATED; use PuppetDB instead. - - -USAGE ------ -puppet queue [-d|--debug] [--help] [-v|--verbose] [--version] - - -DESCRIPTION ------------ -This application runs as a daemon and processes storeconfigs data, -retrieving the data from a stomp server message queue and writing it to -a database. It was once necessary as a workaround for the poor performance -of ActiveRecord-based storeconfigs, but has been supplanted by the PuppetDB -service, which gives better performance with less complexity. - -For more information, see the PuppetDB documentation at -http://docs.puppetlabs.com/puppetdb/latest - - -OPTIONS -------- -Note that any setting that's valid in the configuration -file is also a valid long argument. For example, 'server' is a valid -setting, so you can specify '--server ' as -an argument. - -See the configuration file documentation at -http://docs.puppetlabs.com/references/stable/configuration.html for the -full list of acceptable parameters. A commented list of all -configuration options can also be generated by running puppet queue with -'--genconfig'. - -* --debug: - Enable full debugging. - -* --help: - Print this help message - -* --verbose: - Turn on verbose reporting. - -* --version: - Print the puppet version number and exit. - - -EXAMPLE -------- - $ puppet queue - - -AUTHOR ------- -Luke Kanies - - -COPYRIGHT ---------- -Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License - - HELP - end - - option("--logdest DEST", "-l DEST") do |arg| - handle_logdest_arg(arg) - end - - def main - require 'puppet/indirector/catalog/queue' # provides Puppet::Indirector::Queue.subscribe - Puppet.notice "Starting puppet queue #{Puppet.version}" - Puppet::Resource::Catalog::Queue.subscribe do |catalog| - # Once you have a Puppet::Resource::Catalog instance, passing it to save should suffice - # to put it through to the database via its active_record indirector (which is determined - # by the terminus_class = :active_record setting above) - Puppet::Util.benchmark(:notice, "Processing queued catalog for #{catalog.name}") do - begin - Puppet::Resource::Catalog.indirection.save(catalog) - rescue => detail - Puppet.log_exception(detail, "Could not save queued catalog for #{catalog.name}: #{detail}") - end - end - end - - Thread.list.each { |thread| thread.join } - end - - def setup - Puppet.warning "Puppet queue is deprecated. See http://links.puppetlabs.com/puppet-queue-deprecation" - - unless Puppet.features.stomp? - raise ArgumentError, "Could not load the 'stomp' library, which must be present for queueing to work. You must install the required library." - end - - setup_logs - - exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs? - - require 'puppet/resource/catalog' - Puppet::Resource::Catalog.indirection.terminus_class = :store_configs - - daemon = Puppet::Daemon.new(Puppet::Util::Pidlock.new(Puppet[:pidfile])) - daemon.argv = @argv - daemon.daemonize if Puppet[:daemonize] - - # We want to make sure that we don't have a cache - # class set up, because if storeconfigs is enabled, - # we'll get a loop of continually caching the catalog - # for storage again. - Puppet::Resource::Catalog.indirection.cache_class = nil - end -end diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index 644194d95..031191e3e 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -1,2020 +1,1986 @@ module Puppet def self.default_diffargs if (Facter.value(:kernel) == "AIX" && Facter.value(:kernelmajversion) == "5300") "" else "-u" end end ############################################################################################ # NOTE: For information about the available values for the ":type" property of settings, # see the docs for Settings.define_settings ############################################################################################ AS_DURATION = %q{This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y).} STORECONFIGS_ONLY = %q{This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated.} # This is defined first so that the facter implementation is replaced before other setting defaults are evaluated. define_settings(:main, :cfacter => { :default => false, :type => :boolean, :desc => 'Whether or not to use the native facter (cfacter) implementation instead of the Ruby one (facter). Defaults to false.', :hook => proc do |value| return unless value raise ArgumentError, 'facter has already evaluated facts.' if Facter.instance_variable_get(:@collection) raise ArgumentError, 'cfacter version 0.2.0 or later is not installed.' unless Puppet.features.cfacter? CFacter.initialize end } ) define_settings(:main, :confdir => { :default => nil, :type => :directory, :desc => "The main Puppet configuration directory. The default for this setting is calculated based on the user. If the process is running as root or the user that Puppet is supposed to run as, it defaults to a system directory, but if it's running as any other user, it defaults to being in the user's home directory.", }, :vardir => { :default => nil, :type => :directory, :owner => "service", :group => "service", :desc => "Where Puppet stores dynamic and growing data. The default for this setting is calculated specially, like `confdir`_.", }, ### NOTE: this setting is usually being set to a symbol value. We don't officially have a ### setting type for that yet, but we might want to consider creating one. :name => { :default => nil, :desc => "The name of the application, if we are running as one. The default is essentially $0 without the path or `.rb`.", } ) define_settings(:main, :logdir => { :default => nil, :type => :directory, :mode => "0750", :owner => "service", :group => "service", :desc => "The directory in which to store log files", }, :log_level => { :default => 'notice', :type => :enum, :values => ["debug","info","notice","warning","err","alert","emerg","crit"], :desc => "Default logging level for messages from Puppet. Allowed values are: * debug * info * notice * warning * err * alert * emerg * crit ", }, :disable_warnings => { :default => [], :type => :array, :desc => "A comma-separated list of warning types to suppress. If large numbers of warnings are making Puppet's logs too large or difficult to use, you can temporarily silence them with this setting. If you are preparing to upgrade Puppet to a new major version, you should re-enable all warnings for a while. Valid values for this setting are: * `deprecations` --- disables deprecation warnings.", :hook => proc do |value| values = munge(value) valid = %w[deprecations] invalid = values - (values & valid) if not invalid.empty? raise ArgumentError, "Cannot disable unrecognized warning types #{invalid.inspect}. Valid values are #{valid.inspect}." end end } ) define_settings(:main, :priority => { :default => nil, :type => :priority, :desc => "The scheduling priority of the process. Valid values are 'high', 'normal', 'low', or 'idle', which are mapped to platform-specific values. The priority can also be specified as an integer value and will be passed as is, e.g. -5. Puppet must be running as a privileged user in order to increase scheduling priority.", }, :trace => { :default => false, :type => :boolean, :desc => "Whether to print stack traces on some errors", }, :profile => { :default => false, :type => :boolean, :desc => "Whether to enable experimental performance profiling", }, :autoflush => { :default => true, :type => :boolean, :desc => "Whether log files should always flush to disk.", :hook => proc { |value| Log.autoflush = value } }, :syslogfacility => { :default => "daemon", :desc => "What syslog facility to use when logging to syslog. Syslog has a fixed list of valid facilities, and you must choose one of those; you cannot just make one up." }, :statedir => { :default => "$vardir/state", :type => :directory, :mode => "01755", :desc => "The directory where Puppet state is stored. Generally, this directory can be removed without causing harm (although it might result in spurious service restarts)." }, :rundir => { :default => nil, :type => :directory, :mode => "0755", :owner => "service", :group => "service", :desc => "Where Puppet PID files are kept." }, :genconfig => { :default => false, :type => :boolean, :desc => "When true, causes Puppet applications to print an example config file to stdout and exit. The example will include descriptions of each setting, and the current (or default) value of each setting, incorporating any settings overridden on the CLI (with the exception of `genconfig` itself). This setting only makes sense when specified on the command line as `--genconfig`.", }, :genmanifest => { :default => false, :type => :boolean, :desc => "Whether to just print a manifest to stdout and exit. Only makes sense when specified on the command line as `--genmanifest`. Takes into account arguments specified on the CLI.", }, :configprint => { :default => "", :desc => "Print the value of a specific configuration setting. If the name of a setting is provided for this, then the value is printed and puppet exits. Comma-separate multiple values. For a list of all values, specify 'all'.", }, :color => { :default => "ansi", :type => :string, :desc => "Whether to use colors when logging to the console. Valid values are `ansi` (equivalent to `true`), `html`, and `false`, which produces no color. Defaults to false on Windows, as its console does not support ansi colors.", }, :mkusers => { :default => false, :type => :boolean, :desc => "Whether to create the necessary user and group that puppet agent will run as.", }, :manage_internal_file_permissions => { :default => true, :type => :boolean, :desc => "Whether Puppet should manage the owner, group, and mode of files it uses internally", }, :onetime => { :default => false, :type => :boolean, :desc => "Perform one configuration run and exit, rather than spawning a long-running daemon. This is useful for interactively running puppet agent, or running puppet agent from cron.", :short => 'o', }, :path => { :default => "none", :desc => "The shell search path. Defaults to whatever is inherited from the parent process.", :call_hook => :on_define_and_write, :hook => proc do |value| ENV["PATH"] = "" if ENV["PATH"].nil? ENV["PATH"] = value unless value == "none" paths = ENV["PATH"].split(File::PATH_SEPARATOR) Puppet::Util::Platform.default_paths.each do |path| ENV["PATH"] += File::PATH_SEPARATOR + path unless paths.include?(path) end value end }, :libdir => { :type => :directory, :default => "$vardir/lib", :desc => "An extra search path for Puppet. This is only useful for those files that Puppet will load on demand, and is only guaranteed to work for those cases. In fact, the autoload mechanism is responsible for making sure this directory is in Ruby's search path\n", :call_hook => :on_initialize_and_write, :hook => proc do |value| $LOAD_PATH.delete(@oldlibdir) if defined?(@oldlibdir) and $LOAD_PATH.include?(@oldlibdir) @oldlibdir = value $LOAD_PATH << value end }, :ignoreimport => { :default => false, :type => :boolean, :desc => "If true, allows the parser to continue without requiring all files referenced with `import` statements to exist. This setting was primarily designed for use with commit hooks for parse-checking.", }, :environment => { :default => "production", :desc => "The environment Puppet is running in. For clients (e.g., `puppet agent`) this determines the environment itself, which is used to find modules and much more. For servers (i.e., `puppet master`) this provides the default environment for nodes we know nothing about." }, :environmentpath => { :default => "", :desc => "A search path for directory environments, as a list of directories separated by the system path separator character. (The POSIX path separator is ':', and the Windows path separator is ';'.) This setting must have a value set to enable **directory environments.** The recommended value is `$confdir/environments`. For more details, see http://docs.puppetlabs.com/puppet/latest/reference/environments.html", :type => :path, }, :always_cache_features => { :type => :boolean, :default => false, :desc => <<-'EOT' Affects how we cache attempts to load Puppet 'features'. If false, then calls to `Puppet.features.?` will always attempt to load the feature (which can be an expensive operation) unless it has already been loaded successfully. This makes it possible for a single agent run to, e.g., install a package that provides the underlying capabilities for a feature, and then later load that feature during the same run (even if the feature had been tested earlier and had not been available). If this setting is set to true, then features will only be checked once, and if they are not available, the negative result is cached and returned for all subsequent attempts to load the feature. This behavior is almost always appropriate for the server, and can result in a significant performance improvement for features that are checked frequently. EOT }, :diff_args => { :default => lambda { default_diffargs }, :desc => "Which arguments to pass to the diff command when printing differences between files. The command to use can be chosen with the `diff` setting.", }, :diff => { :default => (Puppet.features.microsoft_windows? ? "" : "diff"), :desc => "Which diff command to use when printing differences between files. This setting has no default value on Windows, as standard `diff` is not available, but Puppet can use many third-party diff tools.", }, :show_diff => { :type => :boolean, :default => false, :desc => "Whether to log and report a contextual diff when files are being replaced. This causes partial file contents to pass through Puppet's normal logging and reporting system, so this setting should be used with caution if you are sending Puppet's reports to an insecure destination. This feature currently requires the `diff/lcs` Ruby library.", }, :daemonize => { :type => :boolean, :default => (Puppet.features.microsoft_windows? ? false : true), :desc => "Whether to send the process into the background. This defaults to true on POSIX systems, and to false on Windows (where Puppet currently cannot daemonize).", :short => "D", :hook => proc do |value| if value and Puppet.features.microsoft_windows? raise "Cannot daemonize on Windows" end end }, :maximum_uid => { :default => 4294967290, :desc => "The maximum allowed UID. Some platforms use negative UIDs but then ship with tools that do not know how to handle signed ints, so the UIDs show up as huge numbers that can then not be fed back into the system. This is a hackish way to fail in a slightly more useful way when that happens.", }, :route_file => { :default => "$confdir/routes.yaml", :desc => "The YAML file containing indirector route configuration.", }, :node_terminus => { :type => :terminus, :default => "plain", :desc => "Where to find information about nodes.", }, :node_cache_terminus => { :type => :terminus, :default => nil, :desc => "How to store cached nodes. Valid values are (none), 'json', 'msgpack', 'yaml' or write only yaml ('write_only_yaml'). The master application defaults to 'write_only_yaml', all others to none.", }, :data_binding_terminus => { :type => :terminus, :default => "hiera", :desc => "Where to retrive information about data.", }, :hiera_config => { :default => "$confdir/hiera.yaml", :desc => "The hiera configuration file. Puppet only reads this file on startup, so you must restart the puppet master every time you edit it.", :type => :file, }, :binder => { :default => false, :desc => "Turns the binding system on or off. This includes bindings in modules. The binding system aggregates data from modules and other locations and makes them available for lookup. The binding system is experimental and any or all of it may change.", :type => :boolean, }, :binder_config => { :default => nil, :desc => "The binder configuration file. Puppet reads this file on each request to configure the bindings system. If set to nil (the default), a $confdir/binder_config.yaml is optionally loaded. If it does not exists, a default configuration is used. If the setting :binding_config is specified, it must reference a valid and existing yaml file.", :type => :file, }, :catalog_terminus => { :type => :terminus, :default => "compiler", :desc => "Where to get node catalogs. This is useful to change if, for instance, you'd like to pre-compile catalogs and store them in memcached or some other easily-accessed store.", }, :catalog_cache_terminus => { :type => :terminus, :default => nil, :desc => "How to store cached catalogs. Valid values are 'json', 'msgpack' and 'yaml'. The agent application defaults to 'json'." }, :facts_terminus => { :default => 'facter', :desc => "The node facts terminus.", }, :default_file_terminus => { :type => :terminus, :default => "rest", :desc => "The default source for files if no server is given in a uri, e.g. puppet:///file. The default of `rest` causes the file to be retrieved using the `server` setting. When running `apply` the default is `file_server`, causing requests to be filled locally." }, :httplog => { :default => "$logdir/http.log", :type => :file, :owner => "root", :mode => "0640", :desc => "Where the puppet agent web server logs.", }, :http_proxy_host => { :default => "none", :desc => "The HTTP proxy host to use for outgoing connections. Note: You may need to use a FQDN for the server hostname when using a proxy. Environment variable http_proxy or HTTP_PROXY will override this value", }, :http_proxy_port => { :default => 3128, :desc => "The HTTP proxy port to use for outgoing connections", }, :http_proxy_user => { :default => "none", :desc => "The user name for an authenticated HTTP proxy. Requires the `http_proxy_host` setting.", }, :http_proxy_password =>{ :default => "none", :hook => proc do |value| if Puppet.settings[:http_proxy_password] =~ /[@!# \/]/ raise "Passwords set in the http_proxy_password setting must be valid as part of a URL, and any reserved characters must be URL-encoded. We received: #{value}" end end, :desc => "The password for the user of an authenticated HTTP proxy. Requires the `http_proxy_user` setting. Note that passwords must be valid when used as part of a URL. If a password contains any characters with special meanings in URLs (as specified by RFC 3986 section 2.2), they must be URL-encoded. (For example, `#` would become `%23`.)", }, :http_keepalive_timeout => { :default => "4s", :type => :duration, :desc => "The maximum amount of time a persistent HTTP connection can remain idle in the connection pool, before it is closed. This timeout should be shorter than the keepalive timeout used on the HTTP server, e.g. Apache KeepAliveTimeout directive. #{AS_DURATION}" }, :http_debug => { :default => false, :type => :boolean, :desc => "Whether to write HTTP request and responses to stderr. This should never be used in a production environment." }, :filetimeout => { :default => "15s", :type => :duration, :desc => "The minimum time to wait between checking for updates in configuration files. This timeout determines how quickly Puppet checks whether a file (such as manifests or templates) has changed on disk. #{AS_DURATION}", }, :environment_timeout => { :default => "unlimited", :type => :ttl, :desc => "The time to live for a cached environment. #{AS_DURATION} This setting can also be set to `unlimited`, which causes the environment to be cached until the master is restarted." }, - :queue_type => { - :default => "stomp", - :desc => "Which type of queue to use for asynchronous processing.", - }, - :queue_type => { - :default => "stomp", - :desc => "Which type of queue to use for asynchronous processing.", - }, - :queue_source => { - :default => "stomp://localhost:61613/", - :desc => "Which type of queue to use for asynchronous processing. If your stomp server requires - authentication, you can include it in the URI as long as your stomp client library is at least 1.1.1", - }, - :async_storeconfigs => { - :default => false, - :type => :boolean, - :desc => "Whether to use a queueing system to provide asynchronous database integration. - Requires that `puppet queue` be running.", - :hook => proc do |value| - if value - # This reconfigures the termini for Node, Facts, and Catalog - Puppet.settings.override_default(:storeconfigs, true) - - # But then we modify the configuration - Puppet::Resource::Catalog.indirection.cache_class = :queue - Puppet.settings.override_default(:catalog_cache_terminus, :queue) - else - raise "Cannot disable asynchronous storeconfigs in a running process" - end - end - }, :thin_storeconfigs => { :default => false, :type => :boolean, :desc => "Boolean; whether Puppet should store only facts and exported resources in the storeconfigs database. This will improve the performance of exported resources with the older `active_record` backend, but will disable external tools that search the storeconfigs database. Thinning catalogs is generally unnecessary when using PuppetDB to store catalogs.", :hook => proc do |value| Puppet.settings.override_default(:storeconfigs, true) if value end }, :config_version => { :default => "", :desc => "How to determine the configuration version. By default, it will be the time that the configuration is parsed, but you can provide a shell script to override how the version is determined. The output of this script will be added to every log message in the reports, allowing you to correlate changes on your hosts to the source version on the server. Setting a global value for config_version in puppet.conf is deprecated. Please set a per-environment value in environment.conf instead. For more info, see http://docs.puppetlabs.com/puppet/latest/reference/environments.html", :deprecated => :allowed_on_commandline, }, :zlib => { :default => true, :type => :boolean, :desc => "Boolean; whether to use the zlib library", }, :prerun_command => { :default => "", :desc => "A command to run before every agent run. If this command returns a non-zero return code, the entire Puppet run will fail.", }, :postrun_command => { :default => "", :desc => "A command to run after every agent run. If this command returns a non-zero return code, the entire Puppet run will be considered to have failed, even though it might have performed work during the normal run.", }, :freeze_main => { :default => false, :type => :boolean, :desc => "Freezes the 'main' class, disallowing any code to be added to it. This essentially means that you can't have any code outside of a node, class, or definition other than in the site manifest.", }, :stringify_facts => { :default => true, :type => :boolean, :desc => "Flatten fact values to strings using #to_s. Means you can't have arrays or hashes as fact values. (DEPRECATED) This option will be removed in Puppet 4.0.", }, :trusted_node_data => { :default => false, :type => :boolean, :desc => "Stores trusted node data in a hash called $trusted. When true also prevents $trusted from being overridden in any scope.", }, :immutable_node_data => { :default => '$trusted_node_data', :type => :boolean, :desc => "When true, also prevents $trusted and $facts from being overridden in any scope", } ) Puppet.define_settings(:module_tool, :module_repository => { :default => 'https://forgeapi.puppetlabs.com', :desc => "The module repository", }, :module_working_dir => { :default => '$vardir/puppet-module', :desc => "The directory into which module tool data is stored", }, :module_skeleton_dir => { :default => '$module_working_dir/skeleton', :desc => "The directory which the skeleton for module tool generate is stored.", }, :forge_authorization => { :default => nil, :desc => "The authorization key to connect to the Puppet Forge. Leave blank for unauthorized or license based connections", }, :module_groups => { :default => nil, :desc => "Extra module groups to request from the Puppet Forge", } ) Puppet.define_settings( :main, # We have to downcase the fqdn, because the current ssl stuff (as oppsed to in master) doesn't have good facilities for # manipulating naming. :certname => { :default => lambda { Puppet::Settings.default_certname.downcase }, :desc => "The name to use when handling certificates. When a node requests a certificate from the CA puppet master, it uses the value of the `certname` setting as its requested Subject CN. This is the name used when managing a node's permissions in [auth.conf](http://docs.puppetlabs.com/puppet/latest/reference/config_file_auth.html). In most cases, it is also used as the node's name when matching [node definitions](http://docs.puppetlabs.com/puppet/latest/reference/lang_node_definitions.html) and requesting data from an ENC. (This can be changed with the `node_name_value` and `node_name_fact` settings, although you should only do so if you have a compelling reason.) A node's certname is available in Puppet manifests as `$trusted['certname']`. (See [Facts and Built-In Variables](http://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html) for more details.) * For best compatibility, you should limit the value of `certname` to only use letters, numbers, periods, underscores, and dashes. (That is, it should match `/\A[a-z0-9._-]+\Z/`.) * The special value `ca` is reserved, and can't be used as the certname for a normal node. Defaults to the node's fully qualified domain name.", :hook => proc { |value| raise(ArgumentError, "Certificate names must be lower case; see #1168") unless value == value.downcase }}, :certdnsnames => { :default => '', :hook => proc do |value| unless value.nil? or value == '' then Puppet.warning < < { :default => '', :desc => < { :default => "$confdir/csr_attributes.yaml", :type => :file, :desc => < { :default => "$ssldir/certs", :type => :directory, :mode => "0755", :owner => "service", :group => "service", :desc => "The certificate directory." }, :ssldir => { :default => "$confdir/ssl", :type => :directory, :mode => "0771", :owner => "service", :group => "service", :desc => "Where SSL certificates are kept." }, :publickeydir => { :default => "$ssldir/public_keys", :type => :directory, :mode => "0755", :owner => "service", :group => "service", :desc => "The public key directory." }, :requestdir => { :default => "$ssldir/certificate_requests", :type => :directory, :mode => "0755", :owner => "service", :group => "service", :desc => "Where host certificate requests are stored." }, :privatekeydir => { :default => "$ssldir/private_keys", :type => :directory, :mode => "0750", :owner => "service", :group => "service", :desc => "The private key directory." }, :privatedir => { :default => "$ssldir/private", :type => :directory, :mode => "0750", :owner => "service", :group => "service", :desc => "Where the client stores private certificate information." }, :passfile => { :default => "$privatedir/password", :type => :file, :mode => "0640", :owner => "service", :group => "service", :desc => "Where puppet agent stores the password for its private key. Generally unused." }, :hostcsr => { :default => "$ssldir/csr_$certname.pem", :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Where individual hosts store and look for their certificate requests." }, :hostcert => { :default => "$certdir/$certname.pem", :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Where individual hosts store and look for their certificates." }, :hostprivkey => { :default => "$privatekeydir/$certname.pem", :type => :file, :mode => "0640", :owner => "service", :group => "service", :desc => "Where individual hosts store and look for their private key." }, :hostpubkey => { :default => "$publickeydir/$certname.pem", :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Where individual hosts store and look for their public key." }, :localcacert => { :default => "$certdir/ca.pem", :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Where each client stores the CA certificate." }, :ssl_client_ca_auth => { :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Certificate authorities who issue server certificates. SSL servers will not be considered authentic unless they possess a certificate issued by an authority listed in this file. If this setting has no value then the Puppet master's CA certificate (localcacert) will be used." }, :ssl_server_ca_auth => { :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Certificate authorities who issue client certificates. SSL clients will not be considered authentic unless they possess a certificate issued by an authority listed in this file. If this setting has no value then the Puppet master's CA certificate (localcacert) will be used." }, :hostcrl => { :default => "$ssldir/crl.pem", :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "Where the host's certificate revocation list can be found. This is distinct from the certificate authority's CRL." }, :certificate_revocation => { :default => true, :type => :boolean, :desc => "Whether certificate revocation should be supported by downloading a Certificate Revocation List (CRL) to all clients. If enabled, CA chaining will almost definitely not work.", }, :certificate_expire_warning => { :default => "60d", :type => :duration, :desc => "The window of time leading up to a certificate's expiration that a notification will be logged. This applies to CA, master, and agent certificates. #{AS_DURATION}" }, :digest_algorithm => { :default => 'md5', :type => :enum, :values => ["md5", "sha256"], :desc => 'Which digest algorithm to use for file resources and the filebucket. Valid values are md5, sha256. Default is md5.', } ) define_settings( :ca, :ca_name => { :default => "Puppet CA: $certname", :desc => "The name to use the Certificate Authority certificate.", }, :cadir => { :default => "$ssldir/ca", :type => :directory, :owner => "service", :group => "service", :mode => "0755", :desc => "The root directory for the certificate authority." }, :cacert => { :default => "$cadir/ca_crt.pem", :type => :file, :owner => "service", :group => "service", :mode => "0644", :desc => "The CA certificate." }, :cakey => { :default => "$cadir/ca_key.pem", :type => :file, :owner => "service", :group => "service", :mode => "0640", :desc => "The CA private key." }, :capub => { :default => "$cadir/ca_pub.pem", :type => :file, :owner => "service", :group => "service", :mode => "0644", :desc => "The CA public key." }, :cacrl => { :default => "$cadir/ca_crl.pem", :type => :file, :owner => "service", :group => "service", :mode => "0644", :desc => "The certificate revocation list (CRL) for the CA. Will be used if present but otherwise ignored.", }, :caprivatedir => { :default => "$cadir/private", :type => :directory, :owner => "service", :group => "service", :mode => "0750", :desc => "Where the CA stores private certificate information." }, :csrdir => { :default => "$cadir/requests", :type => :directory, :owner => "service", :group => "service", :mode => "0755", :desc => "Where the CA stores certificate requests" }, :signeddir => { :default => "$cadir/signed", :type => :directory, :owner => "service", :group => "service", :mode => "0755", :desc => "Where the CA stores signed certificates." }, :capass => { :default => "$caprivatedir/ca.pass", :type => :file, :owner => "service", :group => "service", :mode => "0640", :desc => "Where the CA stores the password for the private key." }, :serial => { :default => "$cadir/serial", :type => :file, :owner => "service", :group => "service", :mode => "0644", :desc => "Where the serial number for certificates is stored." }, :autosign => { :default => "$confdir/autosign.conf", :type => :autosign, :desc => "Whether (and how) to autosign certificate requests. This setting is only relevant on a puppet master acting as a certificate authority (CA). Valid values are true (autosigns all certificate requests; not recommended), false (disables autosigning certificates), or the absolute path to a file. The file specified in this setting may be either a **configuration file** or a **custom policy executable.** Puppet will automatically determine what it is: If the Puppet user (see the `user` setting) can execute the file, it will be treated as a policy executable; otherwise, it will be treated as a config file. If a custom policy executable is configured, the CA puppet master will run it every time it receives a CSR. The executable will be passed the subject CN of the request _as a command line argument,_ and the contents of the CSR in PEM format _on stdin._ It should exit with a status of 0 if the cert should be autosigned and non-zero if the cert should not be autosigned. If a certificate request is not autosigned, it will persist for review. An admin user can use the `puppet cert sign` command to manually sign it, or can delete the request. For info on autosign configuration files, see [the guide to Puppet's config files](http://docs.puppetlabs.com/guides/configuring.html).", }, :allow_duplicate_certs => { :default => false, :type => :boolean, :desc => "Whether to allow a new certificate request to overwrite an existing certificate.", }, :ca_ttl => { :default => "5y", :type => :duration, :desc => "The default TTL for new certificates. #{AS_DURATION}" }, :req_bits => { :default => 4096, :desc => "The bit length of the certificates.", }, :keylength => { :default => 4096, :desc => "The bit length of keys.", }, :cert_inventory => { :default => "$cadir/inventory.txt", :type => :file, :mode => "0644", :owner => "service", :group => "service", :desc => "The inventory file. This is a text file to which the CA writes a complete listing of all certificates." } ) # Define the config default. define_settings(:application, :config_file_name => { :type => :string, :default => Puppet::Settings.default_config_file_name, :desc => "The name of the puppet config file.", }, :config => { :type => :file, :default => "$confdir/${config_file_name}", :desc => "The configuration file for the current puppet application.", }, :pidfile => { :type => :file, :default => "$rundir/${run_mode}.pid", :desc => "The file containing the PID of a running process. This file is intended to be used by service management frameworks and monitoring systems to determine if a puppet process is still in the process table.", }, :bindaddress => { :default => "0.0.0.0", :desc => "The address a listening server should bind to.", } ) define_settings(:master, :user => { :default => "puppet", :desc => "The user puppet master should run as.", }, :group => { :default => "puppet", :desc => "The group puppet master should run as.", }, :manifestdir => { :default => "$confdir/manifests", :type => :directory, :desc => "Used to build the default value of the `manifest` setting. Has no other purpose. This setting is deprecated.", :deprecated => :completely, }, :manifest => { :default => "$manifestdir/site.pp", :type => :file_or_directory, :desc => "The entry-point manifest for puppet master. This can be one file or a directory of manifests to be evaluated in alphabetical order. Puppet manages this path as a directory if one exists or if the path ends with a / or \\. Setting a global value for `manifest` in puppet.conf is deprecated. Please use directory environments instead. If you need to use something other than the environment's `manifests` directory as the main manifest, you can set `manifest` in environment.conf. For more info, see http://docs.puppetlabs.com/puppet/latest/reference/environments.html", :deprecated => :allowed_on_commandline, }, :default_manifest => { :default => "./manifests", :type => :string, :desc => "The default main manifest for directory environments. Any environment that doesn't set the `manifest` setting in its `environment.conf` file will use this manifest. This setting's value can be an absolute or relative path. An absolute path will make all environments default to the same main manifest; a relative path will allow each environment to use its own manifest, and Puppet will resolve the path relative to each environment's main directory. In either case, the path can point to a single file or to a directory of manifests to be evaluated in alphabetical order.", }, :disable_per_environment_manifest => { :default => false, :type => :boolean, :desc => "Whether to disallow an environment-specific main manifest. When set to `true`, Puppet will use the manifest specified in the `default_manifest` setting for all environments. If an environment specifies a different main manifest in its `environment.conf` file, catalog requests for that environment will fail with an error. This setting requires `default_manifest` to be set to an absolute path.", :hook => proc do |value| if value && !Pathname.new(Puppet[:default_manifest]).absolute? raise(Puppet::Settings::ValidationError, "The 'default_manifest' setting must be set to an absolute path when 'disable_per_environment_manifest' is true") end end, }, :code => { :default => "", :desc => "Code to parse directly. This is essentially only used by `puppet`, and should only be set if you're writing your own Puppet executable.", }, :masterhttplog => { :default => "$logdir/masterhttp.log", :type => :file, :owner => "service", :group => "service", :mode => "0660", :create => true, :desc => "Where the puppet master web server saves its access log. This is only used when running a WEBrick puppet master. When puppet master is running under a Rack server like Passenger, that web server will have its own logging behavior." }, :masterport => { :default => 8140, :desc => "The port for puppet master traffic. For puppet master, this is the port to listen on; for puppet agent, this is the port to make requests on. Both applications use this setting to get the port.", }, :node_name => { :default => "cert", :desc => "How the puppet master determines the client's identity and sets the 'hostname', 'fqdn' and 'domain' facts for use in the manifest, in particular for determining which 'node' statement applies to the client. Possible values are 'cert' (use the subject's CN in the client's certificate) and 'facter' (use the hostname that the client reported in its facts)", }, :bucketdir => { :default => "$vardir/bucket", :type => :directory, :mode => "0750", :owner => "service", :group => "service", :desc => "Where FileBucket files are stored." }, :rest_authconfig => { :default => "$confdir/auth.conf", :type => :file, :desc => "The configuration file that defines the rights to the different rest indirections. This can be used as a fine-grained authorization system for `puppet master`.", }, :ca => { :default => true, :type => :boolean, :desc => "Whether the master should function as a certificate authority.", }, :basemodulepath => { :default => "$confdir/modules#{File::PATH_SEPARATOR}/usr/share/puppet/modules", :type => :path, :desc => "The search path for **global** modules. Should be specified as a list of directories separated by the system path separator character. (The POSIX path separator is ':', and the Windows path separator is ';'.) If you are using directory environments, these are the modules that will be used by _all_ environments. Note that the `modules` directory of the active environment will have priority over any global directories. For more info, see http://docs.puppetlabs.com/puppet/latest/reference/environments.html This setting also provides the default value for the deprecated `modulepath` setting, which is used when directory environments are disabled.", }, :modulepath => { :default => "$basemodulepath", :type => :path, :desc => "The search path for modules, as a list of directories separated by the system path separator character. (The POSIX path separator is ':', and the Windows path separator is ';'.) Setting a global value for `modulepath` in puppet.conf is deprecated. Please use directory environments instead. If you need to use something other than the default modulepath of `:$basemodulepath`, you can set `modulepath` in environment.conf. For more info, see http://docs.puppetlabs.com/puppet/latest/reference/environments.html", :deprecated => :allowed_on_commandline, }, :ssl_client_header => { :default => "HTTP_X_CLIENT_DN", :desc => "The header containing an authenticated client's SSL DN. This header must be set by the proxy to the authenticated client's SSL DN (e.g., `/CN=puppet.puppetlabs.com`). Puppet will parse out the Common Name (CN) from the Distinguished Name (DN) and use the value of the CN field for authorization. Note that the name of the HTTP header gets munged by the web server common gateway inteface: an `HTTP_` prefix is added, dashes are converted to underscores, and all letters are uppercased. Thus, to use the `X-Client-DN` header, this setting should be `HTTP_X_CLIENT_DN`.", }, :ssl_client_verify_header => { :default => "HTTP_X_CLIENT_VERIFY", :desc => "The header containing the status message of the client verification. This header must be set by the proxy to 'SUCCESS' if the client successfully authenticated, and anything else otherwise. Note that the name of the HTTP header gets munged by the web server common gateway inteface: an `HTTP_` prefix is added, dashes are converted to underscores, and all letters are uppercased. Thus, to use the `X-Client-Verify` header, this setting should be `HTTP_X_CLIENT_VERIFY`.", }, # To make sure this directory is created before we try to use it on the server, we need # it to be in the server section (#1138). :yamldir => { :default => "$vardir/yaml", :type => :directory, :owner => "service", :group => "service", :mode => "0750", :desc => "The directory in which YAML data is stored, usually in a subdirectory."}, :server_datadir => { :default => "$vardir/server_data", :type => :directory, :owner => "service", :group => "service", :mode => "0750", :desc => "The directory in which serialized data is stored, usually in a subdirectory."}, :reports => { :default => "store", :desc => "The list of report handlers to use. When using multiple report handlers, their names should be comma-separated, with whitespace allowed. (For example, `reports = http, tagmail`.) This setting is relevant to puppet master and puppet apply. The puppet master will call these report handlers with the reports it receives from agent nodes, and puppet apply will call them with its own report. (In all cases, the node applying the catalog must have `report = true`.) See the report reference for information on the built-in report handlers; custom report handlers can also be loaded from modules. (Report handlers are loaded from the lib directory, at `puppet/reports/NAME.rb`.)", }, :reportdir => { :default => "$vardir/reports", :type => :directory, :mode => "0750", :owner => "service", :group => "service", :desc => "The directory in which to store reports. Each node gets a separate subdirectory in this directory. This setting is only used when the `store` report processor is enabled (see the `reports` setting)."}, :reporturl => { :default => "http://localhost:3000/reports/upload", :desc => "The URL that reports should be forwarded to. This setting is only used when the `http` report processor is enabled (see the `reports` setting).", }, :fileserverconfig => { :default => "$confdir/fileserver.conf", :type => :file, :desc => "Where the fileserver configuration is stored.", }, :strict_hostname_checking => { :default => false, :desc => "Whether to only search for the complete hostname as it is in the certificate when searching for node information in the catalogs.", } ) define_settings(:device, :devicedir => { :default => "$vardir/devices", :type => :directory, :mode => "0750", :desc => "The root directory of devices' $vardir.", }, :deviceconfig => { :default => "$confdir/device.conf", :desc => "Path to the device config file for puppet device.", } ) define_settings(:agent, :node_name_value => { :default => "$certname", :desc => "The explicit value used for the node name for all requests the agent makes to the master. WARNING: This setting is mutually exclusive with node_name_fact. Changing this setting also requires changes to the default auth.conf configuration on the Puppet Master. Please see http://links.puppetlabs.com/node_name_value for more information." }, :node_name_fact => { :default => "", :desc => "The fact name used to determine the node name used for all requests the agent makes to the master. WARNING: This setting is mutually exclusive with node_name_value. Changing this setting also requires changes to the default auth.conf configuration on the Puppet Master. Please see http://links.puppetlabs.com/node_name_fact for more information.", :hook => proc do |value| if !value.empty? and Puppet[:node_name_value] != Puppet[:certname] raise "Cannot specify both the node_name_value and node_name_fact settings" end end }, :localconfig => { :default => "$statedir/localconfig", :type => :file, :owner => "root", :mode => "0660", :desc => "Where puppet agent caches the local configuration. An extension indicating the cache format is added automatically."}, :statefile => { :default => "$statedir/state.yaml", :type => :file, :mode => "0660", :desc => "Where puppet agent and puppet master store state associated with the running configuration. In the case of puppet master, this file reflects the state discovered through interacting with clients." }, :clientyamldir => { :default => "$vardir/client_yaml", :type => :directory, :mode => "0750", :desc => "The directory in which client-side YAML data is stored." }, :client_datadir => { :default => "$vardir/client_data", :type => :directory, :mode => "0750", :desc => "The directory in which serialized data is stored on the client." }, :classfile => { :default => "$statedir/classes.txt", :type => :file, :owner => "root", :mode => "0640", :desc => "The file in which puppet agent stores a list of the classes associated with the retrieved configuration. Can be loaded in the separate `puppet` executable using the `--loadclasses` option."}, :resourcefile => { :default => "$statedir/resources.txt", :type => :file, :owner => "root", :mode => "0640", :desc => "The file in which puppet agent stores a list of the resources associated with the retrieved configuration." }, :puppetdlog => { :default => "$logdir/puppetd.log", :type => :file, :owner => "root", :mode => "0640", :desc => "The fallback log file. This is only used when the `--logdest` option is not specified AND Puppet is running on an operating system where both the POSIX syslog service and the Windows Event Log are unavailable. (Currently, no supported operating systems match that description.) Despite the name, both puppet agent and puppet master will use this file as the fallback logging destination. For control over logging destinations, see the `--logdest` command line option in the manual pages for puppet master, puppet agent, and puppet apply. You can see man pages by running `puppet --help`, or read them online at http://docs.puppetlabs.com/references/latest/man/." }, :server => { :default => "puppet", :desc => "The puppet master server to which the puppet agent should connect." }, :use_srv_records => { :default => false, :type => :boolean, :desc => "Whether the server will search for SRV records in DNS for the current domain.", }, :srv_domain => { :default => lambda { Puppet::Settings.domain_fact }, :desc => "The domain which will be queried to find the SRV records of servers to use.", }, :ignoreschedules => { :default => false, :type => :boolean, :desc => "Boolean; whether puppet agent should ignore schedules. This is useful for initial puppet agent runs.", }, :default_schedules => { :default => true, :type => :boolean, :desc => "Boolean; whether to generate the default schedule resources. Setting this to false is useful for keeping external report processors clean of skipped schedule resources.", }, :puppetport => { :default => 8139, :desc => "Which port puppet agent listens on.", }, :noop => { :default => false, :type => :boolean, :desc => "Whether to apply catalogs in noop mode, which allows Puppet to partially simulate a normal run. This setting affects puppet agent and puppet apply. When running in noop mode, Puppet will check whether each resource is in sync, like it does when running normally. However, if a resource attribute is not in the desired state (as declared in the catalog), Puppet will take no action, and will instead report the changes it _would_ have made. These simulated changes will appear in the report sent to the puppet master, or be shown on the console if running puppet agent or puppet apply in the foreground. The simulated changes will not send refresh events to any subscribing or notified resources, although Puppet will log that a refresh event _would_ have been sent. **Important note:** [The `noop` metaparameter](http://docs.puppetlabs.com/references/latest/metaparameter.html#noop) allows you to apply individual resources in noop mode, and will override the global value of the `noop` setting. This means a resource with `noop => false` _will_ be changed if necessary, even when running puppet agent with `noop = true` or `--noop`. (Conversely, a resource with `noop => true` will only be simulated, even when noop mode is globally disabled.)", }, :runinterval => { :default => "30m", :type => :duration, :desc => "How often puppet agent applies the catalog. Note that a runinterval of 0 means \"run continuously\" rather than \"never run.\" If you want puppet agent to never run, you should start it with the `--no-client` option. #{AS_DURATION}", }, :listen => { :default => false, :type => :boolean, :desc => "Whether puppet agent should listen for connections. If this is true, then puppet agent will accept incoming REST API requests, subject to the default ACLs and the ACLs set in the `rest_authconfig` file. Puppet agent can respond usefully to requests on the `run`, `certificate`, and `resource` endpoints.", }, :ca_server => { :default => "$server", :desc => "The server to use for certificate authority requests. It's a separate server because it cannot and does not need to horizontally scale.", }, :ca_port => { :default => "$masterport", :desc => "The port to use for the certificate authority.", }, :catalog_format => { :default => "", :desc => "(Deprecated for 'preferred_serialization_format') What format to use to dump the catalog. Only supports 'marshal' and 'yaml'. Only matters on the client, since it asks the server for a specific format.", :hook => proc { |value| if value Puppet.deprecation_warning "Setting 'catalog_format' is deprecated; use 'preferred_serialization_format' instead." Puppet.settings.override_default(:preferred_serialization_format, value) end } }, :preferred_serialization_format => { :default => "pson", :desc => "The preferred means of serializing ruby instances for passing over the wire. This won't guarantee that all instances will be serialized using this method, since not all classes can be guaranteed to support this format, but it will be used for all classes that support it.", }, :report_serialization_format => { :default => "pson", :type => :enum, :values => ["pson", "yaml"], :desc => "The serialization format to use when sending reports to the `report_server`. Possible values are `pson` and `yaml`. This setting affects puppet agent, but not puppet apply (which processes its own reports). This should almost always be set to `pson`. It can be temporarily set to `yaml` to let agents using this Puppet version connect to a puppet master running Puppet 3.0.0 through 3.2.x. Note that this is set to 'yaml' automatically if the agent detects an older master, so should never need to be set explicitly." }, :legacy_query_parameter_serialization => { :default => false, :type => :boolean, :desc => "The serialization format to use when sending file_metadata query parameters. Older versions of puppet master expect certain query parameters to be serialized as yaml, which is deprecated. This should almost always be false. It can be temporarily set to true to let agents using this Puppet version connect to a puppet master running Puppet 3.0.0 through 3.2.x. Note that this is set to true automatically if the agent detects an older master, so should never need to be set explicitly." }, :agent_catalog_run_lockfile => { :default => "$statedir/agent_catalog_run.lock", :type => :string, # (#2888) Ensure this file is not added to the settings catalog. :desc => "A lock file to indicate that a puppet agent catalog run is currently in progress. The file contains the pid of the process that holds the lock on the catalog run.", }, :agent_disabled_lockfile => { :default => "$statedir/agent_disabled.lock", :type => :file, :desc => "A lock file to indicate that puppet agent runs have been administratively disabled. File contains a JSON object with state information.", }, :usecacheonfailure => { :default => true, :type => :boolean, :desc => "Whether to use the cached configuration when the remote configuration will not compile. This option is useful for testing new configurations, where you want to fix the broken configuration rather than reverting to a known-good one.", }, :use_cached_catalog => { :default => false, :type => :boolean, :desc => "Whether to only use the cached catalog rather than compiling a new catalog on every run. Puppet can be run with this enabled by default and then selectively disabled when a recompile is desired.", }, :ignoremissingtypes => { :default => false, :type => :boolean, :desc => "Skip searching for classes and definitions that were missing during a prior compilation. The list of missing objects is maintained per-environment and persists until the environment is cleared or the master is restarted.", }, :ignorecache => { :default => false, :type => :boolean, :desc => "Ignore cache and always recompile the configuration. This is useful for testing new configurations, where the local cache may in fact be stale even if the timestamps are up to date - if the facts change or if the server changes.", }, :dynamicfacts => { :default => "memorysize,memoryfree,swapsize,swapfree", :desc => "(Deprecated) Facts that are dynamic; these facts will be ignored when deciding whether changed facts should result in a recompile. Multiple facts should be comma-separated.", :hook => proc { |value| if value Puppet.deprecation_warning "The dynamicfacts setting is deprecated and will be ignored." end } }, :splaylimit => { :default => "$runinterval", :type => :duration, :desc => "The maximum time to delay before runs. Defaults to being the same as the run interval. #{AS_DURATION}", }, :splay => { :default => false, :type => :boolean, :desc => "Whether to sleep for a pseudo-random (but consistent) amount of time before a run.", }, :clientbucketdir => { :default => "$vardir/clientbucket", :type => :directory, :mode => "0750", :desc => "Where FileBucket files are stored locally." }, :configtimeout => { :default => "2m", :type => :duration, :desc => "How long the client should wait for the configuration to be retrieved before considering it a failure. This can help reduce flapping if too many clients contact the server at one time. #{AS_DURATION}", }, :report_server => { :default => "$server", :desc => "The server to send transaction reports to.", }, :report_port => { :default => "$masterport", :desc => "The port to communicate with the report_server.", }, :report => { :default => true, :type => :boolean, :desc => "Whether to send reports after every transaction.", }, :lastrunfile => { :default => "$statedir/last_run_summary.yaml", :type => :file, :mode => "0644", :desc => "Where puppet agent stores the last run report summary in yaml format." }, :lastrunreport => { :default => "$statedir/last_run_report.yaml", :type => :file, :mode => "0640", :desc => "Where puppet agent stores the last run report in yaml format." }, :graph => { :default => false, :type => :boolean, :desc => "Whether to create dot graph files for the different configuration graphs. These dot files can be interpreted by tools like OmniGraffle or dot (which is part of ImageMagick).", }, :graphdir => { :default => "$statedir/graphs", :type => :directory, :desc => "Where to store dot-outputted graphs.", }, :http_compression => { :default => false, :type => :boolean, :desc => "Allow http compression in REST communication with the master. This setting might improve performance for agent -> master communications over slow WANs. Your puppet master needs to support compression (usually by activating some settings in a reverse-proxy in front of the puppet master, which rules out webrick). It is harmless to activate this settings if your master doesn't support compression, but if it supports it, this setting might reduce performance on high-speed LANs.", }, :waitforcert => { :default => "2m", :type => :duration, :desc => "How frequently puppet agent should ask for a signed certificate. When starting for the first time, puppet agent will submit a certificate signing request (CSR) to the server named in the `ca_server` setting (usually the puppet master); this may be autosigned, or may need to be approved by a human, depending on the CA server's configuration. Puppet agent cannot apply configurations until its approved certificate is available. Since the certificate may or may not be available immediately, puppet agent will repeatedly try to fetch it at this interval. You can turn off waiting for certificates by specifying a time of 0, in which case puppet agent will exit if it cannot get a cert. #{AS_DURATION}", }, :ordering => { :type => :enum, :values => ["manifest", "title-hash", "random"], :default => "manifest", :desc => "How unrelated resources should be ordered when applying a catalog. Allowed values are `title-hash`, `manifest`, and `random`. This setting affects puppet agent and puppet apply, but not puppet master. * `title-hash` (the default) will order resources randomly, but will use the same order across runs and across nodes. * `manifest` will use the order in which the resources were declared in their manifest files. * `random` will order resources randomly and change their order with each run. This can work like a fuzzer for shaking out undeclared dependencies. Regardless of this setting's value, Puppet will always obey explicit dependencies set with the before/require/notify/subscribe metaparameters and the `->`/`~>` chaining arrows; this setting only affects the relative ordering of _unrelated_ resources." } ) define_settings(:inspect, :archive_files => { :type => :boolean, :default => false, :desc => "During an inspect run, whether to archive files whose contents are audited to a file bucket.", }, :archive_file_server => { :default => "$server", :desc => "During an inspect run, the file bucket server to archive files to if archive_files is set.", } ) # Plugin information. define_settings( :main, :plugindest => { :type => :directory, :default => "$libdir", :desc => "Where Puppet should store plugins that it pulls down from the central server.", }, :pluginsource => { :default => "puppet://$server/plugins", :desc => "From where to retrieve plugins. The standard Puppet `file` type is used for retrieval, so anything that is a valid file source can be used here.", }, :pluginfactdest => { :type => :directory, :default => "$vardir/facts.d", :desc => "Where Puppet should store external facts that are being handled by pluginsync", }, :pluginfactsource => { :default => "puppet://$server/pluginfacts", :desc => "Where to retrieve external facts for pluginsync", }, :pluginsync => { :default => true, :type => :boolean, :desc => "Whether plugins should be synced with the central server.", }, :pluginsignore => { :default => ".svn CVS .git", :desc => "What files to ignore when pulling down plugins.", } ) # Central fact information. define_settings( :main, :factpath => { :type => :path, :default => "$vardir/lib/facter#{File::PATH_SEPARATOR}$vardir/facts", :desc => "Where Puppet should look for facts. Multiple directories should be separated by the system path separator character. (The POSIX path separator is ':', and the Windows path separator is ';'.)", :call_hook => :on_initialize_and_write, # Call our hook with the default value, so we always get the value added to facter. :hook => proc do |value| paths = value.split(File::PATH_SEPARATOR) Facter.search(*paths) end } ) define_settings( :tagmail, :tagmap => { :default => "$confdir/tagmail.conf", :desc => "The mapping between reporting tags and email addresses.", }, :sendmail => { :default => which('sendmail') || '', :desc => "Where to find the sendmail binary with which to send email.", }, :reportfrom => { :default => lambda { "report@#{Puppet::Settings.default_certname.downcase}" }, :desc => "The 'from' email address for the reports.", }, :smtpserver => { :default => "none", :desc => "The server through which to send email reports.", }, :smtpport => { :default => 25, :desc => "The TCP port through which to send email reports.", }, :smtphelo => { :default => lambda { Facter.value 'fqdn' }, :desc => "The name by which we identify ourselves in SMTP HELO for reports. If you send to a smtpserver which does strict HELO checking (as with Postfix's `smtpd_helo_restrictions` access controls), you may need to ensure this resolves.", } ) define_settings( :rails, :dblocation => { :default => "$statedir/clientconfigs.sqlite3", :type => :file, :mode => "0660", :owner => "service", :group => "service", :desc => "The sqlite database file. #{STORECONFIGS_ONLY}" }, :dbadapter => { :default => "sqlite3", :desc => "The type of database to use. #{STORECONFIGS_ONLY}", }, :dbmigrate => { :default => false, :type => :boolean, :desc => "Whether to automatically migrate the database. #{STORECONFIGS_ONLY}", }, :dbname => { :default => "puppet", :desc => "The name of the database to use. #{STORECONFIGS_ONLY}", }, :dbserver => { :default => "localhost", :desc => "The database server for caching. Only used when networked databases are used.", }, :dbport => { :default => "", :desc => "The database password for caching. Only used when networked databases are used. #{STORECONFIGS_ONLY}", }, :dbuser => { :default => "puppet", :desc => "The database user for caching. Only used when networked databases are used. #{STORECONFIGS_ONLY}", }, :dbpassword => { :default => "puppet", :desc => "The database password for caching. Only used when networked databases are used. #{STORECONFIGS_ONLY}", }, :dbconnections => { :default => '', :desc => "The number of database connections for networked databases. Will be ignored unless the value is a positive integer. #{STORECONFIGS_ONLY}", }, :dbsocket => { :default => "", :desc => "The database socket location. Only used when networked databases are used. Will be ignored if the value is an empty string. #{STORECONFIGS_ONLY}", }, :railslog => { :default => "$logdir/rails.log", :type => :file, :mode => "0600", :owner => "service", :group => "service", :desc => "Where Rails-specific logs are sent. #{STORECONFIGS_ONLY}" }, :rails_loglevel => { :default => "info", :desc => "The log level for Rails connections. The value must be a valid log level within Rails. Production environments normally use `info` and other environments normally use `debug`. #{STORECONFIGS_ONLY}", } ) define_settings( :transaction, :tags => { :default => "", :desc => "Tags to use to find resources. If this is set, then only resources tagged with the specified tags will be applied. Values must be comma-separated.", }, :evaltrace => { :default => false, :type => :boolean, :desc => "Whether each resource should log when it is being evaluated. This allows you to interactively see exactly what is being done.", }, :summarize => { :default => false, :type => :boolean, :desc => "Whether to print a transaction summary.", } ) define_settings( :main, :external_nodes => { :default => "none", :desc => "An external command that can produce node information. The command's output must be a YAML dump of a hash, and that hash must have a `classes` key and/or a `parameters` key, where `classes` is an array or hash and `parameters` is a hash. For unknown nodes, the command should exit with a non-zero exit code. This command makes it straightforward to store your node mapping information in other data sources like databases.", } ) define_settings( :ldap, :ldapssl => { :default => false, :type => :boolean, :desc => "Whether SSL should be used when searching for nodes. Defaults to false because SSL usually requires certificates to be set up on the client side.", }, :ldaptls => { :default => false, :type => :boolean, :desc => "Whether TLS should be used when searching for nodes. Defaults to false because TLS usually requires certificates to be set up on the client side.", }, :ldapserver => { :default => "ldap", :desc => "The LDAP server. Only used if `node_terminus` is set to `ldap`.", }, :ldapport => { :default => 389, :desc => "The LDAP port. Only used if `node_terminus` is set to `ldap`.", }, :ldapstring => { :default => "(&(objectclass=puppetClient)(cn=%s))", :desc => "The search string used to find an LDAP node.", }, :ldapclassattrs => { :default => "puppetclass", :desc => "The LDAP attributes to use to define Puppet classes. Values should be comma-separated.", }, :ldapstackedattrs => { :default => "puppetvar", :desc => "The LDAP attributes that should be stacked to arrays by adding the values in all hierarchy elements of the tree. Values should be comma-separated.", }, :ldapattrs => { :default => "all", :desc => "The LDAP attributes to include when querying LDAP for nodes. All returned attributes are set as variables in the top-level scope. Multiple values should be comma-separated. The value 'all' returns all attributes.", }, :ldapparentattr => { :default => "parentnode", :desc => "The attribute to use to define the parent node.", }, :ldapuser => { :default => "", :desc => "The user to use to connect to LDAP. Must be specified as a full DN.", }, :ldappassword => { :default => "", :desc => "The password to use to connect to LDAP.", }, :ldapbase => { :default => "", :desc => "The search base for LDAP searches. It's impossible to provide a meaningful default here, although the LDAP libraries might have one already set. Generally, it should be the 'ou=Hosts' branch under your main directory.", } ) define_settings(:master, :storeconfigs => { :default => false, :type => :boolean, :desc => "Whether to store each client's configuration, including catalogs, facts, and related data. This also enables the import and export of resources in the Puppet language - a mechanism for exchange resources between nodes. By default this uses ActiveRecord and an SQL database to store and query the data; this, in turn, will depend on Rails being available. You can adjust the backend using the storeconfigs_backend setting.", # Call our hook with the default value, so we always get the libdir set. :call_hook => :on_initialize_and_write, :hook => proc do |value| require 'puppet/node' require 'puppet/node/facts' if value - if not Puppet.settings[:async_storeconfigs] - Puppet::Resource::Catalog.indirection.cache_class = :store_configs - Puppet.settings.override_default(:catalog_cache_terminus, :store_configs) - end + Puppet::Resource::Catalog.indirection.cache_class = :store_configs + Puppet.settings.override_default(:catalog_cache_terminus, :store_configs) Puppet::Node::Facts.indirection.cache_class = :store_configs - Puppet::Resource.indirection.terminus_class = :store_configs end end }, :storeconfigs_backend => { :type => :terminus, :default => "active_record", :desc => "Configure the backend terminus used for StoreConfigs. By default, this uses the ActiveRecord store, which directly talks to the database from within the Puppet Master process." } ) define_settings(:parser, :templatedir => { :default => "$vardir/templates", :type => :directory, :desc => "Where Puppet looks for template files. Can be a list of colon-separated directories. This setting is deprecated. Please put your templates in modules instead.", :deprecated => :completely, }, :allow_variables_with_dashes => { :default => false, :desc => <<-'EOT' Permit hyphens (`-`) in variable names and issue deprecation warnings about them. This setting **should always be `false`;** setting it to `true` will cause subtle and wide-ranging bugs. It will be removed in a future version. Hyphenated variables caused major problems in the language, but were allowed between Puppet 2.7.3 and 2.7.14. If you used them during this window, we apologize for the inconvenience --- you can temporarily set this to `true` in order to upgrade, and can rename your variables at your leisure. Please revert it to `false` after you have renamed all affected variables. EOT }, :parser => { :default => "current", :desc => <<-'EOT' Selects the parser to use for parsing puppet manifests (in puppet DSL language/'.pp' files). Available choices are `current` (the default) and `future`. The `current` parser means that the released version of the parser should be used. The `future` parser is a "time travel to the future" allowing early exposure to new language features. What these features are will vary from release to release and they may be invididually configurable. Available Since Puppet 3.2. EOT }, :max_errors => { :default => 10, :desc => <<-'EOT' Sets the max number of logged/displayed parser validation errors in case multiple errors have been detected. A value of 0 is the same as a value of 1; a minimum of one error is always raised. The count is per manifest. EOT }, :max_warnings => { :default => 10, :desc => <<-'EOT' Sets the max number of logged/displayed parser validation warnings in case multiple warnings have been detected. A value of 0 blocks logging of warnings. The count is per manifest. EOT }, :max_deprecations => { :default => 10, :desc => <<-'EOT' Sets the max number of logged/displayed parser validation deprecation warnings in case multiple deprecation warnings have been detected. A value of 0 blocks the logging of deprecation warnings. The count is per manifest. EOT }, :strict_variables => { :default => false, :type => :boolean, :desc => <<-'EOT' Makes the parser raise errors when referencing unknown variables. (This does not affect referencing variables that are explicitly set to undef). EOT } ) define_settings(:puppetdoc, :document_all => { :default => false, :type => :boolean, :desc => "Whether to document all resources when using `puppet doc` to generate manifest documentation.", } ) end diff --git a/lib/puppet/feature/stomp.rb b/lib/puppet/feature/stomp.rb deleted file mode 100644 index 01fb1be3e..000000000 --- a/lib/puppet/feature/stomp.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'puppet/util/feature' - -# We want this to load if possible, but it's not automatically -# required. -Puppet.features.add(:stomp, :libs => %{stomp}) diff --git a/lib/puppet/indirector/catalog/queue.rb b/lib/puppet/indirector/catalog/queue.rb deleted file mode 100644 index 51356526b..000000000 --- a/lib/puppet/indirector/catalog/queue.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'puppet/resource/catalog' -require 'puppet/indirector/queue' - -class Puppet::Resource::Catalog::Queue < Puppet::Indirector::Queue - - desc "Part of async storeconfigs, requiring the puppet queue daemon. ActiveRecord-based storeconfigs - and inventory are deprecated. See http://links.puppetlabs.com/activerecord-deprecation" - -end diff --git a/lib/puppet/indirector/queue.rb b/lib/puppet/indirector/queue.rb deleted file mode 100644 index 1d5776bdb..000000000 --- a/lib/puppet/indirector/queue.rb +++ /dev/null @@ -1,80 +0,0 @@ -require 'puppet/indirector/terminus' -require 'puppet/util/queue' -require 'puppet/util' - -# Implements the :queue abstract indirector terminus type, for storing -# model instances to a message queue, presumably for the purpose of out-of-process -# handling of changes related to the model. -# -# Relies upon Puppet::Util::Queue for registry and client object management, -# and specifies a default queue type of :stomp, appropriate for use with a variety of message brokers. -# -# It's up to the queue client type to instantiate itself correctly based on Puppet configuration information. -# -# A single queue client is maintained for the abstract terminus, meaning that you can only use one type -# of queue client, one message broker solution, etc., with the indirection mechanism. -# -# Per-indirection queues are assumed, based on the indirection name. If the :catalog indirection makes -# use of this :queue terminus, queue operations work against the "catalog" queue. It is up to the queue -# client library to handle queue creation as necessary (for a number of popular queuing solutions, queue -# creation is automatic and not a concern). -class Puppet::Indirector::Queue < Puppet::Indirector::Terminus - extend ::Puppet::Util::Queue - include Puppet::Util - - def initialize(*args) - super - end - - # Queue has no idiomatic "find" - def find(request) - nil - end - - # Place the request on the queue - def save(request) - result = nil - benchmark :info, "Queued #{indirection.name} for #{request.key}" do - result = client.publish_message(queue, request.instance.render(:pson)) - end - result - rescue => detail - msg = "Could not write #{request.key} to queue: #{detail}\nInstance::#{request.instance}\n client : #{client}" - raise Puppet::Error, msg, detail.backtrace - end - - def self.queue - indirection_name - end - - def queue - self.class.queue - end - - # Returns the singleton queue client object. - def client - self.class.client - end - - # converts the _message_ from deserialized format to an actual model instance. - def self.intern(message) - result = nil - benchmark :info, "Loaded queued #{indirection.name}" do - result = model.convert_from(:pson, message) - end - result - end - - # Provides queue subscription functionality; for a given indirection, use this method on the terminus - # to subscribe to the indirection-specific queue. Your _block_ will be executed per new indirection - # model received from the queue, with _obj_ being the model instance. - def self.subscribe - client.subscribe(queue) do |msg| - begin - yield(self.intern(msg)) - rescue => detail - Puppet.log_exception(detail, "Error occurred with subscription to queue #{queue} for indirection #{indirection_name}: #{detail}") - end - end - end -end diff --git a/lib/puppet/util/queue.rb b/lib/puppet/util/queue.rb deleted file mode 100644 index 636bdcf2e..000000000 --- a/lib/puppet/util/queue.rb +++ /dev/null @@ -1,96 +0,0 @@ - -require 'puppet/indirector' -require 'puppet/util/instance_loader' - -# Implements a message queue client type plugin registry for use by the indirector facility. -# Client modules for speaking a particular protocol (e.g. Stomp::Client for Stomp message -# brokers, Memcached for Starling and Sparrow, etc.) register themselves with this module. -# -# Client classes are expected to live under the Puppet::Util::Queue namespace and corresponding -# directory; the attempted use of a client via its typename (see below) will cause Puppet::Util::Queue -# to attempt to load the corresponding plugin if it is not yet loaded. The client class registers itself -# with Puppet::Util::Queue and should use the same type name as the autloader expects for the plugin file. -# class Puppet::Util::Queue::SpecialMagicalClient < Messaging::SpecialMagic -# ... -# Puppet::Util::Queue.register_queue_type_class(self) -# end -# -# This module reduces the rightmost segment of the class name into a pretty symbol that will -# serve as the queuing client's name. Which means that the "SpecialMagicalClient" above will -# be named :special_magical_client within the registry. -# -# Another class/module may mix-in this module, and may then make use of the registered clients. -# class Queue::Fue -# # mix it in at the class object level rather than instance level -# extend ::Puppet::Util::Queue -# end -# -# Queue::Fue instances can get a message queue client through the registry through the mixed-in method -# +client+, which will return a class-wide singleton client instance, determined by +client_class+. -# -# The client plugins are expected to implement an interface similar to that of Stomp::Client: -# * new should return a connected, ready-to-go client instance. Note that no arguments are passed in. -# * publish_message(queue, message) should publish the _message_ to the specified _queue_. -# * subscribe(queue) _block_ subscribes to _queue_ and executes _block_ upon receiving a message. -# * _queue_ names are simple names independent of the message broker or client library. No "/queue/" prefixes like in Stomp::Client. -module Puppet::Util::Queue - extend Puppet::Util::InstanceLoader - instance_load :queue_clients, 'puppet/util/queue' - - # Adds a new class/queue-type pair to the registry. The _type_ argument is optional; if not provided, - # _type_ defaults to a lowercased, underscored symbol programmatically derived from the rightmost - # namespace of klass.name. - # - # # register with default name +:you+ - # register_queue_type(Foo::You) - # - # # register with explicit queue type name +:myself+ - # register_queue_type(Foo::Me, :myself) - # - # If the type is already registered, an exception is thrown. No checking is performed of _klass_, - # however; a given class could be registered any number of times, as long as the _type_ differs with - # each registration. - def self.register_queue_type(klass, type = nil) - type ||= queue_type_from_class(klass) - raise Puppet::Error, "Queue type #{type} is already registered" if instance_hash(:queue_clients).include?(type) - instance_hash(:queue_clients)[type] = klass - end - - # Given a queue type symbol, returns the associated +Class+ object. If the queue type is unknown - # (meaning it hasn't been registered with this module), an exception is thrown. - def self.queue_type_to_class(type) - c = loaded_instance :queue_clients, type - raise Puppet::Error, "Queue type #{type} is unknown." unless c - c - end - - # Given a class object _klass_, returns the programmatic default queue type name symbol for _klass_. - # The algorithm is as shown in earlier examples; the last namespace segment of _klass.name_ is taken - # and converted from mixed case to underscore-separated lowercase, and interned. - # queue_type_from_class(Foo) -> :foo - # queue_type_from_class(Foo::Too) -> :too - # queue_type_from_class(Foo::ForYouTwo) -> :for_you_too - # - # The implicit assumption here, consistent with Puppet's approach to plugins in general, - # is that all your client modules live in the same namespace, such that reduction to - # a flat namespace of symbols is reasonably safe. - def self.queue_type_from_class(klass) - # convert last segment of classname from studly caps to lower case with underscores, and symbolize - klass.name.split('::').pop.sub(/^[A-Z]/) {|c| c.downcase}.gsub(/[A-Z]/) {|c| '_' + c.downcase }.intern - end - - # The class object for the client to be used, determined by queue configuration - # settings. - # Looks to the :queue_type configuration entry in the running application for - # the default queue type to use. - def client_class - Puppet::Util::Queue.queue_type_to_class(Puppet[:queue_type]) - end - - # Returns (instantiating as necessary) the singleton queue client instance, according to the - # client_class. No arguments go to the client class constructor, meaning its up to the client class - # to know how to determine its queue message source (presumably through Puppet configuration data). - def client - @client ||= client_class.new - end -end diff --git a/lib/puppet/util/queue/stomp.rb b/lib/puppet/util/queue/stomp.rb deleted file mode 100644 index 4ed91e1e9..000000000 --- a/lib/puppet/util/queue/stomp.rb +++ /dev/null @@ -1,60 +0,0 @@ -require 'puppet/util/queue' -require 'stomp' -require 'uri' - -# Implements the Ruby Stomp client as a queue type within the -# Puppet::Indirector::Queue::Client registry, for use with the :queue -# indirection terminus type. -# -# Looks to Puppet[:queue_source] for the sole argument to the -# underlying Stomp::Client constructor; consequently, for this client to work, -# Puppet[:queue_source] must use the Stomp::Client URL-like syntax -# for identifying the Stomp message broker: login:pass@host.port -class Puppet::Util::Queue::Stomp - attr_accessor :stomp_client - - def initialize - begin - uri = URI.parse(Puppet[:queue_source]) - rescue => detail - raise ArgumentError, "Could not create Stomp client instance - queue source #{Puppet[:queue_source]} is invalid: #{detail}", detail.backtrace - end - unless uri.scheme == "stomp" - raise ArgumentError, "Could not create Stomp client instance - queue source #{Puppet[:queue_source]} is not a Stomp URL: #{detail}" - end - - begin - self.stomp_client = Stomp::Client.new(uri.user, uri.password, uri.host, uri.port, true) - rescue => detail - raise ArgumentError, "Could not create Stomp client instance with queue source #{Puppet[:queue_source]}: got internal Stomp client error #{detail}", detail.backtrace - end - - # Identify the supported method for sending messages. - @method = - case - when stomp_client.respond_to?(:publish) - :publish - when stomp_client.respond_to?(:send) - :send - else - raise ArgumentError, "STOMP client does not respond to either publish or send" - end - end - - def publish_message(target, msg) - stomp_client.__send__(@method, stompify_target(target), msg, :persistent => true) - end - - def subscribe(target) - stomp_client.subscribe(stompify_target(target), :ack => :client) do |stomp_message| - yield(stomp_message.body) - stomp_client.acknowledge(stomp_message) - end - end - - def stompify_target(target) - '/queue/' + target.to_s - end - - Puppet::Util::Queue.register_queue_type(self, :stomp) -end diff --git a/man/man5/puppet.conf.5 b/man/man5/puppet.conf.5 index 43927fbcf..f653f8c4d 100644 --- a/man/man5/puppet.conf.5 +++ b/man/man5/puppet.conf.5 @@ -1,2052 +1,2028 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "PUPPETCONF" "5" "September 2014" "Puppet Labs, LLC" "Puppet manual" -\fBThis page is autogenerated; any changes will get overwritten\fR \fI(last generated on 2014\-09\-15 12:02:46 \-0700)\fR +\fBThis page is autogenerated; any changes will get overwritten\fR \fI(last generated on 2014\-09\-16 20:41:04 \-0700)\fR . .SH "Configuration Settings" . .IP "\(bu" 4 Each of these settings can be specified in \fBpuppet\.conf\fR or on the command line\. . .IP "\(bu" 4 When using boolean settings on the command line, use \fB\-\-setting\fR and \fB\-\-no\-setting\fR instead of \fB\-\-setting (true|false)\fR\. . .IP "\(bu" 4 Settings can be interpolated as \fB$variables\fR in other settings; \fB$environment\fR is special, in that puppet master will interpolate each agent node\'s environment instead of its own\. . .IP "\(bu" 4 Multiple values should be specified as comma\-separated lists; multiple directories should be separated with the system path separator (usually a colon)\. . .IP "\(bu" 4 Settings that represent time intervals should be specified in duration format: an integer immediately followed by one of the units \'y\' (years of 365 days), \'d\' (days), \'h\' (hours), \'m\' (minutes), or \'s\' (seconds)\. The unit cannot be combined with other units, and defaults to seconds when omitted\. Examples are \'3600\' which is equivalent to \'1h\' (one hour), and \'1825d\' which is equivalent to \'5y\' (5 years)\. . .IP "\(bu" 4 Settings that take a single file or directory can optionally set the owner, group, and mode for their value: \fBrundir = $vardir/run { owner = puppet, group = puppet, mode = 644 }\fR . .IP "\(bu" 4 The Puppet executables will ignore any setting that isn\'t relevant to their function\. . .IP "" 0 . .P See the configuration guide \fIhttp://docs\.puppetlabs\.com/guides/configuring\.html\fR for more details\. . .SS "agent_catalog_run_lockfile" A lock file to indicate that a puppet agent catalog run is currently in progress\. The file contains the pid of the process that holds the lock on the catalog run\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/agent_catalog_run\.lock . .IP "" 0 . .SS "agent_disabled_lockfile" A lock file to indicate that puppet agent runs have been administratively disabled\. File contains a JSON object with state information\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/agent_disabled\.lock . .IP "" 0 . .SS "allow_duplicate_certs" Whether to allow a new certificate request to overwrite an existing certificate\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "allow_variables_with_dashes" Permit hyphens (\fB\-\fR) in variable names and issue deprecation warnings about them\. This setting \fBshould always be \fBfalse\fR;\fR setting it to \fBtrue\fR will cause subtle and wide\-ranging bugs\. It will be removed in a future version\. . .P Hyphenated variables caused major problems in the language, but were allowed between Puppet 2\.7\.3 and 2\.7\.14\. If you used them during this window, we apologize for the inconvenience \-\-\- you can temporarily set this to \fBtrue\fR in order to upgrade, and can rename your variables at your leisure\. Please revert it to \fBfalse\fR after you have renamed all affected variables\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "always_cache_features" Affects how we cache attempts to load Puppet \'features\'\. If false, then calls to \fBPuppet\.features\.?\fR will always attempt to load the feature (which can be an expensive operation) unless it has already been loaded successfully\. This makes it possible for a single agent run to, e\.g\., install a package that provides the underlying capabilities for a feature, and then later load that feature during the same run (even if the feature had been tested earlier and had not been available)\. . .P If this setting is set to true, then features will only be checked once, and if they are not available, the negative result is cached and returned for all subsequent attempts to load the feature\. This behavior is almost always appropriate for the server, and can result in a significant performance improvement for features that are checked frequently\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "archive_file_server" During an inspect run, the file bucket server to archive files to if archive_files is set\. . .IP "\(bu" 4 \fIDefault\fR: $server . .IP "" 0 . .SS "archive_files" During an inspect run, whether to archive files whose contents are audited to a file bucket\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . -.SS "async_storeconfigs" -Whether to use a queueing system to provide asynchronous database integration\. Requires that \fBpuppet queue\fR be running\. -. -.IP "\(bu" 4 -\fIDefault\fR: false -. -.IP "" 0 -. .SS "autoflush" Whether log files should always flush to disk\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "autosign" Whether (and how) to autosign certificate requests\. This setting is only relevant on a puppet master acting as a certificate authority (CA)\. . .P Valid values are true (autosigns all certificate requests; not recommended), false (disables autosigning certificates), or the absolute path to a file\. . .P The file specified in this setting may be either a \fBconfiguration file\fR or a \fBcustom policy executable\.\fR Puppet will automatically determine what it is: If the Puppet user (see the \fBuser\fR setting) can execute the file, it will be treated as a policy executable; otherwise, it will be treated as a config file\. . .P If a custom policy executable is configured, the CA puppet master will run it every time it receives a CSR\. The executable will be passed the subject CN of the request \fIas a command line argument,\fR and the contents of the CSR in PEM format \fIon stdin\.\fR It should exit with a status of 0 if the cert should be autosigned and non\-zero if the cert should not be autosigned\. . .P If a certificate request is not autosigned, it will persist for review\. An admin user can use the \fBpuppet cert sign\fR command to manually sign it, or can delete the request\. . .P For info on autosign configuration files, see the guide to Puppet\'s config files \fIhttp://docs\.puppetlabs\.com/guides/configuring\.html\fR\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/autosign\.conf . .IP "" 0 . .SS "basemodulepath" The search path for \fBglobal\fR modules\. Should be specified as a list of directories separated by the system path separator character\. (The POSIX path separator is \':\', and the Windows path separator is \';\'\.) . .P If you are using directory environments, these are the modules that will be used by \fIall\fR environments\. Note that the \fBmodules\fR directory of the active environment will have priority over any global directories\. For more info, see http://docs\.puppetlabs\.com/puppet/latest/reference/environments\.html . .P This setting also provides the default value for the deprecated \fBmodulepath\fR setting, which is used when directory environments are disabled\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/modules:/usr/share/puppet/modules . .IP "" 0 . .SS "bindaddress" The address a listening server should bind to\. . .IP "\(bu" 4 \fIDefault\fR: 0\.0\.0\.0 . .IP "" 0 . .SS "binder" Turns the binding system on or off\. This includes bindings in modules\. The binding system aggregates data from modules and other locations and makes them available for lookup\. The binding system is experimental and any or all of it may change\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "binder_config" The binder configuration file\. Puppet reads this file on each request to configure the bindings system\. If set to nil (the default), a $confdir/binder_config\.yaml is optionally loaded\. If it does not exists, a default configuration is used\. If the setting :binding_config is specified, it must reference a valid and existing yaml file\. . .TP \fIDefault\fR: . .SS "bucketdir" Where FileBucket files are stored\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/bucket . .IP "" 0 . .SS "ca" Whether the master should function as a certificate authority\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "ca_name" The name to use the Certificate Authority certificate\. . .IP "\(bu" 4 \fIDefault\fR: Puppet CA: $certname . .IP "" 0 . .SS "ca_port" The port to use for the certificate authority\. . .IP "\(bu" 4 \fIDefault\fR: $masterport . .IP "" 0 . .SS "ca_server" The server to use for certificate authority requests\. It\'s a separate server because it cannot and does not need to horizontally scale\. . .IP "\(bu" 4 \fIDefault\fR: $server . .IP "" 0 . .SS "ca_ttl" The default TTL for new certificates\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 5y . .IP "" 0 . .SS "cacert" The CA certificate\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/ca_crt\.pem . .IP "" 0 . .SS "cacrl" The certificate revocation list (CRL) for the CA\. Will be used if present but otherwise ignored\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/ca_crl\.pem . .IP "" 0 . .SS "cadir" The root directory for the certificate authority\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/ca . .IP "" 0 . .SS "cakey" The CA private key\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/ca_key\.pem . .IP "" 0 . .SS "capass" Where the CA stores the password for the private key\. . .IP "\(bu" 4 \fIDefault\fR: $caprivatedir/ca\.pass . .IP "" 0 . .SS "caprivatedir" Where the CA stores private certificate information\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/private . .IP "" 0 . .SS "capub" The CA public key\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/ca_pub\.pem . .IP "" 0 . .SS "catalog_cache_terminus" How to store cached catalogs\. Valid values are \'json\', \'msgpack\' and \'yaml\'\. The agent application defaults to \'json\'\. . .TP \fIDefault\fR: . .SS "catalog_format" (Deprecated for \'preferred_serialization_format\') What format to use to dump the catalog\. Only supports \'marshal\' and \'yaml\'\. Only matters on the client, since it asks the server for a specific format\. . .SS "catalog_terminus" Where to get node catalogs\. This is useful to change if, for instance, you\'d like to pre\-compile catalogs and store them in memcached or some other easily\-accessed store\. . .IP "\(bu" 4 \fIDefault\fR: compiler . .IP "" 0 . .SS "cert_inventory" The inventory file\. This is a text file to which the CA writes a complete listing of all certificates\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/inventory\.txt . .IP "" 0 . .SS "certdir" The certificate directory\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/certs . .IP "" 0 . .SS "certdnsnames" The \fBcertdnsnames\fR setting is no longer functional, after CVE\-2011\-3872\. We ignore the value completely\. . .P For your own certificate request you can set \fBdns_alt_names\fR in the configuration and it will apply locally\. There is no configuration option to set DNS alt names, or any other \fBsubjectAltName\fR value, for another nodes certificate\. . .P Alternately you can use the \fB\-\-dns_alt_names\fR command line option to set the labels added while generating your own CSR\. . .SS "certificate_expire_warning" The window of time leading up to a certificate\'s expiration that a notification will be logged\. This applies to CA, master, and agent certificates\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 60d . .IP "" 0 . .SS "certificate_revocation" Whether certificate revocation should be supported by downloading a Certificate Revocation List (CRL) to all clients\. If enabled, CA chaining will almost definitely not work\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "certname" The name to use when handling certificates\. When a node requests a certificate from the CA puppet master, it uses the value of the \fBcertname\fR setting as its requested Subject CN\. . .P This is the name used when managing a node\'s permissions in auth\.conf \fIhttp://docs\.puppetlabs\.com/puppet/latest/reference/config_file_auth\.html\fR\. In most cases, it is also used as the node\'s name when matching node definitions \fIhttp://docs\.puppetlabs\.com/puppet/latest/reference/lang_node_definitions\.html\fR and requesting data from an ENC\. (This can be changed with the \fBnode_name_value\fR and \fBnode_name_fact\fR settings, although you should only do so if you have a compelling reason\.) . .P A node\'s certname is available in Puppet manifests as \fB$trusted[\'certname\']\fR\. (See Facts and Built\-In Variables \fIhttp://docs\.puppetlabs\.com/puppet/latest/reference/lang_facts_and_builtin_vars\.html\fR for more details\.) . .IP "\(bu" 4 For best compatibility, you should limit the value of \fBcertname\fR to only use letters, numbers, periods, underscores, and dashes\. (That is, it should match \fB/A[a\-z0\-9\._\-]+Z/\fR\.) . .IP "\(bu" 4 The special value \fBca\fR is reserved, and can\'t be used as the certname for a normal node\. . .IP "" 0 . .P Defaults to the node\'s fully qualified domain name\. . .IP "\(bu" 4 \fIDefault\fR: aparker\.corp\.puppetlabs\.net . .IP "" 0 . .SS "cfacter" Whether or not to use the native facter (cfacter) implementation instead of the Ruby one (facter)\. Defaults to false\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "classfile" The file in which puppet agent stores a list of the classes associated with the retrieved configuration\. Can be loaded in the separate \fBpuppet\fR executable using the \fB\-\-loadclasses\fR option\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/classes\.txt . .IP "" 0 . .SS "client_datadir" The directory in which serialized data is stored on the client\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/client_data . .IP "" 0 . .SS "clientbucketdir" Where FileBucket files are stored locally\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/clientbucket . .IP "" 0 . .SS "clientyamldir" The directory in which client\-side YAML data is stored\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/client_yaml . .IP "" 0 . .SS "code" Code to parse directly\. This is essentially only used by \fBpuppet\fR, and should only be set if you\'re writing your own Puppet executable\. . .SS "color" Whether to use colors when logging to the console\. Valid values are \fBansi\fR (equivalent to \fBtrue\fR), \fBhtml\fR, and \fBfalse\fR, which produces no color\. Defaults to false on Windows, as its console does not support ansi colors\. . .IP "\(bu" 4 \fIDefault\fR: ansi . .IP "" 0 . .SS "confdir" The main Puppet configuration directory\. The default for this setting is calculated based on the user\. If the process is running as root or the user that Puppet is supposed to run as, it defaults to a system directory, but if it\'s running as any other user, it defaults to being in the user\'s home directory\. . .IP "\(bu" 4 \fIDefault\fR: /etc/puppet . .IP "" 0 . .SS "config" The configuration file for the current puppet application\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/${config_file_name} . .IP "" 0 . .SS "config_file_name" The name of the puppet config file\. . .IP "\(bu" 4 \fIDefault\fR: puppet\.conf . .IP "" 0 . .SS "config_version" How to determine the configuration version\. By default, it will be the time that the configuration is parsed, but you can provide a shell script to override how the version is determined\. The output of this script will be added to every log message in the reports, allowing you to correlate changes on your hosts to the source version on the server\. . .P Setting a global value for config_version in puppet\.conf is deprecated\. Please set a per\-environment value in environment\.conf instead\. For more info, see http://docs\.puppetlabs\.com/puppet/latest/reference/environments\.html . .SS "configprint" Print the value of a specific configuration setting\. If the name of a setting is provided for this, then the value is printed and puppet exits\. Comma\-separate multiple values\. For a list of all values, specify \'all\'\. . .SS "configtimeout" How long the client should wait for the configuration to be retrieved before considering it a failure\. This can help reduce flapping if too many clients contact the server at one time\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 2m . .IP "" 0 . .SS "csr_attributes" An optional file containing custom attributes to add to certificate signing requests (CSRs)\. You should ensure that this file does not exist on your CA puppet master; if it does, unwanted certificate extensions may leak into certificates created with the \fBpuppet cert generate\fR command\. . .P If present, this file must be a YAML hash containing a \fBcustom_attributes\fR key and/or an \fBextension_requests\fR key\. The value of each key must be a hash, where each key is a valid OID and each value is an object that can be cast to a string\. . .P Custom attributes can be used by the CA when deciding whether to sign the certificate, but are then discarded\. Attribute OIDs can be any OID value except the standard CSR attributes (i\.e\. attributes described in RFC 2985 section 5\.4)\. This is useful for embedding a pre\-shared key for autosigning policy executables (see the \fBautosign\fR setting), often by using the \fB1\.2\.840\.113549\.1\.9\.7\fR ("challenge password") OID\. . .P Extension requests will be permanently embedded in the final certificate\. Extension OIDs must be in the "ppRegCertExt" (\fB1\.3\.6\.1\.4\.1\.34380\.1\.1\fR) or "ppPrivCertExt" (\fB1\.3\.6\.1\.4\.1\.34380\.1\.2\fR) OID arcs\. The ppRegCertExt arc is reserved for four of the most common pieces of data to embed: \fBpp_uuid\fR (\fB\.1\fR), \fBpp_instance_id\fR (\fB\.2\fR), \fBpp_image_name\fR (\fB\.3\fR), and \fBpp_preshared_key\fR (\fB\.4\fR) \-\-\- in the YAML file, these can be referred to by their short descriptive names instead of their full OID\. The ppPrivCertExt arc is unregulated, and can be used for site\-specific extensions\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/csr_attributes\.yaml . .IP "" 0 . .SS "csrdir" Where the CA stores certificate requests . .IP "\(bu" 4 \fIDefault\fR: $cadir/requests . .IP "" 0 . .SS "daemonize" Whether to send the process into the background\. This defaults to true on POSIX systems, and to false on Windows (where Puppet currently cannot daemonize)\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "data_binding_terminus" Where to retrive information about data\. . .IP "\(bu" 4 \fIDefault\fR: hiera . .IP "" 0 . .SS "dbadapter" The type of database to use\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: sqlite3 . .IP "" 0 . .SS "dbconnections" The number of database connections for networked databases\. Will be ignored unless the value is a positive integer\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .SS "dblocation" The sqlite database file\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/clientconfigs\.sqlite3 . .IP "" 0 . .SS "dbmigrate" Whether to automatically migrate the database\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "dbname" The name of the database to use\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: puppet . .IP "" 0 . .SS "dbpassword" The database password for caching\. Only used when networked databases are used\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: puppet . .IP "" 0 . .SS "dbport" The database password for caching\. Only used when networked databases are used\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .SS "dbserver" The database server for caching\. Only used when networked databases are used\. . .IP "\(bu" 4 \fIDefault\fR: localhost . .IP "" 0 . .SS "dbsocket" The database socket location\. Only used when networked databases are used\. Will be ignored if the value is an empty string\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .SS "dbuser" The database user for caching\. Only used when networked databases are used\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: puppet . .IP "" 0 . .SS "default_file_terminus" The default source for files if no server is given in a uri, e\.g\. puppet:///file\. The default of \fBrest\fR causes the file to be retrieved using the \fBserver\fR setting\. When running \fBapply\fR the default is \fBfile_server\fR, causing requests to be filled locally\. . .IP "\(bu" 4 \fIDefault\fR: rest . .IP "" 0 . .SS "default_manifest" The default main manifest for directory environments\. Any environment that doesn\'t set the \fBmanifest\fR setting in its \fBenvironment\.conf\fR file will use this manifest\. . .P This setting\'s value can be an absolute or relative path\. An absolute path will make all environments default to the same main manifest; a relative path will allow each environment to use its own manifest, and Puppet will resolve the path relative to each environment\'s main directory\. . .P In either case, the path can point to a single file or to a directory of manifests to be evaluated in alphabetical order\. . .IP "\(bu" 4 \fIDefault\fR: \./manifests . .IP "" 0 . .SS "default_schedules" Boolean; whether to generate the default schedule resources\. Setting this to false is useful for keeping external report processors clean of skipped schedule resources\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "deviceconfig" Path to the device config file for puppet device\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/device\.conf . .IP "" 0 . .SS "devicedir" The root directory of devices\' $vardir\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/devices . .IP "" 0 . .SS "diff" Which diff command to use when printing differences between files\. This setting has no default value on Windows, as standard \fBdiff\fR is not available, but Puppet can use many third\-party diff tools\. . .IP "\(bu" 4 \fIDefault\fR: diff . .IP "" 0 . .SS "diff_args" Which arguments to pass to the diff command when printing differences between files\. The command to use can be chosen with the \fBdiff\fR setting\. . .IP "\(bu" 4 \fIDefault\fR: \-u . .IP "" 0 . .SS "digest_algorithm" Which digest algorithm to use for file resources and the filebucket\. Valid values are md5, sha256\. Default is md5\. . .IP "\(bu" 4 \fIDefault\fR: md5 . .IP "" 0 . .SS "disable_per_environment_manifest" Whether to disallow an environment\-specific main manifest\. When set to \fBtrue\fR, Puppet will use the manifest specified in the \fBdefault_manifest\fR setting for all environments\. If an environment specifies a different main manifest in its \fBenvironment\.conf\fR file, catalog requests for that environment will fail with an error\. . .P This setting requires \fBdefault_manifest\fR to be set to an absolute path\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "disable_warnings" A comma\-separated list of warning types to suppress\. If large numbers of warnings are making Puppet\'s logs too large or difficult to use, you can temporarily silence them with this setting\. . .P If you are preparing to upgrade Puppet to a new major version, you should re\-enable all warnings for a while\. . .P Valid values for this setting are: . .IP "\(bu" 4 \fBdeprecations\fR \-\-\- disables deprecation warnings\. . .IP "\(bu" 4 \fIDefault\fR: [] . .IP "" 0 . .SS "dns_alt_names" The comma\-separated list of alternative DNS names to use for the local host\. . .P When the node generates a CSR for itself, these are added to the request as the desired \fBsubjectAltName\fR in the certificate: additional DNS labels that the certificate is also valid answering as\. . .P This is generally required if you use a non\-hostname \fBcertname\fR, or if you want to use \fBpuppet kick\fR or \fBpuppet resource \-H\fR and the primary certname does not match the DNS name you use to communicate with the host\. . .P This is unnecessary for agents, unless you intend to use them as a server for \fBpuppet kick\fR or remote \fBpuppet resource\fR management\. . .P It is rarely necessary for servers; it is usually helpful only if you need to have a pool of multiple load balanced masters, or for the same master to respond on two physically separate networks under different names\. . .SS "document_all" Whether to document all resources when using \fBpuppet doc\fR to generate manifest documentation\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "dynamicfacts" (Deprecated) Facts that are dynamic; these facts will be ignored when deciding whether changed facts should result in a recompile\. Multiple facts should be comma\-separated\. . .IP "\(bu" 4 \fIDefault\fR: memorysize,memoryfree,swapsize,swapfree . .IP "" 0 . .SS "environment" The environment Puppet is running in\. For clients (e\.g\., \fBpuppet agent\fR) this determines the environment itself, which is used to find modules and much more\. For servers (i\.e\., \fBpuppet master\fR) this provides the default environment for nodes we know nothing about\. . .IP "\(bu" 4 \fIDefault\fR: production . .IP "" 0 . .SS "environment_timeout" The time to live for a cached environment\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. This setting can also be set to \fBunlimited\fR, which causes the environment to be cached until the master is restarted\. . .IP "\(bu" 4 \fIDefault\fR: unlimited . .IP "" 0 . .SS "environmentpath" A search path for directory environments, as a list of directories separated by the system path separator character\. (The POSIX path separator is \':\', and the Windows path separator is \';\'\.) . .P This setting must have a value set to enable \fBdirectory environments\.\fR The recommended value is \fB$confdir/environments\fR\. For more details, see http://docs\.puppetlabs\.com/puppet/latest/reference/environments\.html . .SS "evaltrace" Whether each resource should log when it is being evaluated\. This allows you to interactively see exactly what is being done\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "external_nodes" An external command that can produce node information\. The command\'s output must be a YAML dump of a hash, and that hash must have a \fBclasses\fR key and/or a \fBparameters\fR key, where \fBclasses\fR is an array or hash and \fBparameters\fR is a hash\. For unknown nodes, the command should exit with a non\-zero exit code\. . .P This command makes it straightforward to store your node mapping information in other data sources like databases\. . .IP "\(bu" 4 \fIDefault\fR: none . .IP "" 0 . .SS "factpath" Where Puppet should look for facts\. Multiple directories should be separated by the system path separator character\. (The POSIX path separator is \':\', and the Windows path separator is \';\'\.) . .IP "\(bu" 4 \fIDefault\fR: $vardir/lib/facter:$vardir/facts . .IP "" 0 . .SS "facts_terminus" The node facts terminus\. . .IP "\(bu" 4 \fIDefault\fR: facter . .IP "" 0 . .SS "fileserverconfig" Where the fileserver configuration is stored\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/fileserver\.conf . .IP "" 0 . .SS "filetimeout" The minimum time to wait between checking for updates in configuration files\. This timeout determines how quickly Puppet checks whether a file (such as manifests or templates) has changed on disk\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 15s . .IP "" 0 . .SS "forge_authorization" The authorization key to connect to the Puppet Forge\. Leave blank for unauthorized or license based connections . .TP \fIDefault\fR: . .SS "freeze_main" Freezes the \'main\' class, disallowing any code to be added to it\. This essentially means that you can\'t have any code outside of a node, class, or definition other than in the site manifest\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "genconfig" When true, causes Puppet applications to print an example config file to stdout and exit\. The example will include descriptions of each setting, and the current (or default) value of each setting, incorporating any settings overridden on the CLI (with the exception of \fBgenconfig\fR itself)\. This setting only makes sense when specified on the command line as \fB\-\-genconfig\fR\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "genmanifest" Whether to just print a manifest to stdout and exit\. Only makes sense when specified on the command line as \fB\-\-genmanifest\fR\. Takes into account arguments specified on the CLI\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "graph" Whether to create dot graph files for the different configuration graphs\. These dot files can be interpreted by tools like OmniGraffle or dot (which is part of ImageMagick)\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "graphdir" Where to store dot\-outputted graphs\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/graphs . .IP "" 0 . .SS "group" The group puppet master should run as\. . .IP "\(bu" 4 \fIDefault\fR: puppet . .IP "" 0 . .SS "hiera_config" The hiera configuration file\. Puppet only reads this file on startup, so you must restart the puppet master every time you edit it\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/hiera\.yaml . .IP "" 0 . .SS "hostcert" Where individual hosts store and look for their certificates\. . .IP "\(bu" 4 \fIDefault\fR: $certdir/$certname\.pem . .IP "" 0 . .SS "hostcrl" Where the host\'s certificate revocation list can be found\. This is distinct from the certificate authority\'s CRL\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/crl\.pem . .IP "" 0 . .SS "hostcsr" Where individual hosts store and look for their certificate requests\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/csr_$certname\.pem . .IP "" 0 . .SS "hostprivkey" Where individual hosts store and look for their private key\. . .IP "\(bu" 4 \fIDefault\fR: $privatekeydir/$certname\.pem . .IP "" 0 . .SS "hostpubkey" Where individual hosts store and look for their public key\. . .IP "\(bu" 4 \fIDefault\fR: $publickeydir/$certname\.pem . .IP "" 0 . .SS "http_compression" Allow http compression in REST communication with the master\. This setting might improve performance for agent \-> master communications over slow WANs\. Your puppet master needs to support compression (usually by activating some settings in a reverse\-proxy in front of the puppet master, which rules out webrick)\. It is harmless to activate this settings if your master doesn\'t support compression, but if it supports it, this setting might reduce performance on high\-speed LANs\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "http_debug" Whether to write HTTP request and responses to stderr\. This should never be used in a production environment\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "http_keepalive_timeout" The maximum amount of time a persistent HTTP connection can remain idle in the connection pool, before it is closed\. This timeout should be shorter than the keepalive timeout used on the HTTP server, e\.g\. Apache KeepAliveTimeout directive\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 4s . .IP "" 0 . .SS "http_proxy_host" The HTTP proxy host to use for outgoing connections\. Note: You may need to use a FQDN for the server hostname when using a proxy\. Environment variable http_proxy or HTTP_PROXY will override this value . .IP "\(bu" 4 \fIDefault\fR: none . .IP "" 0 . .SS "http_proxy_password" The password for the user of an authenticated HTTP proxy\. Requires the \fBhttp_proxy_user\fR setting\. . .P Note that passwords must be valid when used as part of a URL\. If a password contains any characters with special meanings in URLs (as specified by RFC 3986 section 2\.2), they must be URL\-encoded\. (For example, \fB#\fR would become \fB%23\fR\.) . .IP "\(bu" 4 \fIDefault\fR: none . .IP "" 0 . .SS "http_proxy_port" The HTTP proxy port to use for outgoing connections . .IP "\(bu" 4 \fIDefault\fR: 3128 . .IP "" 0 . .SS "http_proxy_user" The user name for an authenticated HTTP proxy\. Requires the \fBhttp_proxy_host\fR setting\. . .IP "\(bu" 4 \fIDefault\fR: none . .IP "" 0 . .SS "httplog" Where the puppet agent web server logs\. . .IP "\(bu" 4 \fIDefault\fR: $logdir/http\.log . .IP "" 0 . .SS "ignorecache" Ignore cache and always recompile the configuration\. This is useful for testing new configurations, where the local cache may in fact be stale even if the timestamps are up to date \- if the facts change or if the server changes\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "ignoreimport" If true, allows the parser to continue without requiring all files referenced with \fBimport\fR statements to exist\. This setting was primarily designed for use with commit hooks for parse\-checking\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "ignoremissingtypes" Skip searching for classes and definitions that were missing during a prior compilation\. The list of missing objects is maintained per\-environment and persists until the environment is cleared or the master is restarted\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "ignoreschedules" Boolean; whether puppet agent should ignore schedules\. This is useful for initial puppet agent runs\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "immutable_node_data" When true, also prevents $trusted and $facts from being overridden in any scope . .IP "\(bu" 4 \fIDefault\fR: $trusted_node_data . .IP "" 0 . .SS "keylength" The bit length of keys\. . .IP "\(bu" 4 \fIDefault\fR: 4096 . .IP "" 0 . .SS "lastrunfile" Where puppet agent stores the last run report summary in yaml format\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/last_run_summary\.yaml . .IP "" 0 . .SS "lastrunreport" Where puppet agent stores the last run report in yaml format\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/last_run_report\.yaml . .IP "" 0 . .SS "ldapattrs" The LDAP attributes to include when querying LDAP for nodes\. All returned attributes are set as variables in the top\-level scope\. Multiple values should be comma\-separated\. The value \'all\' returns all attributes\. . .IP "\(bu" 4 \fIDefault\fR: all . .IP "" 0 . .SS "ldapbase" The search base for LDAP searches\. It\'s impossible to provide a meaningful default here, although the LDAP libraries might have one already set\. Generally, it should be the \'ou=Hosts\' branch under your main directory\. . .SS "ldapclassattrs" The LDAP attributes to use to define Puppet classes\. Values should be comma\-separated\. . .IP "\(bu" 4 \fIDefault\fR: puppetclass . .IP "" 0 . .SS "ldapparentattr" The attribute to use to define the parent node\. . .IP "\(bu" 4 \fIDefault\fR: parentnode . .IP "" 0 . .SS "ldappassword" The password to use to connect to LDAP\. . .SS "ldapport" The LDAP port\. Only used if \fBnode_terminus\fR is set to \fBldap\fR\. . .IP "\(bu" 4 \fIDefault\fR: 389 . .IP "" 0 . .SS "ldapserver" The LDAP server\. Only used if \fBnode_terminus\fR is set to \fBldap\fR\. . .IP "\(bu" 4 \fIDefault\fR: ldap . .IP "" 0 . .SS "ldapssl" Whether SSL should be used when searching for nodes\. Defaults to false because SSL usually requires certificates to be set up on the client side\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "ldapstackedattrs" The LDAP attributes that should be stacked to arrays by adding the values in all hierarchy elements of the tree\. Values should be comma\-separated\. . .IP "\(bu" 4 \fIDefault\fR: puppetvar . .IP "" 0 . .SS "ldapstring" The search string used to find an LDAP node\. . .IP "\(bu" 4 \fIDefault\fR: (&(objectclass=puppetClient)(cn=%s)) . .IP "" 0 . .SS "ldaptls" Whether TLS should be used when searching for nodes\. Defaults to false because TLS usually requires certificates to be set up on the client side\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "ldapuser" The user to use to connect to LDAP\. Must be specified as a full DN\. . .SS "legacy_query_parameter_serialization" The serialization format to use when sending file_metadata query parameters\. Older versions of puppet master expect certain query parameters to be serialized as yaml, which is deprecated\. . .P This should almost always be false\. It can be temporarily set to true to let agents using this Puppet version connect to a puppet master running Puppet 3\.0\.0 through 3\.2\.x\. . .P Note that this is set to true automatically if the agent detects an older master, so should never need to be set explicitly\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "libdir" An extra search path for Puppet\. This is only useful for those files that Puppet will load on demand, and is only guaranteed to work for those cases\. In fact, the autoload mechanism is responsible for making sure this directory is in Ruby\'s search path . .IP "\(bu" 4 \fIDefault\fR: $vardir/lib . .IP "" 0 . .SS "listen" Whether puppet agent should listen for connections\. If this is true, then puppet agent will accept incoming REST API requests, subject to the default ACLs and the ACLs set in the \fBrest_authconfig\fR file\. Puppet agent can respond usefully to requests on the \fBrun\fR, \fBcertificate\fR, and \fBresource\fR endpoints\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "localcacert" Where each client stores the CA certificate\. . .IP "\(bu" 4 \fIDefault\fR: $certdir/ca\.pem . .IP "" 0 . .SS "localconfig" Where puppet agent caches the local configuration\. An extension indicating the cache format is added automatically\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/localconfig . .IP "" 0 . .SS "log_level" Default logging level for messages from Puppet\. Allowed values are: . .IP "\(bu" 4 debug . .IP "\(bu" 4 info . .IP "\(bu" 4 notice . .IP "\(bu" 4 warning . .IP "\(bu" 4 err . .IP "\(bu" 4 alert . .IP "\(bu" 4 emerg . .IP "\(bu" 4 crit . .IP "\(bu" 4 \fIDefault\fR: notice . .IP "" 0 . .SS "logdir" The directory in which to store log files . .TP \fIDefault\fR: . .SS "manage_internal_file_permissions" Whether Puppet should manage the owner, group, and mode of files it uses internally . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "manifest" The entry\-point manifest for puppet master\. This can be one file or a directory of manifests to be evaluated in alphabetical order\. Puppet manages this path as a directory if one exists or if the path ends with a / or \. . .P Setting a global value for \fBmanifest\fR in puppet\.conf is deprecated\. Please use directory environments instead\. If you need to use something other than the environment\'s \fBmanifests\fR directory as the main manifest, you can set \fBmanifest\fR in environment\.conf\. For more info, see http://docs\.puppetlabs\.com/puppet/latest/reference/environments\.html . .IP "\(bu" 4 \fIDefault\fR: $manifestdir/site\.pp . .IP "" 0 . .SS "manifestdir" Used to build the default value of the \fBmanifest\fR setting\. Has no other purpose\. . .P This setting is deprecated\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/manifests . .IP "" 0 . .SS "masterhttplog" Where the puppet master web server saves its access log\. This is only used when running a WEBrick puppet master\. When puppet master is running under a Rack server like Passenger, that web server will have its own logging behavior\. . .IP "\(bu" 4 \fIDefault\fR: $logdir/masterhttp\.log . .IP "" 0 . .SS "masterport" The port for puppet master traffic\. For puppet master, this is the port to listen on; for puppet agent, this is the port to make requests on\. Both applications use this setting to get the port\. . .IP "\(bu" 4 \fIDefault\fR: 8140 . .IP "" 0 . .SS "max_deprecations" Sets the max number of logged/displayed parser validation deprecation warnings in case multiple deprecation warnings have been detected\. A value of 0 blocks the logging of deprecation warnings\. The count is per manifest\. . .IP "\(bu" 4 \fIDefault\fR: 10 . .IP "" 0 . .SS "max_errors" Sets the max number of logged/displayed parser validation errors in case multiple errors have been detected\. A value of 0 is the same as a value of 1; a minimum of one error is always raised\. The count is per manifest\. . .IP "\(bu" 4 \fIDefault\fR: 10 . .IP "" 0 . .SS "max_warnings" Sets the max number of logged/displayed parser validation warnings in case multiple warnings have been detected\. A value of 0 blocks logging of warnings\. The count is per manifest\. . .IP "\(bu" 4 \fIDefault\fR: 10 . .IP "" 0 . .SS "maximum_uid" The maximum allowed UID\. Some platforms use negative UIDs but then ship with tools that do not know how to handle signed ints, so the UIDs show up as huge numbers that can then not be fed back into the system\. This is a hackish way to fail in a slightly more useful way when that happens\. . .IP "\(bu" 4 \fIDefault\fR: 4294967290 . .IP "" 0 . .SS "mkusers" Whether to create the necessary user and group that puppet agent will run as\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "module_groups" Extra module groups to request from the Puppet Forge . .TP \fIDefault\fR: . .SS "module_repository" The module repository . .IP "\(bu" 4 \fIDefault\fR: https://forgeapi\.puppetlabs\.com . .IP "" 0 . .SS "module_skeleton_dir" The directory which the skeleton for module tool generate is stored\. . .IP "\(bu" 4 \fIDefault\fR: $module_working_dir/skeleton . .IP "" 0 . .SS "module_working_dir" The directory into which module tool data is stored . .IP "\(bu" 4 \fIDefault\fR: $vardir/puppet\-module . .IP "" 0 . .SS "modulepath" The search path for modules, as a list of directories separated by the system path separator character\. (The POSIX path separator is \':\', and the Windows path separator is \';\'\.) . .P Setting a global value for \fBmodulepath\fR in puppet\.conf is deprecated\. Please use directory environments instead\. If you need to use something other than the default modulepath of \fB:$basemodulepath\fR, you can set \fBmodulepath\fR in environment\.conf\. For more info, see http://docs\.puppetlabs\.com/puppet/latest/reference/environments\.html . .IP "\(bu" 4 \fIDefault\fR: $basemodulepath . .IP "" 0 . .SS "name" The name of the application, if we are running as one\. The default is essentially $0 without the path or \fB\.rb\fR\. . .TP \fIDefault\fR: . .SS "node_cache_terminus" How to store cached nodes\. Valid values are (none), \'json\', \'msgpack\', \'yaml\' or write only yaml (\'write_only_yaml\')\. The master application defaults to \'write_only_yaml\', all others to none\. . .TP \fIDefault\fR: . .SS "node_name" How the puppet master determines the client\'s identity and sets the \'hostname\', \'fqdn\' and \'domain\' facts for use in the manifest, in particular for determining which \'node\' statement applies to the client\. Possible values are \'cert\' (use the subject\'s CN in the client\'s certificate) and \'facter\' (use the hostname that the client reported in its facts) . .IP "\(bu" 4 \fIDefault\fR: cert . .IP "" 0 . .SS "node_name_fact" The fact name used to determine the node name used for all requests the agent makes to the master\. WARNING: This setting is mutually exclusive with node_name_value\. Changing this setting also requires changes to the default auth\.conf configuration on the Puppet Master\. Please see http://links\.puppetlabs\.com/node_name_fact for more information\. . .SS "node_name_value" The explicit value used for the node name for all requests the agent makes to the master\. WARNING: This setting is mutually exclusive with node_name_fact\. Changing this setting also requires changes to the default auth\.conf configuration on the Puppet Master\. Please see http://links\.puppetlabs\.com/node_name_value for more information\. . .IP "\(bu" 4 \fIDefault\fR: $certname . .IP "" 0 . .SS "node_terminus" Where to find information about nodes\. . .IP "\(bu" 4 \fIDefault\fR: plain . .IP "" 0 . .SS "noop" Whether to apply catalogs in noop mode, which allows Puppet to partially simulate a normal run\. This setting affects puppet agent and puppet apply\. . .P When running in noop mode, Puppet will check whether each resource is in sync, like it does when running normally\. However, if a resource attribute is not in the desired state (as declared in the catalog), Puppet will take no action, and will instead report the changes it \fIwould\fR have made\. These simulated changes will appear in the report sent to the puppet master, or be shown on the console if running puppet agent or puppet apply in the foreground\. The simulated changes will not send refresh events to any subscribing or notified resources, although Puppet will log that a refresh event \fIwould\fR have been sent\. . .P \fBImportant note:\fR The \fBnoop\fR metaparameter \fIhttp://docs\.puppetlabs\.com/references/latest/metaparameter\.html#noop\fR allows you to apply individual resources in noop mode, and will override the global value of the \fBnoop\fR setting\. This means a resource with \fBnoop => false\fR \fIwill\fR be changed if necessary, even when running puppet agent with \fBnoop = true\fR or \fB\-\-noop\fR\. (Conversely, a resource with \fBnoop => true\fR will only be simulated, even when noop mode is globally disabled\.) . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "onetime" Perform one configuration run and exit, rather than spawning a long\-running daemon\. This is useful for interactively running puppet agent, or running puppet agent from cron\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "ordering" How unrelated resources should be ordered when applying a catalog\. Allowed values are \fBtitle\-hash\fR, \fBmanifest\fR, and \fBrandom\fR\. This setting affects puppet agent and puppet apply, but not puppet master\. . .IP "\(bu" 4 \fBtitle\-hash\fR (the default) will order resources randomly, but will use the same order across runs and across nodes\. . .IP "\(bu" 4 \fBmanifest\fR will use the order in which the resources were declared in their manifest files\. . .IP "\(bu" 4 \fBrandom\fR will order resources randomly and change their order with each run\. This can work like a fuzzer for shaking out undeclared dependencies\. . .IP "" 0 . .P Regardless of this setting\'s value, Puppet will always obey explicit dependencies set with the before/require/notify/subscribe metaparameters and the \fB\->\fR/\fB~>\fR chaining arrows; this setting only affects the relative ordering of \fIunrelated\fR resources\. . .IP "\(bu" 4 \fIDefault\fR: manifest . .IP "" 0 . .SS "parser" Selects the parser to use for parsing puppet manifests (in puppet DSL language/\'\.pp\' files)\. Available choices are \fBcurrent\fR (the default) and \fBfuture\fR\. . .P The \fBcurrent\fR parser means that the released version of the parser should be used\. . .P The \fBfuture\fR parser is a "time travel to the future" allowing early exposure to new language features\. What these features are will vary from release to release and they may be invididually configurable\. . .P Available Since Puppet 3\.2\. . .IP "\(bu" 4 \fIDefault\fR: current . .IP "" 0 . .SS "passfile" Where puppet agent stores the password for its private key\. Generally unused\. . .IP "\(bu" 4 \fIDefault\fR: $privatedir/password . .IP "" 0 . .SS "path" The shell search path\. Defaults to whatever is inherited from the parent process\. . .IP "\(bu" 4 \fIDefault\fR: none . .IP "" 0 . .SS "pidfile" The file containing the PID of a running process\. This file is intended to be used by service management frameworks and monitoring systems to determine if a puppet process is still in the process table\. . .IP "\(bu" 4 \fIDefault\fR: $rundir/${run_mode}\.pid . .IP "" 0 . .SS "plugindest" Where Puppet should store plugins that it pulls down from the central server\. . .IP "\(bu" 4 \fIDefault\fR: $libdir . .IP "" 0 . .SS "pluginfactdest" Where Puppet should store external facts that are being handled by pluginsync . .IP "\(bu" 4 \fIDefault\fR: $vardir/facts\.d . .IP "" 0 . .SS "pluginfactsource" Where to retrieve external facts for pluginsync . .IP "\(bu" 4 \fIDefault\fR: puppet://$server/pluginfacts . .IP "" 0 . .SS "pluginsignore" What files to ignore when pulling down plugins\. . .IP "\(bu" 4 \fIDefault\fR: \.svn CVS \.git . .IP "" 0 . .SS "pluginsource" From where to retrieve plugins\. The standard Puppet \fBfile\fR type is used for retrieval, so anything that is a valid file source can be used here\. . .IP "\(bu" 4 \fIDefault\fR: puppet://$server/plugins . .IP "" 0 . .SS "pluginsync" Whether plugins should be synced with the central server\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "postrun_command" A command to run after every agent run\. If this command returns a non\-zero return code, the entire Puppet run will be considered to have failed, even though it might have performed work during the normal run\. . .SS "preferred_serialization_format" The preferred means of serializing ruby instances for passing over the wire\. This won\'t guarantee that all instances will be serialized using this method, since not all classes can be guaranteed to support this format, but it will be used for all classes that support it\. . .IP "\(bu" 4 \fIDefault\fR: pson . .IP "" 0 . .SS "prerun_command" A command to run before every agent run\. If this command returns a non\-zero return code, the entire Puppet run will fail\. . .SS "priority" The scheduling priority of the process\. Valid values are \'high\', \'normal\', \'low\', or \'idle\', which are mapped to platform\-specific values\. The priority can also be specified as an integer value and will be passed as is, e\.g\. \-5\. Puppet must be running as a privileged user in order to increase scheduling priority\. . .TP \fIDefault\fR: . .SS "privatedir" Where the client stores private certificate information\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/private . .IP "" 0 . .SS "privatekeydir" The private key directory\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/private_keys . .IP "" 0 . .SS "profile" Whether to enable experimental performance profiling . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "publickeydir" The public key directory\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/public_keys . .IP "" 0 . .SS "puppetdlog" The fallback log file\. This is only used when the \fB\-\-logdest\fR option is not specified AND Puppet is running on an operating system where both the POSIX syslog service and the Windows Event Log are unavailable\. (Currently, no supported operating systems match that description\.) . .P Despite the name, both puppet agent and puppet master will use this file as the fallback logging destination\. . .P For control over logging destinations, see the \fB\-\-logdest\fR command line option in the manual pages for puppet master, puppet agent, and puppet apply\. You can see man pages by running \fBpuppet \-\-help\fR, or read them online at http://docs\.puppetlabs\.com/references/latest/man/\. . .IP "\(bu" 4 \fIDefault\fR: $logdir/puppetd\.log . .IP "" 0 . .SS "puppetport" Which port puppet agent listens on\. . .IP "\(bu" 4 \fIDefault\fR: 8139 . .IP "" 0 . -.SS "queue_source" -Which type of queue to use for asynchronous processing\. If your stomp server requires authentication, you can include it in the URI as long as your stomp client library is at least 1\.1\.1 -. -.IP "\(bu" 4 -\fIDefault\fR: stomp://localhost:61613/ -. -.IP "" 0 -. -.SS "queue_type" -Which type of queue to use for asynchronous processing\. -. -.IP "\(bu" 4 -\fIDefault\fR: stomp -. -.IP "" 0 -. .SS "rails_loglevel" The log level for Rails connections\. The value must be a valid log level within Rails\. Production environments normally use \fBinfo\fR and other environments normally use \fBdebug\fR\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: info . .IP "" 0 . .SS "railslog" Where Rails\-specific logs are sent\. This setting is only used by the ActiveRecord storeconfigs and inventory backends, which are deprecated\. . .IP "\(bu" 4 \fIDefault\fR: $logdir/rails\.log . .IP "" 0 . .SS "report" Whether to send reports after every transaction\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "report_port" The port to communicate with the report_server\. . .IP "\(bu" 4 \fIDefault\fR: $masterport . .IP "" 0 . .SS "report_serialization_format" The serialization format to use when sending reports to the \fBreport_server\fR\. Possible values are \fBpson\fR and \fByaml\fR\. This setting affects puppet agent, but not puppet apply (which processes its own reports)\. . .P This should almost always be set to \fBpson\fR\. It can be temporarily set to \fByaml\fR to let agents using this Puppet version connect to a puppet master running Puppet 3\.0\.0 through 3\.2\.x\. . .P Note that this is set to \'yaml\' automatically if the agent detects an older master, so should never need to be set explicitly\. . .IP "\(bu" 4 \fIDefault\fR: pson . .IP "" 0 . .SS "report_server" The server to send transaction reports to\. . .IP "\(bu" 4 \fIDefault\fR: $server . .IP "" 0 . .SS "reportdir" The directory in which to store reports\. Each node gets a separate subdirectory in this directory\. This setting is only used when the \fBstore\fR report processor is enabled (see the \fBreports\fR setting)\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/reports . .IP "" 0 . .SS "reportfrom" The \'from\' email address for the reports\. . .IP "\(bu" 4 \fIDefault\fR: report@aparker\.corp\.puppetlabs\.net . .IP "" 0 . .SS "reports" The list of report handlers to use\. When using multiple report handlers, their names should be comma\-separated, with whitespace allowed\. (For example, \fBreports = http, tagmail\fR\.) . .P This setting is relevant to puppet master and puppet apply\. The puppet master will call these report handlers with the reports it receives from agent nodes, and puppet apply will call them with its own report\. (In all cases, the node applying the catalog must have \fBreport = true\fR\.) . .P See the report reference for information on the built\-in report handlers; custom report handlers can also be loaded from modules\. (Report handlers are loaded from the lib directory, at \fBpuppet/reports/NAME\.rb\fR\.) . .IP "\(bu" 4 \fIDefault\fR: store . .IP "" 0 . .SS "reporturl" The URL that reports should be forwarded to\. This setting is only used when the \fBhttp\fR report processor is enabled (see the \fBreports\fR setting)\. . .IP "\(bu" 4 \fIDefault\fR: http://localhost:3000/reports/upload . .IP "" 0 . .SS "req_bits" The bit length of the certificates\. . .IP "\(bu" 4 \fIDefault\fR: 4096 . .IP "" 0 . .SS "requestdir" Where host certificate requests are stored\. . .IP "\(bu" 4 \fIDefault\fR: $ssldir/certificate_requests . .IP "" 0 . .SS "resourcefile" The file in which puppet agent stores a list of the resources associated with the retrieved configuration\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/resources\.txt . .IP "" 0 . .SS "rest_authconfig" The configuration file that defines the rights to the different rest indirections\. This can be used as a fine\-grained authorization system for \fBpuppet master\fR\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/auth\.conf . .IP "" 0 . .SS "route_file" The YAML file containing indirector route configuration\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/routes\.yaml . .IP "" 0 . .SS "rrddir" The directory where RRD database files are stored\. Directories for each reporting host will be created under this directory\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/rrd . .IP "" 0 . .SS "rrdinterval" How often RRD should expect data\. This should match how often the hosts report back to the server\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: $runinterval . .IP "" 0 . .SS "rundir" Where Puppet PID files are kept\. . .TP \fIDefault\fR: . .SS "runinterval" How often puppet agent applies the catalog\. Note that a runinterval of 0 means "run continuously" rather than "never run\." If you want puppet agent to never run, you should start it with the \fB\-\-no\-client\fR option\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 30m . .IP "" 0 . .SS "sendmail" Where to find the sendmail binary with which to send email\. . .IP "\(bu" 4 \fIDefault\fR: /usr/sbin/sendmail . .IP "" 0 . .SS "serial" Where the serial number for certificates is stored\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/serial . .IP "" 0 . .SS "server" The puppet master server to which the puppet agent should connect\. . .IP "\(bu" 4 \fIDefault\fR: puppet . .IP "" 0 . .SS "server_datadir" The directory in which serialized data is stored, usually in a subdirectory\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/server_data . .IP "" 0 . .SS "show_diff" Whether to log and report a contextual diff when files are being replaced\. This causes partial file contents to pass through Puppet\'s normal logging and reporting system, so this setting should be used with caution if you are sending Puppet\'s reports to an insecure destination\. This feature currently requires the \fBdiff/lcs\fR Ruby library\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "signeddir" Where the CA stores signed certificates\. . .IP "\(bu" 4 \fIDefault\fR: $cadir/signed . .IP "" 0 . .SS "smtphelo" The name by which we identify ourselves in SMTP HELO for reports\. If you send to a smtpserver which does strict HELO checking (as with Postfix\'s \fBsmtpd_helo_restrictions\fR access controls), you may need to ensure this resolves\. . .IP "\(bu" 4 \fIDefault\fR: aparker\.corp\.puppetlabs\.net . .IP "" 0 . .SS "smtpport" The TCP port through which to send email reports\. . .IP "\(bu" 4 \fIDefault\fR: 25 . .IP "" 0 . .SS "smtpserver" The server through which to send email reports\. . .IP "\(bu" 4 \fIDefault\fR: none . .IP "" 0 . .SS "splay" Whether to sleep for a pseudo\-random (but consistent) amount of time before a run\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "splaylimit" The maximum time to delay before runs\. Defaults to being the same as the run interval\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: $runinterval . .IP "" 0 . .SS "srv_domain" The domain which will be queried to find the SRV records of servers to use\. . .IP "\(bu" 4 \fIDefault\fR: corp\.puppetlabs\.net . .IP "" 0 . .SS "ssl_client_ca_auth" Certificate authorities who issue server certificates\. SSL servers will not be considered authentic unless they possess a certificate issued by an authority listed in this file\. If this setting has no value then the Puppet master\'s CA certificate (localcacert) will be used\. . .TP \fIDefault\fR: . .SS "ssl_client_header" The header containing an authenticated client\'s SSL DN\. This header must be set by the proxy to the authenticated client\'s SSL DN (e\.g\., \fB/CN=puppet\.puppetlabs\.com\fR)\. Puppet will parse out the Common Name (CN) from the Distinguished Name (DN) and use the value of the CN field for authorization\. . .P Note that the name of the HTTP header gets munged by the web server common gateway inteface: an \fBHTTP_\fR prefix is added, dashes are converted to underscores, and all letters are uppercased\. Thus, to use the \fBX\-Client\-DN\fR header, this setting should be \fBHTTP_X_CLIENT_DN\fR\. . .IP "\(bu" 4 \fIDefault\fR: HTTP_X_CLIENT_DN . .IP "" 0 . .SS "ssl_client_verify_header" The header containing the status message of the client verification\. This header must be set by the proxy to \'SUCCESS\' if the client successfully authenticated, and anything else otherwise\. . .P Note that the name of the HTTP header gets munged by the web server common gateway inteface: an \fBHTTP_\fR prefix is added, dashes are converted to underscores, and all letters are uppercased\. Thus, to use the \fBX\-Client\-Verify\fR header, this setting should be \fBHTTP_X_CLIENT_VERIFY\fR\. . .IP "\(bu" 4 \fIDefault\fR: HTTP_X_CLIENT_VERIFY . .IP "" 0 . .SS "ssl_server_ca_auth" Certificate authorities who issue client certificates\. SSL clients will not be considered authentic unless they possess a certificate issued by an authority listed in this file\. If this setting has no value then the Puppet master\'s CA certificate (localcacert) will be used\. . .TP \fIDefault\fR: . .SS "ssldir" Where SSL certificates are kept\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/ssl . .IP "" 0 . .SS "statedir" The directory where Puppet state is stored\. Generally, this directory can be removed without causing harm (although it might result in spurious service restarts)\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/state . .IP "" 0 . .SS "statefile" Where puppet agent and puppet master store state associated with the running configuration\. In the case of puppet master, this file reflects the state discovered through interacting with clients\. . .IP "\(bu" 4 \fIDefault\fR: $statedir/state\.yaml . .IP "" 0 . .SS "storeconfigs" Whether to store each client\'s configuration, including catalogs, facts, and related data\. This also enables the import and export of resources in the Puppet language \- a mechanism for exchange resources between nodes\. . .P By default this uses ActiveRecord and an SQL database to store and query the data; this, in turn, will depend on Rails being available\. . .P You can adjust the backend using the storeconfigs_backend setting\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "storeconfigs_backend" Configure the backend terminus used for StoreConfigs\. By default, this uses the ActiveRecord store, which directly talks to the database from within the Puppet Master process\. . .IP "\(bu" 4 \fIDefault\fR: active_record . .IP "" 0 . .SS "strict_hostname_checking" Whether to only search for the complete hostname as it is in the certificate when searching for node information in the catalogs\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "strict_variables" Makes the parser raise errors when referencing unknown variables\. (This does not affect referencing variables that are explicitly set to undef)\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "stringify_facts" Flatten fact values to strings using #to_s\. Means you can\'t have arrays or hashes as fact values\. (DEPRECATED) This option will be removed in Puppet 4\.0\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "summarize" Whether to print a transaction summary\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "syslogfacility" What syslog facility to use when logging to syslog\. Syslog has a fixed list of valid facilities, and you must choose one of those; you cannot just make one up\. . .IP "\(bu" 4 \fIDefault\fR: daemon . .IP "" 0 . .SS "tagmap" The mapping between reporting tags and email addresses\. . .IP "\(bu" 4 \fIDefault\fR: $confdir/tagmail\.conf . .IP "" 0 . .SS "tags" Tags to use to find resources\. If this is set, then only resources tagged with the specified tags will be applied\. Values must be comma\-separated\. . .SS "templatedir" Where Puppet looks for template files\. Can be a list of colon\-separated directories\. . .P This setting is deprecated\. Please put your templates in modules instead\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/templates . .IP "" 0 . .SS "thin_storeconfigs" Boolean; whether Puppet should store only facts and exported resources in the storeconfigs database\. This will improve the performance of exported resources with the older \fBactive_record\fR backend, but will disable external tools that search the storeconfigs database\. Thinning catalogs is generally unnecessary when using PuppetDB to store catalogs\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "trace" Whether to print stack traces on some errors . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "trusted_node_data" Stores trusted node data in a hash called $trusted\. When true also prevents $trusted from being overridden in any scope\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "use_cached_catalog" Whether to only use the cached catalog rather than compiling a new catalog on every run\. Puppet can be run with this enabled by default and then selectively disabled when a recompile is desired\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "use_srv_records" Whether the server will search for SRV records in DNS for the current domain\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . .SS "usecacheonfailure" Whether to use the cached configuration when the remote configuration will not compile\. This option is useful for testing new configurations, where you want to fix the broken configuration rather than reverting to a known\-good one\. . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .SS "user" The user puppet master should run as\. . .IP "\(bu" 4 \fIDefault\fR: puppet . .IP "" 0 . .SS "vardir" Where Puppet stores dynamic and growing data\. The default for this setting is calculated specially, like \fBconfdir\fR_\. . .IP "\(bu" 4 \fIDefault\fR: /var/lib/puppet . .IP "" 0 . .SS "waitforcert" How frequently puppet agent should ask for a signed certificate\. . .P When starting for the first time, puppet agent will submit a certificate signing request (CSR) to the server named in the \fBca_server\fR setting (usually the puppet master); this may be autosigned, or may need to be approved by a human, depending on the CA server\'s configuration\. . .P Puppet agent cannot apply configurations until its approved certificate is available\. Since the certificate may or may not be available immediately, puppet agent will repeatedly try to fetch it at this interval\. You can turn off waiting for certificates by specifying a time of 0, in which case puppet agent will exit if it cannot get a cert\. This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y)\. . .IP "\(bu" 4 \fIDefault\fR: 2m . .IP "" 0 . .SS "yamldir" The directory in which YAML data is stored, usually in a subdirectory\. . .IP "\(bu" 4 \fIDefault\fR: $vardir/yaml . .IP "" 0 . .SS "zlib" Boolean; whether to use the zlib library . .IP "\(bu" 4 \fIDefault\fR: true . .IP "" 0 . .P -\fIThis page autogenerated on 2014\-09\-15 12:02:46 \-0700\fR +\fIThis page autogenerated on 2014\-09\-16 20:41:04 \-0700\fR diff --git a/man/man8/puppet-catalog.8 b/man/man8/puppet-catalog.8 index 37c4c4a9e..4c654718e 100644 --- a/man/man8/puppet-catalog.8 +++ b/man/man8/puppet-catalog.8 @@ -1,295 +1,292 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "PUPPET\-CATALOG" "8" "September 2014" "Puppet Labs, LLC" "Puppet manual" . .SH "NAME" \fBpuppet\-catalog\fR \- Compile, save, view, and convert catalogs\. . .SH "SYNOPSIS" puppet catalog \fIaction\fR [\-\-terminus TERMINUS] [\-\-extra HASH] . .SH "DESCRIPTION" This subcommand deals with catalogs, which are compiled per\-node artifacts generated from a set of Puppet manifests\. By default, it interacts with the compiling subsystem and compiles a catalog using the default manifest and \fBcertname\fR, but you can change the source of the catalog with the \fB\-\-terminus\fR option\. You can also choose to print any catalog in \'dot\' format (for easy graph viewing with OmniGraffle or Graphviz) with \'\-\-render\-as dot\'\. . .SH "OPTIONS" Note that any setting that\'s valid in the configuration file is also a valid long argument, although it may or may not be relevant to the present action\. For example, \fBserver\fR and \fBrun_mode\fR are valid settings, so you can specify \fB\-\-server \fR, or \fB\-\-run_mode \fR as an argument\. . .P See the configuration file documentation at \fIhttp://docs\.puppetlabs\.com/references/stable/configuration\.html\fR for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \fB\-\-genconfig\fR\. . .TP \-\-render\-as FORMAT The format in which to render output\. The most common formats are \fBjson\fR, \fBs\fR (string), \fByaml\fR, and \fBconsole\fR, but other options such as \fBdot\fR are sometimes available\. . .TP \-\-verbose Whether to log verbosely\. . .TP \-\-debug Whether to log debug information\. . .TP \-\-extra HASH A terminus can take additional arguments to refine the operation, which are passed as an arbitrary hash to the back\-end\. Anything passed as the extra value is just send direct to the back\-end\. . .TP \-\-terminus TERMINUS Indirector faces expose indirected subsystems of Puppet\. These subsystems are each able to retrieve and alter a specific type of data (with the familiar actions of \fBfind\fR, \fBsearch\fR, \fBsave\fR, and \fBdestroy\fR) from an arbitrary number of pluggable backends\. In Puppet parlance, these backends are called terminuses\. . .IP Almost all indirected subsystems have a \fBrest\fR terminus that interacts with the puppet master\'s data\. Most of them have additional terminuses for various local data models, which are in turn used by the indirected subsystem on the puppet master whenever it receives a remote request\. . .IP The terminus for an action is often determined by context, but occasionally needs to be set explicitly\. See the "Notes" section of this face\'s manpage for more details\. . .SH "ACTIONS" . .TP \fBapply\fR \- Find and apply a catalog\. \fBSYNOPSIS\fR . .IP puppet catalog apply [\-\-terminus TERMINUS] [\-\-extra HASH] . .IP \fBDESCRIPTION\fR . .IP Finds and applies a catalog\. This action takes no arguments, but the source of the catalog can be managed with the \fB\-\-terminus\fR option\. . .IP \fBRETURNS\fR . .IP Nothing\. When used from the Ruby API, returns a Puppet::Transaction::Report object\. . .TP \fBdestroy\fR \- Invalid for this subcommand\. \fBSYNOPSIS\fR . .IP puppet catalog destroy [\-\-terminus TERMINUS] [\-\-extra HASH] \fIkey\fR . .IP \fBDESCRIPTION\fR . .IP Invalid for this subcommand\. . .TP \fBdownload\fR \- Download this node\'s catalog from the puppet master server\. \fBSYNOPSIS\fR . .IP puppet catalog download [\-\-terminus TERMINUS] [\-\-extra HASH] . .IP \fBDESCRIPTION\fR . .IP Retrieves a catalog from the puppet master and saves it to the local yaml cache\. This action always contacts the puppet master and will ignore alternate termini\. . .IP The saved catalog can be used in any subsequent catalog action by specifying \'\-\-terminus yaml\' for that action\. . .IP \fBRETURNS\fR . .IP Nothing\. . .IP \fBNOTES\fR . .IP When used from the Ruby API, this action has a side effect of leaving Puppet::Resource::Catalog\.indirection\.terminus_class set to yaml\. The terminus must be explicitly re\-set for subsequent catalog actions\. . .TP \fBfind\fR \- Retrieve the catalog for a node\. \fBSYNOPSIS\fR . .IP puppet catalog find [\-\-terminus TERMINUS] [\-\-extra HASH] \fIcertname\fR . .IP \fBDESCRIPTION\fR . .IP Retrieve the catalog for a node\. . .IP \fBRETURNS\fR . .IP A serialized catalog\. When used from the Ruby API, returns a Puppet::Resource::Catalog object\. . .TP \fBinfo\fR \- Print the default terminus class for this face\. \fBSYNOPSIS\fR . .IP puppet catalog info [\-\-terminus TERMINUS] [\-\-extra HASH] . .IP \fBDESCRIPTION\fR . .IP Prints the default terminus class for this subcommand\. Note that different run modes may have different default termini; when in doubt, specify the run mode with the \'\-\-run_mode\' option\. . .TP \fBsave\fR \- API only: create or overwrite an object\. \fBSYNOPSIS\fR . .IP puppet catalog save [\-\-terminus TERMINUS] [\-\-extra HASH] \fIkey\fR . .IP \fBDESCRIPTION\fR . .IP API only: create or overwrite an object\. As the Faces framework does not currently accept data from STDIN, save actions cannot currently be invoked from the command line\. . .TP \fBsearch\fR \- Invalid for this subcommand\. \fBSYNOPSIS\fR . .IP puppet catalog search [\-\-terminus TERMINUS] [\-\-extra HASH] \fIquery\fR . .IP \fBDESCRIPTION\fR . .IP Invalid for this subcommand\. . .TP \fBselect\fR \- Retrieve a catalog and filter it for resources of a given type\. \fBSYNOPSIS\fR . .IP puppet catalog select [\-\-terminus TERMINUS] [\-\-extra HASH] \fIhost\fR \fIresource_type\fR . .IP \fBDESCRIPTION\fR . .IP Retrieves a catalog for the specified host, then searches it for all resources of the requested type\. . .IP \fBRETURNS\fR . .IP A list of resource references ("Type[title]")\. When used from the API, returns an array of Puppet::Resource objects excised from a catalog\. . .IP \fBNOTES\fR . .IP By default, this action will retrieve a catalog from Puppet\'s compiler subsystem; you must call the action with \fB\-\-terminus rest\fR if you wish to retrieve a catalog from the puppet master\. . .IP FORMATTING ISSUES: This action cannot currently render useful yaml; instead, it returns an entire catalog\. Use json instead\. . .SH "EXAMPLES" \fBapply\fR . .P Apply the locally cached catalog: . .P $ puppet catalog apply \-\-terminus yaml . .P Retrieve a catalog from the master and apply it, in one step: . .P $ puppet catalog apply \-\-terminus rest . .P From \fBsecret_agent\.rb\fR (API example): . .IP "" 4 . .nf # \.\.\. Puppet::Face[:catalog, \'0\.0\.1\']\.download # (Termini are singletons; catalog\.download has a side effect of # setting the catalog terminus to yaml) report = Puppet::Face[:catalog, \'0\.0\.1\']\.apply # \.\.\. . .fi . .IP "" 0 . .P \fBdownload\fR . .P Retrieve and store a catalog: . .P $ puppet catalog download . .P From \fBsecret_agent\.rb\fR (API example): . .IP "" 4 . .nf Puppet::Face[:plugin, \'0\.0\.1\']\.download Puppet::Face[:facts, \'0\.0\.1\']\.upload Puppet::Face[:catalog, \'0\.0\.1\']\.download # \.\.\. . .fi . .IP "" 0 . .P \fBselect\fR . .P Ask the puppet master for a list of managed file resources for a node: . .P $ puppet catalog select \-\-terminus rest somenode\.magpie\.lan file . .SH "NOTES" This subcommand is an indirector face, which exposes \fBfind\fR, \fBsearch\fR, \fBsave\fR, and \fBdestroy\fR actions for an indirected subsystem of Puppet\. Valid termini for this face include: . .IP "\(bu" 4 \fBactive_record\fR . .IP "\(bu" 4 \fBcompiler\fR . .IP "\(bu" 4 \fBjson\fR . .IP "\(bu" 4 \fBmsgpack\fR . .IP "\(bu" 4 -\fBqueue\fR -. -.IP "\(bu" 4 \fBrest\fR . .IP "\(bu" 4 \fBstatic_compiler\fR . .IP "\(bu" 4 \fBstore_configs\fR . .IP "\(bu" 4 \fByaml\fR . .IP "" 0 . .SH "COPYRIGHT AND LICENSE" Copyright 2011 by Puppet Labs Apache 2 license; see COPYING diff --git a/man/man8/puppet-queue.8 b/man/man8/puppet-queue.8 deleted file mode 100644 index a4f2736df..000000000 --- a/man/man8/puppet-queue.8 +++ /dev/null @@ -1,55 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "PUPPET\-QUEUE" "8" "September 2014" "Puppet Labs, LLC" "Puppet manual" -. -.SH "NAME" -\fBpuppet\-queue\fR \- Deprecated queuing daemon for asynchronous storeconfigs -. -.SH "SYNOPSIS" -Retrieves serialized storeconfigs records from a queue and processes them in order\. THIS FEATURE IS DEPRECATED; use PuppetDB instead\. -. -.SH "USAGE" -puppet queue [\-d|\-\-debug] [\-\-help] [\-v|\-\-verbose] [\-\-version] -. -.SH "DESCRIPTION" -This application runs as a daemon and processes storeconfigs data, retrieving the data from a stomp server message queue and writing it to a database\. It was once necessary as a workaround for the poor performance of ActiveRecord\-based storeconfigs, but has been supplanted by the PuppetDB service, which gives better performance with less complexity\. -. -.P -For more information, see the PuppetDB documentation at http://docs\.puppetlabs\.com/puppetdb/latest -. -.SH "OPTIONS" -Note that any setting that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid setting, so you can specify \'\-\-server \fIservername\fR\' as an argument\. -. -.P -See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet queue with \'\-\-genconfig\'\. -. -.TP -\-\-debug -Enable full debugging\. -. -.TP -\-\-help -Print this help message -. -.TP -\-\-verbose -Turn on verbose reporting\. -. -.TP -\-\-version -Print the puppet version number and exit\. -. -.SH "EXAMPLE" -. -.nf - -$ puppet queue -. -.fi -. -.SH "AUTHOR" -Luke Kanies -. -.SH "COPYRIGHT" -Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2\.0 License diff --git a/spec/integration/defaults_spec.rb b/spec/integration/defaults_spec.rb index 7d8ea3150..5e2a73715 100755 --- a/spec/integration/defaults_spec.rb +++ b/spec/integration/defaults_spec.rb @@ -1,335 +1,319 @@ #! /usr/bin/env ruby require 'spec_helper' require 'puppet/defaults' require 'puppet/rails' describe "Puppet defaults" do describe "when default_manifest is set" do it "returns ./manifests by default" do expect(Puppet[:default_manifest]).to eq('./manifests') end end describe "when disable_per_environment_manifest is set" do it "returns false by default" do expect(Puppet[:disable_per_environment_manifest]).to eq(false) end it "errors when set to true and default_manifest is not an absolute path" do expect { Puppet[:default_manifest] = './some/relative/manifest.pp' Puppet[:disable_per_environment_manifest] = true }.to raise_error Puppet::Settings::ValidationError, /'default_manifest' setting must be.*absolute/ end end describe "when setting the :factpath" do it "should add the :factpath to Facter's search paths" do Facter.expects(:search).with("/my/fact/path") Puppet.settings[:factpath] = "/my/fact/path" end end describe "when setting the :certname" do it "should fail if the certname is not downcased" do expect { Puppet.settings[:certname] = "Host.Domain.Com" }.to raise_error(ArgumentError) end end describe "when setting :node_name_value" do it "should default to the value of :certname" do Puppet.settings[:certname] = 'blargle' Puppet.settings[:node_name_value].should == 'blargle' end end describe "when setting the :node_name_fact" do it "should fail when also setting :node_name_value" do lambda do Puppet.settings[:node_name_value] = "some value" Puppet.settings[:node_name_fact] = "some_fact" end.should raise_error("Cannot specify both the node_name_value and node_name_fact settings") end it "should not fail when using the default for :node_name_value" do lambda do Puppet.settings[:node_name_fact] = "some_fact" end.should_not raise_error end end describe "when :certdnsnames is set" do it "should not fail" do expect { Puppet[:certdnsnames] = 'fred:wilma' }.to_not raise_error end it "should warn the value is ignored" do Puppet.expects(:warning).with {|msg| msg =~ /CVE-2011-3872/ } Puppet[:certdnsnames] = 'fred:wilma' end end describe "when setting the :catalog_format" do it "should log a deprecation notice" do Puppet.expects(:deprecation_warning) Puppet.settings[:catalog_format] = 'marshal' end it "should copy the value to :preferred_serialization_format" do Puppet.settings[:catalog_format] = 'marshal' Puppet.settings[:preferred_serialization_format].should == 'marshal' end end it "should have a clientyamldir setting" do Puppet.settings[:clientyamldir].should_not be_nil end it "should have different values for the yamldir and clientyamldir" do Puppet.settings[:yamldir].should_not == Puppet.settings[:clientyamldir] end it "should have a client_datadir setting" do Puppet.settings[:client_datadir].should_not be_nil end it "should have different values for the server_datadir and client_datadir" do Puppet.settings[:server_datadir].should_not == Puppet.settings[:client_datadir] end # See #1232 it "should not specify a user or group for the clientyamldir" do Puppet.settings.setting(:clientyamldir).owner.should be_nil Puppet.settings.setting(:clientyamldir).group.should be_nil end it "should use the service user and group for the yamldir" do Puppet.settings.stubs(:service_user_available?).returns true Puppet.settings.stubs(:service_group_available?).returns true Puppet.settings.setting(:yamldir).owner.should == Puppet.settings[:user] Puppet.settings.setting(:yamldir).group.should == Puppet.settings[:group] end it "should specify that the host private key should be owned by the service user" do Puppet.settings.stubs(:service_user_available?).returns true Puppet.settings.setting(:hostprivkey).owner.should == Puppet.settings[:user] end it "should specify that the host certificate should be owned by the service user" do Puppet.settings.stubs(:service_user_available?).returns true Puppet.settings.setting(:hostcert).owner.should == Puppet.settings[:user] end [:modulepath, :factpath].each do |setting| it "should configure '#{setting}' not to be a file setting, so multi-directory settings are acceptable" do Puppet.settings.setting(setting).should be_instance_of(Puppet::Settings::PathSetting) end end describe "on a Unix-like platform it", :as_platform => :posix do it "should add /usr/sbin and /sbin to the path if they're not there" do Puppet::Util.withenv("PATH" => "/usr/bin#{File::PATH_SEPARATOR}/usr/local/bin") do Puppet.settings[:path] = "none" # this causes it to ignore the setting ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/usr/sbin") ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin") end end end describe "on a Windows-like platform it", :as_platform => :windows do it "should not add anything" do path = "c:\\windows\\system32#{File::PATH_SEPARATOR}c:\\windows" Puppet::Util.withenv("PATH" => path) do Puppet.settings[:path] = "none" # this causes it to ignore the setting ENV["PATH"].should == path end end end it "should default to pson for the preferred serialization format" do Puppet.settings.value(:preferred_serialization_format).should == "pson" end describe "when enabling storeconfigs" do before do Puppet::Resource::Catalog.indirection.stubs(:cache_class=) Puppet::Node::Facts.indirection.stubs(:cache_class=) Puppet::Node.indirection.stubs(:cache_class=) Puppet.features.stubs(:rails?).returns true end it "should set the Catalog cache class to :store_configs" do Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:store_configs) Puppet.settings[:storeconfigs] = true end - it "should not set the Catalog cache class to :store_configs if asynchronous storeconfigs is enabled" do - Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:store_configs).never - Puppet.settings[:async_storeconfigs] = true - Puppet.settings[:storeconfigs] = true - end - it "should set the Facts cache class to :store_configs" do Puppet::Node::Facts.indirection.expects(:cache_class=).with(:store_configs) Puppet.settings[:storeconfigs] = true end it "does not change the Node cache" do Puppet::Node.indirection.expects(:cache_class=).never Puppet.settings[:storeconfigs] = true end end describe "when enabling asynchronous storeconfigs" do before do Puppet::Resource::Catalog.indirection.stubs(:cache_class=) Puppet::Node::Facts.indirection.stubs(:cache_class=) Puppet::Node.indirection.stubs(:cache_class=) Puppet.features.stubs(:rails?).returns true end - it "should set storeconfigs to true" do - Puppet.settings[:async_storeconfigs] = true - Puppet.settings[:storeconfigs].should be_true - end - - it "should set the Catalog cache class to :queue" do - Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:queue) - Puppet.settings[:async_storeconfigs] = true - end - it "should set the Facts cache class to :store_configs" do Puppet::Node::Facts.indirection.expects(:cache_class=).with(:store_configs) Puppet.settings[:storeconfigs] = true end it "does not change the Node cache" do Puppet::Node.indirection.expects(:cache_class=).never Puppet.settings[:storeconfigs] = true end end describe "when enabling thin storeconfigs" do before do Puppet::Resource::Catalog.indirection.stubs(:cache_class=) Puppet::Node::Facts.indirection.stubs(:cache_class=) Puppet::Node.indirection.stubs(:cache_class=) Puppet.features.stubs(:rails?).returns true end it "should set storeconfigs to true" do Puppet.settings[:thin_storeconfigs] = true Puppet.settings[:storeconfigs].should be_true end end it "should have a setting for determining the configuration version and should default to an empty string" do Puppet.settings[:config_version].should == "" end describe "when enabling reports" do it "should use the default server value when report server is unspecified" do Puppet.settings[:server] = "server" Puppet.settings[:report_server].should == "server" end it "should use the default masterport value when report port is unspecified" do Puppet.settings[:masterport] = "1234" Puppet.settings[:report_port].should == "1234" end it "should use report_port when set" do Puppet.settings[:masterport] = "1234" Puppet.settings[:report_port] = "5678" Puppet.settings[:report_port].should == "5678" end end it "should have a :caname setting that defaults to the cert name" do Puppet.settings[:certname] = "foo" Puppet.settings[:ca_name].should == "Puppet CA: foo" end it "should have a 'prerun_command' that defaults to the empty string" do Puppet.settings[:prerun_command].should == "" end it "should have a 'postrun_command' that defaults to the empty string" do Puppet.settings[:postrun_command].should == "" end it "should have a 'certificate_revocation' setting that defaults to true" do Puppet.settings[:certificate_revocation].should be_true end it "should have an http_compression setting that defaults to false" do Puppet.settings[:http_compression].should be_false end describe "reportdir" do subject { Puppet.settings[:reportdir] } it { should == "#{Puppet[:vardir]}/reports" } end describe "reporturl" do subject { Puppet.settings[:reporturl] } it { should == "http://localhost:3000/reports/upload" } end describe "when configuring color" do subject { Puppet.settings[:color] } it { should == "ansi" } end describe "daemonize" do it "should default to true", :unless => Puppet.features.microsoft_windows? do Puppet.settings[:daemonize].should == true end describe "on Windows", :if => Puppet.features.microsoft_windows? do it "should default to false" do Puppet.settings[:daemonize].should == false end it "should raise an error if set to true" do expect { Puppet.settings[:daemonize] = true }.to raise_error(/Cannot daemonize on Windows/) end end end describe "diff" do it "should default to 'diff' on POSIX", :unless => Puppet.features.microsoft_windows? do Puppet.settings[:diff].should == 'diff' end it "should default to '' on Windows", :if => Puppet.features.microsoft_windows? do Puppet.settings[:diff].should == '' end end describe "when configuring hiera" do it "should have a hiera_config setting" do Puppet.settings[:hiera_config].should_not be_nil end end describe "when configuring the data_binding terminus" do it "should have a data_binding_terminus setting" do Puppet.settings[:data_binding_terminus].should_not be_nil end it "should be set to hiera by default" do Puppet.settings[:data_binding_terminus].should == :hiera end end describe "agent_catalog_run_lockfile" do it "(#2888) is not a file setting so it is absent from the Settings catalog" do Puppet.settings.setting(:agent_catalog_run_lockfile).should_not be_a_kind_of Puppet::Settings::FileSetting Puppet.settings.setting(:agent_catalog_run_lockfile).should be_a Puppet::Settings::StringSetting end end end diff --git a/spec/integration/indirector/catalog/queue_spec.rb b/spec/integration/indirector/catalog/queue_spec.rb deleted file mode 100755 index 00f3f2e53..000000000 --- a/spec/integration/indirector/catalog/queue_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -#! /usr/bin/env ruby -require 'spec_helper' - -require 'puppet/resource/catalog' - -describe "Puppet::Resource::Catalog::Queue" do - before do - Puppet::Resource::Catalog.indirection.terminus(:queue) - @catalog = Puppet::Resource::Catalog.new("foo", Puppet::Node::Environment::NONE) - - @one = Puppet::Resource.new(:file, "/one") - @two = Puppet::Resource.new(:file, "/two") - @catalog.add_resource(@one, @two) - - @catalog.add_edge(@one, @two) - - Puppet[:trace] = true - end - - it "should render catalogs to pson and publish them via the queue client when catalogs are saved" do - terminus = Puppet::Resource::Catalog.indirection.terminus(:queue) - - client = mock 'client' - terminus.stubs(:client).returns client - - client.expects(:publish_message).with(:catalog, @catalog.to_pson) - - request = Puppet::Indirector::Request.new(:catalog, :save, "foo", @catalog) - - terminus.save(request) - end - - it "should intern catalog messages when they are passed via a subscription" do - client = mock 'client' - Puppet::Resource::Catalog::Queue.stubs(:client).returns client - - pson = @catalog.to_pson - - client.expects(:subscribe).with(:catalog).yields(pson) - - Puppet.expects(:err).never - - result = [] - Puppet::Resource::Catalog::Queue.subscribe do |catalog| - result << catalog - end - - catalog = result.shift - catalog.should be_instance_of(Puppet::Resource::Catalog) - - catalog.resource(:file, "/one").should be_instance_of(Puppet::Resource) - catalog.resource(:file, "/two").should be_instance_of(Puppet::Resource) - catalog.should be_edge(catalog.resource(:file, "/one"), catalog.resource(:file, "/two")) - end -end diff --git a/spec/unit/application/queue_spec.rb b/spec/unit/application/queue_spec.rb deleted file mode 100755 index 64c9a9708..000000000 --- a/spec/unit/application/queue_spec.rb +++ /dev/null @@ -1,168 +0,0 @@ -#! /usr/bin/env ruby -require 'spec_helper' - -require 'puppet/application/queue' -require 'puppet/indirector/catalog/queue' - -describe Puppet::Application::Queue, :unless => Puppet.features.microsoft_windows? do - before :each do - @queue = Puppet::Application[:queue] - @queue.stubs(:puts) - Puppet::Util::Log.stubs(:newdestination) - - Puppet::Resource::Catalog.indirection.stubs(:terminus_class=) - end - - it "should declare a main command" do - @queue.should respond_to(:main) - end - - it "should declare a preinit block" do - @queue.should respond_to(:preinit) - end - - describe "in preinit" do - it "should catch INT" do - Signal.expects(:trap).with { |arg,block| arg == :INT } - - @queue.preinit - end - - it "should init :verbose to false" do - @queue.preinit - - @queue.options[:verbose].should be_false - end - - it "should init :debug to false" do - @queue.preinit - - @queue.options[:debug].should be_false - end - end - - describe "when handling options" do - - [:debug, :verbose].each do |option| - it "should declare handle_#{option} method" do - @queue.should respond_to("handle_#{option}".to_sym) - end - - it "should store argument value when calling handle_#{option}" do - @queue.options.expects(:[]=).with(option, 'arg') - @queue.send("handle_#{option}".to_sym, 'arg') - end - end - end - - describe "during setup" do - let(:daemon) { stub("Daemon", :daemonize => nil, :argv= => []) } - - before :each do - Puppet::Daemon.stubs(:new).returns(daemon) - - @queue.preinit - @queue.options.stubs(:[]) - Puppet.stubs(:info) - Puppet.features.stubs(:stomp?).returns true - Puppet::Resource::Catalog.indirection.stubs(:terminus_class=) - Puppet.stubs(:settraps) - Puppet.settings.stubs(:print_config?) - Puppet.settings.stubs(:print_config) - end - - it "should fail if the stomp feature is missing" do - Puppet.features.expects(:stomp?).returns false - expect { @queue.setup }.to raise_error(ArgumentError) - end - - it "should issue a warning that queue is deprecated" do - Puppet.expects(:warning).with() { |msg| msg =~ /queue is deprecated/ } - @queue.setup - end - - it "should print puppet config if asked to in Puppet config" do - Puppet.settings.stubs(:print_configs?).returns(true) - Puppet.settings.expects(:print_configs).returns(true) - expect { @queue.setup }.to exit_with 0 - end - - it "should exit after printing puppet config if asked to in Puppet config" do - Puppet.settings.stubs(:print_configs?).returns(true) - expect { @queue.setup }.to exit_with 1 - end - - it "should call setup_logs" do - @queue.expects(:setup_logs) - @queue.setup - end - - describe "when setting up logs" do - before :each do - Puppet::Util::Log.stubs(:newdestination) - end - - it "should set log level to debug if --debug was passed" do - @queue.options.stubs(:[]).with(:debug).returns(true) - @queue.setup_logs - Puppet::Util::Log.level.should == :debug - end - - it "should set log level to info if --verbose was passed" do - @queue.options.stubs(:[]).with(:verbose).returns(true) - @queue.setup_logs - Puppet::Util::Log.level.should == :info - end - - [:verbose, :debug].each do |level| - it "should set console as the log destination with level #{level}" do - @queue.options.stubs(:[]).with(level).returns(true) - - Puppet::Util::Log.expects(:newdestination).with(:console) - - @queue.setup_logs - end - end - end - - it "should configure the Catalog class to use StoreConfigs" do - Puppet::Resource::Catalog.indirection.expects(:terminus_class=).with(:store_configs) - @queue.setup - end - - it "should daemonize if needed" do - Puppet[:daemonize] = true - - daemon.expects(:daemonize) - - @queue.setup - end - end - - describe "when running" do - before :each do - @queue.stubs(:sleep_forever) - Puppet::Resource::Catalog::Queue.stubs(:subscribe) - Thread.list.each { |t| t.stubs(:join) } - end - - it "should subscribe to the queue" do - Puppet::Resource::Catalog::Queue.expects(:subscribe) - @queue.main - end - - it "should log and save each catalog passed by the queue" do - catalog = Puppet::Resource::Catalog.new('eh') - Puppet::Resource::Catalog.indirection.expects(:save).with(catalog) - - Puppet::Resource::Catalog::Queue.expects(:subscribe).yields(catalog) - Puppet.expects(:notice).times(2) - @queue.main - end - - it "should join all of the running threads" do - Thread.list.each { |t| t.expects(:join) } - @queue.main - end - end -end diff --git a/spec/unit/indirector/catalog/queue_spec.rb b/spec/unit/indirector/catalog/queue_spec.rb deleted file mode 100755 index 99f33a35e..000000000 --- a/spec/unit/indirector/catalog/queue_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env ruby -require 'spec_helper' - -require 'puppet/indirector/catalog/queue' - -describe Puppet::Resource::Catalog::Queue do - it 'should be a subclass of the Queue terminus' do - Puppet::Resource::Catalog::Queue.superclass.should equal(Puppet::Indirector::Queue) - end - - it 'should be registered with the catalog store indirection' do - indirection = Puppet::Indirector::Indirection.instance(:catalog) - Puppet::Resource::Catalog::Queue.indirection.should equal(indirection) - end - - it 'shall be dubbed ":queue"' do - Puppet::Resource::Catalog::Queue.name.should == :queue - end -end diff --git a/spec/unit/indirector/queue_spec.rb b/spec/unit/indirector/queue_spec.rb deleted file mode 100755 index b14b4cbb3..000000000 --- a/spec/unit/indirector/queue_spec.rb +++ /dev/null @@ -1,115 +0,0 @@ -#! /usr/bin/env ruby -require 'spec_helper' -require 'puppet/indirector/queue' - -class Puppet::Indirector::Queue::TestClient -end - -class FooExampleData - attr_accessor :name - - def self.pson_create(pson) - new(pson['data'].to_sym) - end - - def initialize(name = nil) - @name = name if name - end - - def render(format = :pson) - to_pson - end - - def to_pson(*args) - {:type => self.class.to_s, :data => name}.to_pson(*args) - end -end - -describe Puppet::Indirector::Queue do - before :each do - @model = mock 'model' - @indirection = stub 'indirection', :name => :my_queue, :register_terminus_type => nil, :model => @model - Puppet::Indirector::Indirection.stubs(:instance).with(:my_queue).returns(@indirection) - module MyQueue; end - @store_class = class MyQueue::MyType < Puppet::Indirector::Queue - self - end - @store = @store_class.new - - @subject_class = FooExampleData - @subject = @subject_class.new - @subject.name = :me - - Puppet[:queue_type] = :test_client - Puppet::Util::Queue.stubs(:queue_type_to_class).with(:test_client).returns(Puppet::Indirector::Queue::TestClient) - - @request = stub 'request', :key => :me, :instance => @subject - end - - it 'should use the correct client type and queue' do - @store.queue.should == :my_queue - @store.client.should be_an_instance_of(Puppet::Indirector::Queue::TestClient) - end - - describe "when saving" do - it 'should render the instance using pson' do - @subject.expects(:render).with(:pson) - @store.client.stubs(:publish_message) - @store.save(@request) - end - - it "should publish the rendered message to the appropriate queue on the client" do - @subject.expects(:render).returns "mypson" - - @store.client.expects(:publish_message).with(:my_queue, "mypson") - - @store.save(@request) - end - - it "should catch any exceptions raised" do - @store.client.expects(:publish_message).raises ArgumentError - - expect { @store.save(@request) }.to raise_error(Puppet::Error) - end - end - - describe "when subscribing to the queue" do - before do - @store_class.stubs(:model).returns @model - end - - it "should use the model's Format support to intern the message from pson" do - @model.expects(:convert_from).with(:pson, "mymessage") - - @store_class.client.expects(:subscribe).yields("mymessage") - @store_class.subscribe {|o| o } - end - - it "should yield each interned received message" do - @model.stubs(:convert_from).returns "something" - - @subject_two = @subject_class.new - @subject_two.name = :too - - @store_class.client.expects(:subscribe).with(:my_queue).multiple_yields(@subject, @subject_two) - - received = [] - @store_class.subscribe do |obj| - received.push(obj) - end - - received.should == %w{something something} - end - - it "should log but not propagate errors" do - @store_class.client.expects(:subscribe).yields("foo") - @store_class.expects(:intern).raises(ArgumentError) - expect { @store_class.subscribe {|o| o } }.to_not raise_error - - @logs.length.should == 1 - @logs.first.message.should =~ /Error occurred with subscription to queue my_queue for indirection my_queue: ArgumentError/ - @logs.first.level.should == :err - end - end -end - diff --git a/spec/unit/util/queue/stomp_spec.rb b/spec/unit/util/queue/stomp_spec.rb deleted file mode 100755 index 8fdfb0192..000000000 --- a/spec/unit/util/queue/stomp_spec.rb +++ /dev/null @@ -1,137 +0,0 @@ -#! /usr/bin/env ruby -require 'spec_helper' -require 'puppet/util/queue' - -describe Puppet::Util::Queue, :if => Puppet.features.stomp? do - it 'should load :stomp client appropriately' do - Puppet::Util::Queue.queue_type_to_class(:stomp).name.should == 'Puppet::Util::Queue::Stomp' - end -end - -describe 'Puppet::Util::Queue::Stomp', :if => Puppet.features.stomp? do - before do - # So we make sure we never create a real client instance. - # Otherwise we'll try to connect, and that's bad. - Stomp::Client.stubs(:new).returns stub("client", :publish => true) - end - - it 'should be registered with Puppet::Util::Queue as :stomp type' do - Puppet::Util::Queue.queue_type_to_class(:stomp).should == Puppet::Util::Queue::Stomp - end - - describe "when initializing" do - it "should create a Stomp client instance" do - Stomp::Client.expects(:new).returns stub("stomp_client", :publish => true) - Puppet::Util::Queue::Stomp.new - end - - it "should provide helpful failures when the queue source is not a valid source" do - Puppet[:queue_source] = "-----" - - expect { Puppet::Util::Queue::Stomp.new }.to raise_error(ArgumentError, /not a Stomp URL/) - end - - it "should fail unless the queue source is a stomp URL" do - Puppet[:queue_source] = "http://foo/bar" - - expect { Puppet::Util::Queue::Stomp.new }.to raise_error(ArgumentError, /not a Stomp URL/) - end - - it "should fail somewhat helpfully if the Stomp client cannot be created" do - Stomp::Client.expects(:new).raises RuntimeError - expect { Puppet::Util::Queue::Stomp.new }.to raise_error(ArgumentError) - end - - list = %w{user password host port} - {"user" => "myuser", "password" => "mypass", "host" => "foohost", "port" => 42}.each do |name, value| - it "should use the #{name} from the queue source as the queueing #{name}" do - Puppet[:queue_source] = "stomp://myuser:mypass@foohost:42/" - - Stomp::Client.expects(:new).with { |*args| args[list.index(name)] == value } - Puppet::Util::Queue::Stomp.new - end - end - - it "should create a reliable client instance" do - Puppet[:queue_source] = "stomp://myuser@foohost:42/" - - Stomp::Client.expects(:new).with { |*args| args[4] == true } - Puppet::Util::Queue::Stomp.new - end - end - - describe "when publishing a message" do - before do - @client = stub 'client', :publish => true - Stomp::Client.stubs(:new).returns @client - @queue = Puppet::Util::Queue::Stomp.new - end - - it "should publish it to the queue client instance" do - @client.expects(:publish).with { |queue, msg, options| msg == "Smite!" } - @queue.publish_message('fooqueue', 'Smite!') - end - - it "should publish it to the transformed queue name" do - @client.expects(:publish).with { |queue, msg, options| queue == "/queue/fooqueue" } - @queue.publish_message('fooqueue', 'Smite!') - end - - it "should publish it as a persistent message" do - @client.expects(:publish).with { |queue, msg, options| options[:persistent] == true } - @queue.publish_message('fooqueue', 'Smite!') - end - - it "should use send when the gem does not support publish" do - Stomp::Client.stubs(:new).returns(stub('client', :send => true)) - Puppet::Util::Queue::Stomp.new.publish_message('fooqueue', 'Smite!') - end - end - - describe "when subscribing to a queue" do - before do - @client = stub 'client', :acknowledge => true, :publish => true - Stomp::Client.stubs(:new).returns @client - @queue = Puppet::Util::Queue::Stomp.new - end - - it "should subscribe via the queue client instance" do - @client.expects(:subscribe) - @queue.subscribe('fooqueue') - end - - it "should subscribe to the transformed queue name" do - @client.expects(:subscribe).with { |queue, options| queue == "/queue/fooqueue" } - @queue.subscribe('fooqueue') - end - - it "should specify that its messages should be acknowledged" do - @client.expects(:subscribe).with { |queue, options| options[:ack] == :client } - @queue.subscribe('fooqueue') - end - - it "should yield the body of any received message" do - message = mock 'message' - message.expects(:body).returns "mybody" - - @client.expects(:subscribe).yields(message) - - body = nil - @queue.subscribe('fooqueue') { |b| body = b } - body.should == "mybody" - end - - it "should acknowledge all successfully processed messages" do - message = stub 'message', :body => "mybode" - - @client.stubs(:subscribe).yields(message) - @client.expects(:acknowledge).with(message) - - @queue.subscribe('fooqueue') { |b| "eh" } - end - end - - it 'should transform the simple queue name to "/queue/"' do - Puppet::Util::Queue::Stomp.new.stompify_target('blah').should == '/queue/blah' - end -end diff --git a/spec/unit/util/queue_spec.rb b/spec/unit/util/queue_spec.rb deleted file mode 100755 index 48b98e8e3..000000000 --- a/spec/unit/util/queue_spec.rb +++ /dev/null @@ -1,94 +0,0 @@ -#! /usr/bin/env ruby -require 'spec_helper' -require 'puppet/util/queue' - -def make_test_client_class(n) - c = Class.new do - class < make_test_client_class('Bogus::Default'), :setup => make_test_client_class('Bogus::Setup') } - -describe Puppet::Util::Queue do - before :all do - mod.register_queue_type(client_classes[:default], :default) - mod.register_queue_type(client_classes[:setup], :setup) - end - - before :each do - @class = Class.new do - extend mod - end - end - - after :all do - instances = mod.instance_hash(:queue_clients) - [:default, :setup, :bogus, :aardvark, :conflict, :test_a, :test_b].each{ |x| instances.delete(x) } - end - - context 'when determining a type name from a class' do - it 'should handle a simple one-word class name' do - mod.queue_type_from_class(make_test_client_class('Foo')).should == :foo - end - - it 'should handle a simple two-word class name' do - mod.queue_type_from_class(make_test_client_class('FooBar')).should == :foo_bar - end - - it 'should handle a two-part class name with one terminating word' do - mod.queue_type_from_class(make_test_client_class('Foo::Bar')).should == :bar - end - - it 'should handle a two-part class name with two terminating words' do - mod.queue_type_from_class(make_test_client_class('Foo::BarBah')).should == :bar_bah - end - end - - context 'when registering a queue client class' do - c = make_test_client_class('Foo::Bogus') - it 'uses the proper default name logic when type is unspecified' do - mod.register_queue_type(c) - mod.queue_type_to_class(:bogus).should == c - end - - it 'uses an explicit type name when provided' do - mod.register_queue_type(c, :aardvark) - mod.queue_type_to_class(:aardvark).should == c - end - - it 'throws an exception when type names conflict' do - mod.register_queue_type( make_test_client_class('Conflict') ) - lambda { mod.register_queue_type( c, :conflict) }.should raise_error - end - - it 'handle multiple, non-conflicting registrations' do - a = make_test_client_class('TestA') - b = make_test_client_class('TestB') - mod.register_queue_type(a) - mod.register_queue_type(b) - mod.queue_type_to_class(:test_a).should == a - mod.queue_type_to_class(:test_b).should == b - end - - it 'throws an exception when type name is unknown' do - lambda { mod.queue_type_to_class(:nope) }.should raise_error - end - end - - context 'when determining client type' do - it 'returns client class based on the :queue_type setting' do - Puppet[:queue_type] = :myqueue - Puppet::Util::Queue.expects(:queue_type_to_class).with(:myqueue).returns "eh" - @class.client_class.should == "eh" - end - end -end