diff --git a/clonos_network/Gemfile b/clonos_network/Gemfile new file mode 100644 index 0000000..4f662dc --- /dev/null +++ b/clonos_network/Gemfile @@ -0,0 +1,18 @@ +source ENV['GEM_SOURCE'] || 'https://rubygems.org' + +puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3'] +gem 'metadata-json-lint' +gem 'puppet', puppetversion +gem 'puppetlabs_spec_helper', '>= 1.0.0' +gem 'puppet-lint', '>= 1.0.0' +gem 'facter', '>= 1.7.0' +gem 'rspec-puppet' + +# rspec must be v2 for ruby 1.8.7 +if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' + gem 'rspec', '~> 2.0' + gem 'rake', '~> 10.0' +else + # rubocop requires ruby >= 1.9 + gem 'rubocop' +end diff --git a/clonos_network/README.md b/clonos_network/README.md new file mode 100644 index 0000000..ec9fa16 --- /dev/null +++ b/clonos_network/README.md @@ -0,0 +1,83 @@ +# clonos_network + +#### Table of Contents + +1. [Description](#description) +1. [Setup - The basics of getting started with clonos_network](#setup) + * [What clonos_network affects](#what-clonos_network-affects) + * [Setup requirements](#setup-requirements) + * [Beginning with clonos_network](#beginning-with-clonos_network) +1. [Usage - Configuration options and additional functionality](#usage) +1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) +1. [Limitations - OS compatibility, etc.](#limitations) +1. [Development - Guide for contributing to the module](#development) + +## Description + +Start with a one- or two-sentence summary of what the module does and/or what +problem it solves. This is your 30-second elevator pitch for your module. +Consider including OS/Puppet version it works with. + +You can give more descriptive information in a second paragraph. This paragraph +should answer the questions: "What does this module *do*?" and "Why would I use +it?" If your module has a range of functionality (installation, configuration, +management, etc.), this is the time to mention it. + +## Setup + +### What clonos_network affects **OPTIONAL** + +If it's obvious what your module touches, you can skip this section. For +example, folks can probably figure out that your mysql_instance module affects +their MySQL instances. + +If there's more that they should know about, though, this is the place to mention: + +* A list of files, packages, services, or operations that the module will alter, + impact, or execute. +* Dependencies that your module automatically installs. +* Warnings or other important notices. + +### Setup Requirements **OPTIONAL** + +If your module requires anything extra before setting up (pluginsync enabled, +etc.), mention it here. + +If your most recent release breaks compatibility or requires particular steps +for upgrading, you might want to include an additional "Upgrading" section +here. + +### Beginning with clonos_network + +The very basic steps needed for a user to get the module up and running. This +can include setup steps, if necessary, or it can be an example of the most +basic use of the module. + +## Usage + +This section is where you describe how to customize, configure, and do the +fancy stuff with your module here. It's especially helpful if you include usage +examples and code samples for doing things with your module. + +## Reference + +Here, include a complete list of your module's classes, types, providers, +facts, along with the parameters for each. Users refer to this section (thus +the name "Reference") to find specific details; most users don't read it per +se. + +## Limitations + +This is where you list OS compatibility, version compatibility, etc. If there +are Known Issues, you might want to include them under their own heading here. + +## Development + +Since your module is awesome, other users will want to play with it. Let them +know what the ground rules for contributing are. + +## Release Notes/Contributors/Etc. **Optional** + +If you aren't using changelog, put your release notes here (though you should +consider using changelog). You can also add any additional sections you feel +are necessary or important to include here. Please use the `## ` header. diff --git a/clonos_network/Rakefile b/clonos_network/Rakefile new file mode 100644 index 0000000..02609e3 --- /dev/null +++ b/clonos_network/Rakefile @@ -0,0 +1,32 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'metadata-json-lint/rake_task' + +if RUBY_VERSION >= '1.9' + require 'rubocop/rake_task' + RuboCop::RakeTask.new +end + +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.relative = true +PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp'] + +desc 'Validate manifests, templates, and ruby files' +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures} + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end + +desc 'Run metadata_lint, lint, validate, and spec tests.' +task :test do + [:metadata_lint, :lint, :validate, :spec].each do |test| + Rake::Task[test].invoke + end +end diff --git a/clonos_network/examples/init.pp b/clonos_network/examples/init.pp new file mode 100644 index 0000000..46ffd3a --- /dev/null +++ b/clonos_network/examples/init.pp @@ -0,0 +1,12 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: +# https://docs.puppet.com/guides/tests_smoke.html +# +include ::clonos_network diff --git a/clonos_network/manifests/init.pp b/clonos_network/manifests/init.pp new file mode 100644 index 0000000..1cae945 --- /dev/null +++ b/clonos_network/manifests/init.pp @@ -0,0 +1,82 @@ +# Class: clonos_network +# =========================== +# +# Full description of class clonos_network here. +# +# Parameters +# ---------- +# +# Document parameters here. +# +# * `sample parameter` +# Explanation of what this parameter affects and what it defaults to. +# e.g. "Specify one or more upstream ntp servers as an array." +# +# Variables +# ---------- +# +# Here you should define a list of variables that this module would require. +# +# * `sample variable` +# Explanation of how this variable affects the function of this class and if +# it has a default. e.g. "The parameter enc_ntp_servers must be set by the +# External Node Classifier as a comma separated list of hostnames." (Note, +# global variables should be avoided in favor of class parameters as +# of Puppet 2.6.) +# +# Examples +# -------- +# +# @example +# class { 'clonos_network': +# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ], +# } +# +# Authors +# ------- +# +# Author Name +# +# Copyright +# --------- +# +# Copyright 2016 Your name here, unless otherwise noted. +# +class clonos_network ( + $uplink_interface = $clonos_network::params::uplink_interface, + $ip4_addr = $clonos_network::params::ip4_addr, + $ip4_gateway = $clonos_network::params::ip4_gateway, + $ip4_mask = $clonos_network::params::ip4_mask, + $hostname = $clonos_network::params::hostname, +) inherits clonos_network::params { + + Shellvar { target => '/etc/rc.conf' } + + # interface + if $uplink_interface { + if $ip4_addr and $ip4_mask == undef { + shellvar { "ifconfig_$uplink_interface": + value => "$ip4_addr", + } + } + + if $ip4_addr and $ip4_mask != undef { + shellvar { "ifconfig_$uplink_interface": + value => "$ip4_addr netmask $ip4_mask", + } + } + } + + if $hostname { + shellvar { "hostname": + value => "$hostname", + } + } + + if $ip4_gateway { + shellvar { "defaultrouter": + value => "$ip4_gateway", + } + } + +} diff --git a/clonos_network/manifests/params.pp b/clonos_network/manifests/params.pp new file mode 100644 index 0000000..cca6042 --- /dev/null +++ b/clonos_network/manifests/params.pp @@ -0,0 +1,7 @@ +class clonos_network::params { + $uplink_interface = undef + $ip4_addr = undef + $ip4_gateway = undef + $ip4_mask = undef + $hostname = undef +} diff --git a/clonos_network/metadata.json b/clonos_network/metadata.json new file mode 100644 index 0000000..584a25c --- /dev/null +++ b/clonos_network/metadata.json @@ -0,0 +1,15 @@ +{ + "name": "clonos-clonos_network", + "version": "0.1.0", + "author": "clonos", + "summary": null, + "license": "Apache-2.0", + "source": "", + "project_page": null, + "issues_url": null, + "dependencies": [ + {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"} + ], + "data_provider": null +} + diff --git a/clonos_network/spec/classes/init_spec.rb b/clonos_network/spec/classes/init_spec.rb new file mode 100644 index 0000000..9c55230 --- /dev/null +++ b/clonos_network/spec/classes/init_spec.rb @@ -0,0 +1,6 @@ +require 'spec_helper' +describe 'clonos_network' do + context 'with default values for all parameters' do + it { should contain_class('clonos_network') } + end +end diff --git a/clonos_network/spec/spec_helper.rb b/clonos_network/spec/spec_helper.rb new file mode 100644 index 0000000..2c6f566 --- /dev/null +++ b/clonos_network/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/clonos_userspw/Gemfile b/clonos_userspw/Gemfile new file mode 100644 index 0000000..4f662dc --- /dev/null +++ b/clonos_userspw/Gemfile @@ -0,0 +1,18 @@ +source ENV['GEM_SOURCE'] || 'https://rubygems.org' + +puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3'] +gem 'metadata-json-lint' +gem 'puppet', puppetversion +gem 'puppetlabs_spec_helper', '>= 1.0.0' +gem 'puppet-lint', '>= 1.0.0' +gem 'facter', '>= 1.7.0' +gem 'rspec-puppet' + +# rspec must be v2 for ruby 1.8.7 +if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' + gem 'rspec', '~> 2.0' + gem 'rake', '~> 10.0' +else + # rubocop requires ruby >= 1.9 + gem 'rubocop' +end diff --git a/clonos_userspw/README.md b/clonos_userspw/README.md new file mode 100644 index 0000000..ec9fa16 --- /dev/null +++ b/clonos_userspw/README.md @@ -0,0 +1,83 @@ +# clonos_network + +#### Table of Contents + +1. [Description](#description) +1. [Setup - The basics of getting started with clonos_network](#setup) + * [What clonos_network affects](#what-clonos_network-affects) + * [Setup requirements](#setup-requirements) + * [Beginning with clonos_network](#beginning-with-clonos_network) +1. [Usage - Configuration options and additional functionality](#usage) +1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) +1. [Limitations - OS compatibility, etc.](#limitations) +1. [Development - Guide for contributing to the module](#development) + +## Description + +Start with a one- or two-sentence summary of what the module does and/or what +problem it solves. This is your 30-second elevator pitch for your module. +Consider including OS/Puppet version it works with. + +You can give more descriptive information in a second paragraph. This paragraph +should answer the questions: "What does this module *do*?" and "Why would I use +it?" If your module has a range of functionality (installation, configuration, +management, etc.), this is the time to mention it. + +## Setup + +### What clonos_network affects **OPTIONAL** + +If it's obvious what your module touches, you can skip this section. For +example, folks can probably figure out that your mysql_instance module affects +their MySQL instances. + +If there's more that they should know about, though, this is the place to mention: + +* A list of files, packages, services, or operations that the module will alter, + impact, or execute. +* Dependencies that your module automatically installs. +* Warnings or other important notices. + +### Setup Requirements **OPTIONAL** + +If your module requires anything extra before setting up (pluginsync enabled, +etc.), mention it here. + +If your most recent release breaks compatibility or requires particular steps +for upgrading, you might want to include an additional "Upgrading" section +here. + +### Beginning with clonos_network + +The very basic steps needed for a user to get the module up and running. This +can include setup steps, if necessary, or it can be an example of the most +basic use of the module. + +## Usage + +This section is where you describe how to customize, configure, and do the +fancy stuff with your module here. It's especially helpful if you include usage +examples and code samples for doing things with your module. + +## Reference + +Here, include a complete list of your module's classes, types, providers, +facts, along with the parameters for each. Users refer to this section (thus +the name "Reference") to find specific details; most users don't read it per +se. + +## Limitations + +This is where you list OS compatibility, version compatibility, etc. If there +are Known Issues, you might want to include them under their own heading here. + +## Development + +Since your module is awesome, other users will want to play with it. Let them +know what the ground rules for contributing are. + +## Release Notes/Contributors/Etc. **Optional** + +If you aren't using changelog, put your release notes here (though you should +consider using changelog). You can also add any additional sections you feel +are necessary or important to include here. Please use the `## ` header. diff --git a/clonos_userspw/Rakefile b/clonos_userspw/Rakefile new file mode 100644 index 0000000..02609e3 --- /dev/null +++ b/clonos_userspw/Rakefile @@ -0,0 +1,32 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'metadata-json-lint/rake_task' + +if RUBY_VERSION >= '1.9' + require 'rubocop/rake_task' + RuboCop::RakeTask.new +end + +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.relative = true +PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp'] + +desc 'Validate manifests, templates, and ruby files' +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures} + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end + +desc 'Run metadata_lint, lint, validate, and spec tests.' +task :test do + [:metadata_lint, :lint, :validate, :spec].each do |test| + Rake::Task[test].invoke + end +end diff --git a/clonos_userspw/examples/init.pp b/clonos_userspw/examples/init.pp new file mode 100644 index 0000000..bf70e7f --- /dev/null +++ b/clonos_userspw/examples/init.pp @@ -0,0 +1,12 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: +# https://docs.puppet.com/guides/tests_smoke.html +# +include ::clonos_userspw diff --git a/clonos_userspw/manifests/init.pp b/clonos_userspw/manifests/init.pp new file mode 100644 index 0000000..a2d9ba9 --- /dev/null +++ b/clonos_userspw/manifests/init.pp @@ -0,0 +1,55 @@ +# Class: clonos_userspw +# =========================== +# +# Full description of class clonos_userspw here. +# +# Parameters +# ---------- +# +# Document parameters here. +# +# * `sample parameter` +# Explanation of what this parameter affects and what it defaults to. +# e.g. "Specify one or more upstream ntp servers as an array." +# +# Variables +# ---------- +# +# Here you should define a list of variables that this module would require. +# +# * `sample variable` +# Explanation of how this variable affects the function of this class and if +# it has a default. e.g. "The parameter enc_ntp_servers must be set by the +# External Node Classifier as a comma separated list of hostnames." (Note, +# global variables should be avoided in favor of class parameters as +# of Puppet 2.6.) +# +# Examples +# -------- +# +# @example +# class { 'clonos_userspw': +# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ], +# } +# +# Authors +# ------- +# +# Author Name +# +# Copyright +# --------- +# +# Copyright 2016 Your name here, unless otherwise noted. +# +class clonos_userspw ( + $root = $clonos_userspw::params::root, + $web = $clonos_userspw::params::web, +) inherits clonos_userspw::params { + + user { "root": + ensure => present, + password => pw_hash( "$root", 'SHA-512', 'eiBi0ech8a'), + } + +} diff --git a/clonos_userspw/manifests/params.pp b/clonos_userspw/manifests/params.pp new file mode 100644 index 0000000..167f108 --- /dev/null +++ b/clonos_userspw/manifests/params.pp @@ -0,0 +1,4 @@ +class clonos_userspw::params { + $root = undef + $web = undef +} diff --git a/clonos_userspw/metadata.json b/clonos_userspw/metadata.json new file mode 100644 index 0000000..584a25c --- /dev/null +++ b/clonos_userspw/metadata.json @@ -0,0 +1,15 @@ +{ + "name": "clonos-clonos_network", + "version": "0.1.0", + "author": "clonos", + "summary": null, + "license": "Apache-2.0", + "source": "", + "project_page": null, + "issues_url": null, + "dependencies": [ + {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"} + ], + "data_provider": null +} + diff --git a/clonos_userspw/spec/classes/init_spec.rb b/clonos_userspw/spec/classes/init_spec.rb new file mode 100644 index 0000000..9c55230 --- /dev/null +++ b/clonos_userspw/spec/classes/init_spec.rb @@ -0,0 +1,6 @@ +require 'spec_helper' +describe 'clonos_network' do + context 'with default values for all parameters' do + it { should contain_class('clonos_network') } + end +end diff --git a/clonos_userspw/spec/spec_helper.rb b/clonos_userspw/spec/spec_helper.rb new file mode 100644 index 0000000..2c6f566 --- /dev/null +++ b/clonos_userspw/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/clonos_zfsinstall/Gemfile b/clonos_zfsinstall/Gemfile new file mode 100644 index 0000000..4f662dc --- /dev/null +++ b/clonos_zfsinstall/Gemfile @@ -0,0 +1,18 @@ +source ENV['GEM_SOURCE'] || 'https://rubygems.org' + +puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3'] +gem 'metadata-json-lint' +gem 'puppet', puppetversion +gem 'puppetlabs_spec_helper', '>= 1.0.0' +gem 'puppet-lint', '>= 1.0.0' +gem 'facter', '>= 1.7.0' +gem 'rspec-puppet' + +# rspec must be v2 for ruby 1.8.7 +if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' + gem 'rspec', '~> 2.0' + gem 'rake', '~> 10.0' +else + # rubocop requires ruby >= 1.9 + gem 'rubocop' +end diff --git a/clonos_zfsinstall/README.md b/clonos_zfsinstall/README.md new file mode 100644 index 0000000..ec9fa16 --- /dev/null +++ b/clonos_zfsinstall/README.md @@ -0,0 +1,83 @@ +# clonos_network + +#### Table of Contents + +1. [Description](#description) +1. [Setup - The basics of getting started with clonos_network](#setup) + * [What clonos_network affects](#what-clonos_network-affects) + * [Setup requirements](#setup-requirements) + * [Beginning with clonos_network](#beginning-with-clonos_network) +1. [Usage - Configuration options and additional functionality](#usage) +1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) +1. [Limitations - OS compatibility, etc.](#limitations) +1. [Development - Guide for contributing to the module](#development) + +## Description + +Start with a one- or two-sentence summary of what the module does and/or what +problem it solves. This is your 30-second elevator pitch for your module. +Consider including OS/Puppet version it works with. + +You can give more descriptive information in a second paragraph. This paragraph +should answer the questions: "What does this module *do*?" and "Why would I use +it?" If your module has a range of functionality (installation, configuration, +management, etc.), this is the time to mention it. + +## Setup + +### What clonos_network affects **OPTIONAL** + +If it's obvious what your module touches, you can skip this section. For +example, folks can probably figure out that your mysql_instance module affects +their MySQL instances. + +If there's more that they should know about, though, this is the place to mention: + +* A list of files, packages, services, or operations that the module will alter, + impact, or execute. +* Dependencies that your module automatically installs. +* Warnings or other important notices. + +### Setup Requirements **OPTIONAL** + +If your module requires anything extra before setting up (pluginsync enabled, +etc.), mention it here. + +If your most recent release breaks compatibility or requires particular steps +for upgrading, you might want to include an additional "Upgrading" section +here. + +### Beginning with clonos_network + +The very basic steps needed for a user to get the module up and running. This +can include setup steps, if necessary, or it can be an example of the most +basic use of the module. + +## Usage + +This section is where you describe how to customize, configure, and do the +fancy stuff with your module here. It's especially helpful if you include usage +examples and code samples for doing things with your module. + +## Reference + +Here, include a complete list of your module's classes, types, providers, +facts, along with the parameters for each. Users refer to this section (thus +the name "Reference") to find specific details; most users don't read it per +se. + +## Limitations + +This is where you list OS compatibility, version compatibility, etc. If there +are Known Issues, you might want to include them under their own heading here. + +## Development + +Since your module is awesome, other users will want to play with it. Let them +know what the ground rules for contributing are. + +## Release Notes/Contributors/Etc. **Optional** + +If you aren't using changelog, put your release notes here (though you should +consider using changelog). You can also add any additional sections you feel +are necessary or important to include here. Please use the `## ` header. diff --git a/clonos_zfsinstall/Rakefile b/clonos_zfsinstall/Rakefile new file mode 100644 index 0000000..02609e3 --- /dev/null +++ b/clonos_zfsinstall/Rakefile @@ -0,0 +1,32 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'metadata-json-lint/rake_task' + +if RUBY_VERSION >= '1.9' + require 'rubocop/rake_task' + RuboCop::RakeTask.new +end + +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.relative = true +PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp'] + +desc 'Validate manifests, templates, and ruby files' +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures} + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end + +desc 'Run metadata_lint, lint, validate, and spec tests.' +task :test do + [:metadata_lint, :lint, :validate, :spec].each do |test| + Rake::Task[test].invoke + end +end diff --git a/clonos_zfsinstall/examples/init.pp b/clonos_zfsinstall/examples/init.pp new file mode 100644 index 0000000..e2b7afd --- /dev/null +++ b/clonos_zfsinstall/examples/init.pp @@ -0,0 +1,12 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: +# https://docs.puppet.com/guides/tests_smoke.html +# +include ::clonos_zfsinstall diff --git a/clonos_zfsinstall/manifests/init.pp b/clonos_zfsinstall/manifests/init.pp new file mode 100644 index 0000000..3e508e0 --- /dev/null +++ b/clonos_zfsinstall/manifests/init.pp @@ -0,0 +1,56 @@ +# Class: clonos_zfsinstall +# =========================== +# +# Full description of class clonos_zfsinstall here. +# +# Parameters +# ---------- +# +# Document parameters here. +# +# * `sample parameter` +# Explanation of what this parameter affects and what it defaults to. +# e.g. "Specify one or more upstream ntp servers as an array." +# +# Variables +# ---------- +# +# Here you should define a list of variables that this module would require. +# +# * `sample variable` +# Explanation of how this variable affects the function of this class and if +# it has a default. e.g. "The parameter enc_ntp_servers must be set by the +# External Node Classifier as a comma separated list of hostnames." (Note, +# global variables should be avoided in favor of class parameters as +# of Puppet 2.6.) +# +# Examples +# -------- +# +# @example +# class { 'clonos_zfsinstall': +# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ], +# } +# +# Authors +# ------- +# +# Author Name +# +# Copyright +# --------- +# +# Copyright 2016 Your name here, unless otherwise noted. +# +class clonos_zfsinstall ( + $dsk = $clonos_zfsinstall::params::dsk, +) inherits clonos_zfsinstall::params { + + + file { "/tmp/zfsinstall.sh": + ensure => present, + content => template("${module_name}/zfsinstall.cfg.erb"), + owner => "root", + mode => '0555', + } +} diff --git a/clonos_zfsinstall/manifests/params.pp b/clonos_zfsinstall/manifests/params.pp new file mode 100644 index 0000000..1230bca --- /dev/null +++ b/clonos_zfsinstall/manifests/params.pp @@ -0,0 +1,3 @@ +class clonos_zfsinstall::params { + $dsk = undef +} diff --git a/clonos_zfsinstall/metadata.json b/clonos_zfsinstall/metadata.json new file mode 100644 index 0000000..584a25c --- /dev/null +++ b/clonos_zfsinstall/metadata.json @@ -0,0 +1,15 @@ +{ + "name": "clonos-clonos_network", + "version": "0.1.0", + "author": "clonos", + "summary": null, + "license": "Apache-2.0", + "source": "", + "project_page": null, + "issues_url": null, + "dependencies": [ + {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"} + ], + "data_provider": null +} + diff --git a/clonos_zfsinstall/spec/classes/init_spec.rb b/clonos_zfsinstall/spec/classes/init_spec.rb new file mode 100644 index 0000000..9c55230 --- /dev/null +++ b/clonos_zfsinstall/spec/classes/init_spec.rb @@ -0,0 +1,6 @@ +require 'spec_helper' +describe 'clonos_network' do + context 'with default values for all parameters' do + it { should contain_class('clonos_network') } + end +end diff --git a/clonos_zfsinstall/spec/spec_helper.rb b/clonos_zfsinstall/spec/spec_helper.rb new file mode 100644 index 0000000..2c6f566 --- /dev/null +++ b/clonos_zfsinstall/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/clonos_zfsinstall/templates/zfsinstall.cfg.erb b/clonos_zfsinstall/templates/zfsinstall.cfg.erb new file mode 100644 index 0000000..782e90f --- /dev/null +++ b/clonos_zfsinstall/templates/zfsinstall.cfg.erb @@ -0,0 +1,2 @@ +cbsd zfsinstall devs="<%= @dsk %>" mnt=/mnt pool=clonos ext_populate=/root/popul.sh +