summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
2013-09-19(Maint) Update commands to use new forms in hiera examplesAndrew Parker1-4/+4
The hiera examples were written assuming that puppet apply was just puppet (the old form), and that hiera was not always available (and so set the libdir).
2013-09-19(Maint) Remove unused example manifestsAndrew Parker7-394/+0
These manifests seem to have been created when some various issues were fixed and functionality was added. However, they are not a comprehensive (nor updated) example of how to use puppet. Keeping them here probably ends up being a distraction for those who find them.
2012-12-10Maint: Remove sample_module exampleNick Fagerlund4-63/+0
We already have enough documentation of basic module structure.
2012-12-10Maint: Remove mac_dscl and pkgdmg examplesNick Fagerlund3-61/+0
These are basic user/group/package resources, and need no further documentation beyond the type reference.
2012-12-10Maint: Remove "ghost file" to obtain extra power from deathless wraithsNick Fagerlund1-0/+0
2012-12-10Maint: Move example fileserver.conf and tagmail.conf files to confNick Fagerlund2-14/+0
2012-12-10Maint: Remove a lot of messy and ancient do-nothing code from examplesNick Fagerlund19-497/+0
It's not clear what this code was doing in there, and it has not been touched in years. I am pretty sure it was just unused clutter.
2012-12-10Maint: Remove outdated example puppet.confNick Fagerlund1-10/+0
This example file used the old and now disabled [puppetd]-style config blocks. Since it appeared to be unused and unmaintained, it seemed safer to delete it than to update it and wait for it to fall out of sync again.
2012-12-10Maint: Remove example namespaceauth.conf filesNick Fagerlund1-20/+0
Namespaceauth.conf is dead dead dead. These example files are no longer useful.
2012-11-15(Maint) fixing all lint warningsHenrik7-9/+15
This commit changes the examples provided for hiera-puppet so that they conform to the puppet coding guidelines as enforced by puppet-lint
2012-09-30sample_module.pp refactored text: include sample-module into include ↵Niels Abspoel1-1/+1
sample_module
2012-09-30This will fix Refactor #16643.Niels Abspoel5-18/+1
The Hyphen ‘–’ in name only unofficially supported in some puppet versions. Fix: sample-module name changed into sample_module which is supported.
2012-09-05Clean up the Hiera Puppet integration.Daniel Pittman14-0/+146
This updates the tests to work correctly in the Puppet environment, rather than running as part of a separate repository and package. It also moves the examples into a more appropriate location. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-02-28(#6338) Remove unused version control tagsMatt Robinson1-2/+0
Older version control systems like CVS and SVN used to use these $Id$ tags for version information. Paired-with: Nick Lewis
2011-02-15(#6331) Inline documentation: Fix rotted links pointing at the Trac wikinfagerlund1-2/+2
This patch updates links in three files and marks a link in a fourth file as unrecoverable.
2010-07-15Fixes errant Trac references in documentationJames Turnbull2-2/+2
2010-07-09Code smell: Two space indentationMarkus Roberts1-3/+3
Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
2010-07-09Code smell: Use string interpolationMarkus Roberts1-1/+1
* Replaced 83 occurances of (.*)" *[+] *([$@]?[\w_0-9.:]+?)(.to_s\b)?(?! *[*(%\w_0-9.:{\[]) with \1#{\2}" 3 Examples: The code: puts "PUPPET " + status + ": " + process + ", " + state becomes: puts "PUPPET " + status + ": " + process + ", #{state}" The code: puts "PUPPET " + status + ": #{process}" + ", #{state}" becomes: puts "PUPPET #{status}" + ": #{process}" + ", #{state}" The code: }.compact.join( "\n" ) + "\n" + t + "]\n" becomes: }.compact.join( "\n" ) + "\n#{t}" + "]\n" * Replaced 21 occurances of (.*)" *[+] *" with \1 3 Examples: The code: puts "PUPPET #{status}" + ": #{process}" + ", #{state}" becomes: puts "PUPPET #{status}" + ": #{process}, #{state}" The code: puts "PUPPET #{status}" + ": #{process}, #{state}" becomes: puts "PUPPET #{status}: #{process}, #{state}" The code: res = self.class.name + ": #{@name}" + "\n" becomes: res = self.class.name + ": #{@name}\n" * Don't use string concatenation to split lines unless they would be very long. Replaced 11 occurances of (.*)(['"]) *[+] *(['"])(.*) with 3 Examples: The code: o.define_head "The check_puppet Nagios plug-in checks that specified " + "Puppet process is running and the state file is no " + becomes: o.define_head "The check_puppet Nagios plug-in checks that specified Puppet process is running and the state file is no " + The code: o.separator "Mandatory arguments to long options are mandatory for " + "short options too." becomes: o.separator "Mandatory arguments to long options are mandatory for short options too." The code: o.define_head "The check_puppet Nagios plug-in checks that specified Puppet process is running and the state file is no " + "older than specified interval." becomes: o.define_head "The check_puppet Nagios plug-in checks that specified Puppet process is running and the state file is no older than specified interval." * Replaced no occurances of do (.*?) end with {\1} * Replaced 1488 occurances of "([^"\n]*%s[^"\n]*)" *% *(.+?)(?=$| *\b(do|if|while|until|unless|#)\b) with 20 Examples: The code: args[0].split(/\./).map do |s| "dc=%s"%[s] end.join(",") becomes: args[0].split(/\./).map do |s| "dc=#{s}" end.join(",") The code: puts "%s" % Puppet.version becomes: puts "#{Puppet.version}" The code: raise "Could not find information for %s" % node becomes: raise "Could not find information for #{node}" The code: raise Puppet::Error, "Cannot create %s: basedir %s is a file" % [dir, File.join(path)] becomes: raise Puppet::Error, "Cannot create #{dir}: basedir #{File.join(path)} is a file" The code: Puppet.err "Could not run %s: %s" % [client_class, detail] becomes: Puppet.err "Could not run #{client_class}: #{detail}" The code: raise "Could not find handler for %s" % arg becomes: raise "Could not find handler for #{arg}" The code: Puppet.err "Will not start without authorization file %s" % Puppet[:authconfig] becomes: Puppet.err "Will not start without authorization file #{Puppet[:authconfig]}" The code: raise Puppet::Error, "Could not deserialize catalog from pson: %s" % detail becomes: raise Puppet::Error, "Could not deserialize catalog from pson: #{detail}" The code: raise "Could not find facts for %s" % Puppet[:certname] becomes: raise "Could not find facts for #{Puppet[:certname]}" The code: raise ArgumentError, "%s is not readable" % path becomes: raise ArgumentError, "#{path} is not readable" The code: raise ArgumentError, "Invalid handler %s" % name becomes: raise ArgumentError, "Invalid handler #{name}" The code: debug "Executing '%s' in zone %s with '%s'" % [command, @resource[:name], str] becomes: debug "Executing '#{command}' in zone #{@resource[:name]} with '#{str}'" The code: raise Puppet::Error, "unknown cert type '%s'" % hash[:type] becomes: raise Puppet::Error, "unknown cert type '#{hash[:type]}'" The code: Puppet.info "Creating a new certificate request for %s" % Puppet[:certname] becomes: Puppet.info "Creating a new certificate request for #{Puppet[:certname]}" The code: "Cannot create alias %s: object already exists" % [name] becomes: "Cannot create alias #{name}: object already exists" The code: return "replacing from source %s with contents %s" % [metadata.source, metadata.checksum] becomes: return "replacing from source #{metadata.source} with contents #{metadata.checksum}" The code: it "should have a %s parameter" % param do becomes: it "should have a #{param} parameter" do The code: describe "when registring '%s' messages" % log do becomes: describe "when registring '#{log}' messages" do The code: paths = %w{a b c d e f g h}.collect { |l| "/tmp/iteration%stest" % l } becomes: paths = %w{a b c d e f g h}.collect { |l| "/tmp/iteration#{l}test" } The code: assert_raise(Puppet::Error, "Check '%s' did not fail on false" % check) do becomes: assert_raise(Puppet::Error, "Check '#{check}' did not fail on false") do
2010-02-17Fixes #3460 - Makes Puppet FHS compliant by moving /var/puppet to ↵James Turnbull1-5/+5
/var/lib/puppet
2009-07-14deprecate NetInfo providers and examples, remove all NetInfo references and ↵Nigel Kersten1-5/+0
tests.
2009-06-06Removed extra whitespace from end of linesIan Taylor5-8/+8
2009-06-06Changed tabs to spaces without interfering with indentation or alignmentIan Taylor5-335/+335
2008-12-01type/mcx.rb Feature #1026 - MCX TypeJeffrey McCune6-0/+378
Added new MCX type and base test. This type manages MCX settings on DirectoryService nodes. These settings take the form of plist XML documents attached to Users, Groups, and Computers in DirectoryService.
2008-07-15Further moves from the examples directory and ext directoryJames Turnbull6-0/+116
2008-07-10Moved debian to conf and updated examples directoryJames Turnbull38-283/+0
2008-04-04Changed some non-standard Ruby locations to env ruby shebangsJames Turnbull1-1/+1
2008-01-28Fixed #1028 - examples incorrect for 0.24.xJames Turnbull2-7/+6
2007-08-14Added optional per-module lib directory.Jeffrey J McCune5-0/+80
Puppet now looks for a lib directory inside each module bundle, and adds the directory to the list searched by Puppet::Util::Autoload. The intent is to facilitate more sophisticated virtual types and flexibility within modules.
2007-08-03DirectoryService provider for users and groups. Alternative to netinfo, as ↵mccune4-0/+66
apple has indicated NetInfo may go away at some point in the future. It might happen in October. FIXME: implement groups and groups= instances methods for Puppet::Type::User::ProviderDirectoryservice git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2739 980ebf18-57e1-0310-9a29-db15c13687c0
2007-04-03Fix for #565: Final merge of changes from source:branches/execute-refactor ↵mccune1-0/+16
into source:trunk Generated with svn merge -r 2378:HEAD https://reductivelabs.com/svn/puppet/branches/execute-refactor trunk CHANGES: - Puppet::Util#execute now takes hash key/value pairs as arguments after the command array. - Processes executed from the base service provider are now silenced. That is, their standard input, output, and error pipes are all directed to /dev/null. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2385 980ebf18-57e1-0310-9a29-db15c13687c0
2006-12-29exiting sleeper after no more than two minutesluke1-5/+3
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1992 980ebf18-57e1-0310-9a29-db15c13687c0
2006-11-12adding a comment to namespaceauth.confluke1-0/+3
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1862 980ebf18-57e1-0310-9a29-db15c13687c0
2006-11-12adding up-to-date example configsluke5-11/+40
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1861 980ebf18-57e1-0310-9a29-db15c13687c0
2006-10-04Merging the changes from the override-refactor branch. This is a ↵luke33-507/+0
significant rewrite of the parser, but it has little affect on the rest of the code tree. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0
2006-09-15Removing a test in the parser that is no longer necessary because of how ↵luke1-2/+2
imports work now, and fixing a snippet not to interfere with a local fact git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1606 980ebf18-57e1-0310-9a29-db15c13687c0
2006-09-05Adding hasrestart parameter to servicesluke1-0/+6
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1569 980ebf18-57e1-0310-9a29-db15c13687c0
2006-08-28Tracking down some weird bugs that managed to creep into the parser. I ↵luke1-1/+1
expect that the main ones were a result of the If support. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1494 980ebf18-57e1-0310-9a29-db15c13687c0
2006-08-17Finishing changes to support titles instead of two types of names. This is ↵luke4-4/+4
basically a bug-fix commit. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1472 980ebf18-57e1-0310-9a29-db15c13687c0
2006-08-14Merging r1468 from the implementations branch with r1438 from when the ↵luke1-1/+1
branch was first created. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1469 980ebf18-57e1-0310-9a29-db15c13687c0
2006-08-07removing classing example, since it involves parameterized classesluke1-35/+0
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1450 980ebf18-57e1-0310-9a29-db15c13687c0
2006-07-22Another batch of bug fixes, this time focused on OS X patches. Looks like I ↵luke1-1/+2
did not test on os x last time. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1422 980ebf18-57e1-0310-9a29-db15c13687c0
2006-07-21Apparently objects were legal rvalues, which does not make any sense. Fixed ↵luke1-0/+1
this, and added a test verify. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1418 980ebf18-57e1-0310-9a29-db15c13687c0
2006-06-15Adding test and fix for empty execs being ignoredluke1-0/+2
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1288 980ebf18-57e1-0310-9a29-db15c13687c0
2006-06-09Found a bug where single-value selectors can fail on a second compile. ↵luke1-1/+6
Fixed it, and am now compiling all snippets twice. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1250 980ebf18-57e1-0310-9a29-db15c13687c0
2006-05-12Fixing #141. It was a problem related to the recent parser changes I made.luke1-0/+23
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1185 980ebf18-57e1-0310-9a29-db15c13687c0
2006-05-09It is just a snippet test, and thus a functional test but not a coverage ↵luke1-0/+17
test, but definition overrides officially work. This was important because it enables definitions to be collectable, which was not possible without the mechanism that enables this. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1181 980ebf18-57e1-0310-9a29-db15c13687c0
2006-04-26This should have been in 0.16.1. Moving the "setclass" statements around so ↵luke1-0/+10
that classes are set before a given class's code is evaluated, so it can be tested within the code, within node defs, components, or classes. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1139 980ebf18-57e1-0310-9a29-db15c13687c0
2006-04-26Creating a simplistic, generic function framework in the parser, so it is ↵luke1-0/+25
now very easy to add new functions. There is a pretty crappy, hardwired distinction between functions that return values and those that do not, but I do not see a good way around it right now. Functions are also currently responsible for handling their own arity, although I have plans for fixing that. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1134 980ebf18-57e1-0310-9a29-db15c13687c0
2006-04-17Fixing a bunch of small bugs, mostly found by testing on solaris, and added ↵luke1-0/+0
a check to the test system that points out memory growth git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1113 980ebf18-57e1-0310-9a29-db15c13687c0
2006-04-13changing set to tag in the testsluke1-2/+2
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1112 980ebf18-57e1-0310-9a29-db15c13687c0