From 384ffd957153f65eb4f47b3142d98853c31b4124 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Wed, 23 Feb 2011 14:05:56 -0500 Subject: Initial commit --- Modulefile | 11 +++++++++++ README | 3 +++ files/README.markdown | 22 ++++++++++++++++++++++ lib/puppet/facter/README.markdown | 22 ++++++++++++++++++++++ lib/puppet/parser/functions/README.markdown | 17 +++++++++++++++++ lib/puppet/provider/README.markdown | 14 ++++++++++++++ lib/puppet/type/README.markdown | 14 ++++++++++++++ manifests/README.markdown | 28 ++++++++++++++++++++++++++++ manifests/init.pp | 17 +++++++++++++++++ metadata.json | 12 ++++++++++++ spec/README.markdown | 7 +++++++ spec/spec.opts | 6 ++++++ spec/spec_helper.rb | 18 ++++++++++++++++++ spec/unit/puppet/provider/README.markdown | 4 ++++ spec/unit/puppet/type/README.markdown | 4 ++++ templates/README.markdown | 23 +++++++++++++++++++++++ tests/init.pp | 1 + 17 files changed, 223 insertions(+) create mode 100644 Modulefile create mode 100644 README create mode 100644 files/README.markdown create mode 100644 lib/puppet/facter/README.markdown create mode 100644 lib/puppet/parser/functions/README.markdown create mode 100644 lib/puppet/provider/README.markdown create mode 100644 lib/puppet/type/README.markdown create mode 100644 manifests/README.markdown create mode 100644 manifests/init.pp create mode 100644 metadata.json create mode 100644 spec/README.markdown create mode 100644 spec/spec.opts create mode 100644 spec/spec_helper.rb create mode 100644 spec/unit/puppet/provider/README.markdown create mode 100644 spec/unit/puppet/type/README.markdown create mode 100644 templates/README.markdown create mode 100644 tests/init.pp diff --git a/Modulefile b/Modulefile new file mode 100644 index 0000000..6bd6675 --- /dev/null +++ b/Modulefile @@ -0,0 +1,11 @@ +name 'jeffmccune-ntp' +version '0.0.1' +source 'UNKNOWN' +author 'jeffmccune' +license 'UNKNOWN' +summary 'UNKNOWN' +description 'UNKNOWN' +project_page 'UNKNOWN' + +## Add dependencies, if any: +# dependency 'username/name', '>= 1.2.0' diff --git a/README b/README new file mode 100644 index 0000000..66db4e8 --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +ntp + +This is the ntp module. diff --git a/files/README.markdown b/files/README.markdown new file mode 100644 index 0000000..be52188 --- /dev/null +++ b/files/README.markdown @@ -0,0 +1,22 @@ +Files +===== + +Puppet comes with both a client and server for copying files around. The file +serving function is provided as part of the central Puppet daemon, +puppetmasterd, and the client function is used through the source attribute of +file objects. Learn more at +http://projects.puppetlabs.com/projects/puppet/wiki/File_Serving_Configuration + +You can use managed files like this: + + class myclass { + package { mypackage: ensure => latest } + service { myservice: ensure => running } + file { "/etc/myfile": + source => "puppet://$servername/modules/mymodule/myfile" + } + } + +The files are searched for in: + + $modulepath/mymodule/files/myfile diff --git a/lib/puppet/facter/README.markdown b/lib/puppet/facter/README.markdown new file mode 100644 index 0000000..2b96273 --- /dev/null +++ b/lib/puppet/facter/README.markdown @@ -0,0 +1,22 @@ +Facter +====== + +Define facts in this directory. + +Sometimes you need to be able to write conditional expressions based +on site-specific data that just isn’t available via Facter. The +solution may be to add a fact to Facter. These additional facts can +then be distributed to Puppet clients and are available for use in +manifests. Learn more at +http://projects.puppetlabs.com/projects/puppet/wiki/Adding_Facts + +File paths should match the fact name; for example, a fact +`hardware_platform`, defined like this: + + Facter.add("hardware_platform") do + setcode do + %x{/bin/uname -i}.chomp + end + end + +Should be found in `hardware_platform.rb` in this directory. diff --git a/lib/puppet/parser/functions/README.markdown b/lib/puppet/parser/functions/README.markdown new file mode 100644 index 0000000..15d7495 --- /dev/null +++ b/lib/puppet/parser/functions/README.markdown @@ -0,0 +1,17 @@ +Functions +========= + +Define functions in this directory. + +File paths should match the function name; for example, a function +`myfunction`, defined like this: + + Puppet::Parser::Functions::newfunction( + :myfunction, + :type => :statement, + :doc => "Documentation here." + ) do |vals| + # ... + end + +Should be found in `myfunction.rb` in this directory. diff --git a/lib/puppet/provider/README.markdown b/lib/puppet/provider/README.markdown new file mode 100644 index 0000000..27aa1a9 --- /dev/null +++ b/lib/puppet/provider/README.markdown @@ -0,0 +1,14 @@ +Providers +========= + +Define providers under this directory. + +File paths should match the resource type name and provider name; for +example, a provider `myprovider` for a resource type `mytype`, defined like this: + + Puppet::Type.type(:mytype).provide(:myprovider) do + desc "Documentation here" + # ... + end + +Should be found in `mytype/myprovider.rb` under this directory. diff --git a/lib/puppet/type/README.markdown b/lib/puppet/type/README.markdown new file mode 100644 index 0000000..7a169c7 --- /dev/null +++ b/lib/puppet/type/README.markdown @@ -0,0 +1,14 @@ +Resource Types +============== + +Define resource types in this directory. + +Filenames should match the resource type name; for example, a resource +type `mytype`, defined like this: + + Puppet::Type.newtype(:mytype) do + @doc = "Documentation here." + # ... + end + +Should be found in `mytype.rb` diff --git a/manifests/README.markdown b/manifests/README.markdown new file mode 100644 index 0000000..bbf645a --- /dev/null +++ b/manifests/README.markdown @@ -0,0 +1,28 @@ +Manifests +========= + +Module manifest files belong in this directory. + +`init.pp` defines how the module will carry out its tasks in this file. + +Add additional definitions in this directory. Their file paths should match the +definition name; for example, a definition `mydefinition`, defined like this: + + # Definition: mydefinition + # + # This is the mydefinition in the mymodule module. + # + # Parameters: + # + # Actions: + # + # Requires: + # + # Sample Usage: + # + # [Remember: No empty lines between comments and class definition] + define mydefinition { + # ... + } + +Should be found in `mydefinition.pp` in this directory. diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..0c12c7e --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,17 @@ +# Class: ntp +# +# This module manages ntp +# +# Parameters: +# +# Actions: +# +# Requires: +# +# Sample Usage: +# +# [Remember: No empty lines between comments and class definition] +class ntp { + + +} diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..8ce7797 --- /dev/null +++ b/metadata.json @@ -0,0 +1,12 @@ +/* ++-----------------------------------------------------------------------+ +| | +| ==> DO NOT EDIT THIS FILE! <== | +| | +| You should edit the `Modulefile` and run `puppet-module build` | +| to generate the `metadata.json` file for your releases. | +| | ++-----------------------------------------------------------------------+ +*/ + +{} diff --git a/spec/README.markdown b/spec/README.markdown new file mode 100644 index 0000000..286d341 --- /dev/null +++ b/spec/README.markdown @@ -0,0 +1,7 @@ +Specs +===== + +The Puppet project uses RSpec for testing. + +For more information on RSpec, see http://rspec.info/ + diff --git a/spec/spec.opts b/spec/spec.opts new file mode 100644 index 0000000..91cd642 --- /dev/null +++ b/spec/spec.opts @@ -0,0 +1,6 @@ +--format +s +--colour +--loadby +mtime +--backtrace diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..a4aeeae --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,18 @@ +require 'pathname' +dir = Pathname.new(__FILE__).parent +$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib') + +require 'mocha' +require 'puppet' +gem 'rspec', '=1.2.9' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end diff --git a/spec/unit/puppet/provider/README.markdown b/spec/unit/puppet/provider/README.markdown new file mode 100644 index 0000000..7025850 --- /dev/null +++ b/spec/unit/puppet/provider/README.markdown @@ -0,0 +1,4 @@ +Provider Specs +============== + +Define specs for your providers under this directory. diff --git a/spec/unit/puppet/type/README.markdown b/spec/unit/puppet/type/README.markdown new file mode 100644 index 0000000..1ee19ac --- /dev/null +++ b/spec/unit/puppet/type/README.markdown @@ -0,0 +1,4 @@ +Resource Type Specs +=================== + +Define specs for your resource types in this directory. diff --git a/templates/README.markdown b/templates/README.markdown new file mode 100644 index 0000000..575bbea --- /dev/null +++ b/templates/README.markdown @@ -0,0 +1,23 @@ +Templates +========= + +Puppet supports templates and templating via ERB, which is part of the Ruby +standard library and is used for many other projects including Ruby on Rails. +Templates allow you to manage the content of template files, for example +configuration files that cannot yet be managed as a Puppet type. Learn more at +http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Templating + +You can use templates like this: + + class myclass { + package { mypackage: ensure => latest } + service { myservice: ensure => running } + file { "/etc/myfile": + content => template("mymodule/myfile.erb") + } + } + +The templates are searched for in: + + $templatedir/mymodule/myfile.erb + $modulepath/mymodule/templates/myfile.erb diff --git a/tests/init.pp b/tests/init.pp new file mode 100644 index 0000000..9f87de7 --- /dev/null +++ b/tests/init.pp @@ -0,0 +1 @@ +include ntp -- cgit v1.2.3