-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit. Only supports install so far
- Loading branch information
Benoît Clouet
committed
Jul 6, 2017
1 parent
0186230
commit 26413e0
Showing
11 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pkg/ | ||
Gemfile.lock | ||
.bundle/ | ||
.rspec_system/ | ||
.*.sw* | ||
/spec/fixtures/.librarian | ||
/spec/fixtures/.tmp | ||
/spec/fixtures/Puppetfile.lock | ||
/spec/fixtures/modules | ||
/spec/fixtures/manifests | ||
/spec/fixtures/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ::geth |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Class: geth | ||
# =========================== | ||
# | ||
# Full description of class geth 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 { 'geth': | ||
# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ], | ||
# } | ||
# | ||
# Authors | ||
# ------- | ||
# | ||
# Author Name <[email protected]> | ||
# | ||
# Copyright | ||
# --------- | ||
# | ||
# Copyright 2017 Your name here, unless otherwise noted. | ||
# | ||
class geth { | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# == Class: geth::install | ||
class geth::install inherits geth { | ||
|
||
yumrepo { 'okay-repo': | ||
baseurl => 'http://repo.okay.com.mx/centos/$releasever/$basearch/release', | ||
descr => 'OKAY RPM repository', | ||
enabled => 1, | ||
gpgcheck => 1, | ||
gpgkey => '/etc/pki/rpm-gpg/RPM-GPG-KEY-OKAY', | ||
} | ||
|
||
package { 'go-ethereum': | ||
ensure => installed, | ||
require => Yumrepo["okay-repo"], | ||
} | ||
|
||
group { 'geth': | ||
ensure => 'present', | ||
} | ||
|
||
user { 'geth': | ||
ensure => 'present', | ||
groups => 'geth', | ||
} | ||
|
||
} | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "clouetb-geth", | ||
"version": "0.1.0", | ||
"author": "clouetb", | ||
"summary": "A simple module for installing go-ethereum.", | ||
"license": "Apache-2.0", | ||
"source": "https://github.com/clouetb/puppet-geth.git", | ||
"project_page": "https://github.com/clouetb/puppet-geth", | ||
"issues_url": "https://github.com/clouetb/puppet-geth/issues", | ||
"dependencies": [ | ||
{"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"} | ||
], | ||
"data_provider": null | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'spec_helper' | ||
describe 'geth' do | ||
context 'with default values for all parameters' do | ||
it { should contain_class('geth') } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'puppetlabs_spec_helper/module_spec_helper' |