falkorlib 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/falkorlib/puppet/modules.rb +23 -12
- data/lib/falkorlib/tasks/puppet_modules.rake +8 -6
- data/lib/falkorlib/version.rb +1 -1
- data/spec/falkorlib/puppet_modules_spec.rb +4 -4
- data/spec/falkorlib/versioning_puppet_module_spec.rb +2 -2
- data/templates/puppet/modules/README.md.erb +15 -7
- data/templates/puppet/modules/docs/contacts.md.erb +10 -0
- data/templates/puppet/modules/docs/contributing/index.md.erb +14 -0
- data/templates/puppet/modules/docs/contributing/layout.md.erb +32 -0
- data/templates/puppet/modules/docs/contributing/setup.md.erb +53 -0
- data/templates/puppet/modules/docs/contributing/versioning.md.erb +30 -0
- data/templates/puppet/modules/docs/index.md.erb +31 -0
- data/templates/puppet/modules/docs/rtfd.md.erb +13 -0
- data/templates/puppet/modules/{doc → docs}/vagrant.md.erb +0 -0
- data/templates/puppet/modules/manifests/common/debian.pp.erb +1 -1
- data/templates/puppet/modules/manifests/common/redhat.pp.erb +2 -2
- data/templates/puppet/modules/metadata.json.erb +3 -0
- data/templates/puppet/modules/mkdocs.yml.erb +12 -0
- metadata +11 -4
- data/templates/puppet/modules/doc/contributing.md.erb +0 -132
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41cf1812507626ce7b0667e4356fa5b312ff45ab
|
4
|
+
data.tar.gz: 0c25f1428c8a36b9aecfb19be41679883aead93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4530b721c14523c1eb99db1db0b40a09fbb9991f2518206f1b4f93be908d5d63196cb705aa32761624f38ab2a7756b7b31d0c333191fcc42acf4267e12dfae49
|
7
|
+
data.tar.gz: 67355b7d06502993823aa49b597bcf4ef10571b2bce3f52a161bde77dd9dc346566d8ec35cf2fbe854484d4f6164029f6022c9ec4b0956ef3e7d7cdb27b1edb7
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <Fri 2015-05-
|
3
|
+
# Time-stamp: <Fri 2015-05-15 23:24 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for the main Puppet Module operations
|
6
6
|
#
|
@@ -24,7 +24,7 @@ module FalkorLib #:nodoc:
|
|
24
24
|
:version => '0.0.1',
|
25
25
|
:author => "#{ENV['GIT_AUTHOR_NAME']}",
|
26
26
|
:mail => "#{ENV['GIT_AUTHOR_EMAIL']}",
|
27
|
-
:summary => "rtfm",
|
27
|
+
:summary => "Configure and manage rtfm",
|
28
28
|
:description => '',
|
29
29
|
:license => 'Apache-2.0',
|
30
30
|
:source => '',
|
@@ -89,7 +89,8 @@ module FalkorLib #:nodoc:
|
|
89
89
|
config = {}
|
90
90
|
#login = `whoami`.chomp
|
91
91
|
config[:name] = name unless name.empty?
|
92
|
-
moduledir
|
92
|
+
moduledir = rootdir
|
93
|
+
#name.empty? ? rootdir : File.join(rootdir, name)
|
93
94
|
FalkorLib::Config::Puppet::Modules::DEFAULTS[:metadata].each do |k,v|
|
94
95
|
next if v.kind_of?(Array) or k == :license
|
95
96
|
next if k == :name and ! name.empty?
|
@@ -111,8 +112,9 @@ module FalkorLib #:nodoc:
|
|
111
112
|
end
|
112
113
|
config[k.to_sym] = ask( "\t" + sprintf("%-20s", "Module #{k}"), default_answer)
|
113
114
|
end
|
114
|
-
config[:shortname] = name = config[:name].gsub(
|
115
|
-
|
115
|
+
config[:shortname] = name = config[:name].gsub(/.*[-\/]/, '')
|
116
|
+
config[:docs_project] = ask("\tRead the Docs (RTFD) project:", config[:name].downcase.gsub(/\//,'-puppet-'))
|
117
|
+
tags = ask("\tKeywords (comma-separated list of tags)", config[:shortname])
|
116
118
|
config[:tags] = tags.split(',')
|
117
119
|
list_license = FalkorLib::Config::Puppet::Modules::DEFAULTS[:licenses]
|
118
120
|
default_license = FalkorLib::Config::Puppet::Modules::DEFAULTS[:metadata][:license]
|
@@ -144,7 +146,8 @@ module FalkorLib #:nodoc:
|
|
144
146
|
newname = e.gsub(/templatename/, "#{name}")
|
145
147
|
run %{ mv #{e} #{newname} }
|
146
148
|
end
|
147
|
-
|
149
|
+
# Update docs directory
|
150
|
+
run %{ ln -s ../README.md #{moduledir}/docs/overview.md }
|
148
151
|
info "Generating the License file"
|
149
152
|
authors = config[:author].empty? ? 'UNKNOWN' : config[:author]
|
150
153
|
Dir.chdir(moduledir) do
|
@@ -167,7 +170,7 @@ module FalkorLib #:nodoc:
|
|
167
170
|
FalkorLib::GitFlow.start('feature', "bootstrapping", moduledir)
|
168
171
|
end
|
169
172
|
[ 'metadata.json',
|
170
|
-
'
|
173
|
+
'docs/', 'LICENSE', '.gitignore', '.ruby-version', '.ruby-gemset',
|
171
174
|
'Gemfile', '.vagrant_init.rb', 'Rakefile', 'Vagrantfile' ].each do |f|
|
172
175
|
FalkorLib::Git.add(File.join(moduledir, f))
|
173
176
|
end
|
@@ -184,8 +187,9 @@ module FalkorLib #:nodoc:
|
|
184
187
|
})
|
185
188
|
name = File.basename(moduledir)
|
186
189
|
metadata = metadata(moduledir, {
|
187
|
-
:use_symbols
|
188
|
-
:extras
|
190
|
+
:use_symbols => false,
|
191
|
+
:extras => false,
|
192
|
+
:no_interaction => options[:no_interaction]
|
189
193
|
})
|
190
194
|
puts "**********************"
|
191
195
|
puts metadata.to_yaml
|
@@ -240,7 +244,8 @@ module FalkorLib #:nodoc:
|
|
240
244
|
#
|
241
245
|
def metadata(moduledir = Dir.pwd, options = {
|
242
246
|
:use_symbols => true,
|
243
|
-
:extras => true
|
247
|
+
:extras => true,
|
248
|
+
:no_interaction => false
|
244
249
|
})
|
245
250
|
add_extras = options[:extras].nil? ? true : options[:extras]
|
246
251
|
name = File.basename( moduledir )
|
@@ -249,6 +254,7 @@ module FalkorLib #:nodoc:
|
|
249
254
|
error "Unable to find #{jsonfile}" unless File.exist?( jsonfile )
|
250
255
|
metadata = JSON.parse( IO.read( jsonfile ) )
|
251
256
|
if add_extras
|
257
|
+
metadata["docs_project"] = ask("\tRead the Docs (RTFD) project:", "#{name.downcase.gsub(/\//,'-puppet-')}") if metadata["docs_project"].nil?
|
252
258
|
metadata[:shortname] = name.gsub(/.*-/, '')
|
253
259
|
metadata[:platforms] = []
|
254
260
|
metadata["operatingsystem_support"].each do |e|
|
@@ -293,7 +299,12 @@ module FalkorLib #:nodoc:
|
|
293
299
|
metadata = metadata(moduledir)
|
294
300
|
templatedir = File.join( FalkorLib.templates, 'puppet', 'modules')
|
295
301
|
i = 0
|
296
|
-
update_from_erb = [
|
302
|
+
update_from_erb = [
|
303
|
+
'README.md',
|
304
|
+
'docs/contacts.md',
|
305
|
+
'docs/contributing/index.md', 'docs/contributing/layout.md', 'docs/contributing/setup.md', 'docs/contributing/versioning.md',
|
306
|
+
'docs/index.md', 'docs/rtfd.md', 'docs/vagrant.md'
|
307
|
+
]
|
297
308
|
(update_from_erb + [ 'Gemfile', 'Rakefile', 'Vagrantfile', '.vagrant_init.rb' ]).each do |f|
|
298
309
|
next unless options[:exclude].nil? or ! options[:exclude].include?( f )
|
299
310
|
next unless options[:only].nil? or options[:only].include?(f)
|
@@ -301,7 +312,7 @@ module FalkorLib #:nodoc:
|
|
301
312
|
ans = options[:no_interaction] ? 'Yes' : ask(cyan("==> procceed? (Y|n)"), 'Yes')
|
302
313
|
next if ans =~ /n.*/i
|
303
314
|
if update_from_erb.include?(f)
|
304
|
-
|
315
|
+
puts "=> updating #{f}.erb"
|
305
316
|
i += write_from_erb_template(File.join(templatedir, "#{f}.erb"),
|
306
317
|
File.join(moduledir, f),
|
307
318
|
metadata,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
3
|
# puppet_modules.rake - Special tasks for the management of Puppet modules
|
4
|
-
# Time-stamp: <Fri 2015-05-
|
4
|
+
# Time-stamp: <Fri 2015-05-15 18:24 svarrette>
|
5
5
|
#
|
6
6
|
# Copyright (c) 2014 Sebastien Varrette <Sebastien.Varrette@uni.lu>
|
7
7
|
# http://varrette.gforge.uni.lu
|
@@ -24,10 +24,10 @@ namespace :bootstrap do
|
|
24
24
|
name = args.name == 'name' ? ask("Enter the module name") : args.name
|
25
25
|
error "You need to provide a module name" unless name != ''
|
26
26
|
error "The module name cannot contain spaces" if name =~ /\s+/
|
27
|
-
moduledir = File.join( FalkorLib.config[:puppet][:modulesdir], name)
|
27
|
+
moduledir = File.join( FalkorLib.config[:puppet][:modulesdir], name.gsub(/^\w*\//,'puppet-'))
|
28
28
|
dir = ask("Destination directory:", moduledir)
|
29
29
|
error "The module '#{name}' already exists" if File.directory?(dir)
|
30
|
-
FalkorLib::Puppet::Modules.init(dir)
|
30
|
+
FalkorLib::Puppet::Modules.init(dir, name)
|
31
31
|
end
|
32
32
|
|
33
33
|
|
@@ -128,14 +128,16 @@ namespace :templates do
|
|
128
128
|
FalkorLib::Puppet::Modules.upgrade()
|
129
129
|
end
|
130
130
|
|
131
|
-
[ 'readme', 'rake', 'vagrant' ].each do |t|
|
131
|
+
[ 'docs', 'readme', 'rake', 'vagrant' ].each do |t|
|
132
132
|
########### templates:upgrade:{readme,rake,vagrant} ###########
|
133
133
|
desc "Upgrade (overwrite) #{t.capitalize} using the current FalkorLib template"
|
134
134
|
task t.to_sym do
|
135
135
|
list = case t
|
136
136
|
when 'readme'
|
137
|
-
[ 'README.md'
|
138
|
-
|
137
|
+
[ 'README.md' ]
|
138
|
+
when 'docs'
|
139
|
+
[ 'contacts.md', 'contributing/index.md', 'contributing/layout.md', 'contributing/setup.md', 'contributing/versioning.md', 'index.md', 'rtfd.md', 'vagrant.md' ]
|
140
|
+
when 'rake'
|
139
141
|
[ 'Gemfile', 'Rakefile' ]
|
140
142
|
when 'vagrant'
|
141
143
|
[ 'Vagrantfile', '.vagrant_init.rb']
|
data/lib/falkorlib/version.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#########################################
|
3
3
|
# puppet_modules_spec.rb
|
4
4
|
# @author Sebastien Varrette <Sebastien.Varrette@uni.lu>
|
5
|
-
# Time-stamp: <Fri 2015-05-
|
5
|
+
# Time-stamp: <Fri 2015-05-15 23:24 svarrette>
|
6
6
|
#
|
7
7
|
# @description Check the Puppet Modules operations
|
8
8
|
#
|
@@ -40,7 +40,7 @@ describe FalkorLib::Puppet::Modules do
|
|
40
40
|
|
41
41
|
it "#init -- create a puppet module" do
|
42
42
|
# Prepare answer to the questions
|
43
|
-
Array.new(
|
43
|
+
Array.new(17).each { |e| STDIN.should_receive(:gets).and_return('') }
|
44
44
|
FalkorLib::Puppet::Modules.init(moduledir)
|
45
45
|
templatedir = File.join( FalkorLib.templates, 'puppet', 'modules')
|
46
46
|
s = true
|
@@ -52,7 +52,7 @@ describe FalkorLib::Puppet::Modules do
|
|
52
52
|
filename = File.basename(file)
|
53
53
|
filename = File.basename(file, '.erb') unless file =~ /templates\/toto-variables\.erb/
|
54
54
|
f = File.join(moduledir, relative_dir, filename)
|
55
|
-
|
55
|
+
puts "checking #{f} - #{File.exists?( f )}"
|
56
56
|
s &= File.exists?( f )
|
57
57
|
end
|
58
58
|
s.should be_true
|
@@ -147,7 +147,7 @@ describe FalkorLib::Puppet::Modules do
|
|
147
147
|
]
|
148
148
|
end
|
149
149
|
|
150
|
-
upgraded_files_default =
|
150
|
+
upgraded_files_default = 1
|
151
151
|
it "#upgrade" do
|
152
152
|
d = FalkorLib::Puppet::Modules.upgrade(moduledir, {
|
153
153
|
:no_interaction => true
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#########################################
|
3
3
|
# versioning_puppet_module_spec.rb
|
4
4
|
# @author Sebastien Varrette <Sebastien.Varrette@uni.lu>
|
5
|
-
# Time-stamp: <Fri 2015-05-
|
5
|
+
# Time-stamp: <Fri 2015-05-15 23:28 svarrette>
|
6
6
|
#
|
7
7
|
# @description Check the versioning operations on Gems
|
8
8
|
#
|
@@ -53,7 +53,7 @@ describe FalkorLib::Versioning::Puppet do
|
|
53
53
|
|
54
54
|
ap default_version
|
55
55
|
it "#get_version -- get default version #{default_version} after initialization" do
|
56
|
-
Array.new(
|
56
|
+
Array.new(17).each { |e| STDIN.should_receive(:gets).and_return('') }
|
57
57
|
FalkorLib::Puppet::Modules.init(moduledir)
|
58
58
|
v = FalkorLib::Versioning.get_version(moduledir)
|
59
59
|
v.should == default_version
|
@@ -5,6 +5,7 @@
|
|
5
5
|
[![Puppet Forge](http://img.shields.io/puppetforge/v/<%= config[:name].gsub(/-/,"/") %>.svg)](<%= config[:forge_url] %>)
|
6
6
|
[![License](http://img.shields.io/:license-<%= config[:license].gsub(/-/, '') %>-blue.svg)](LICENSE)
|
7
7
|
![Supported Platforms](http://img.shields.io/badge/platform-<%= config[:platforms].join('|') %>-lightgrey.svg)
|
8
|
+
[![Documentation Status](https://readthedocs.org/projects/<%= config[:docs_project] %>/badge/?version=latest)](https://readthedocs.org/projects/<%= config[:docs_project] %>/?badge=latest)
|
8
9
|
|
9
10
|
<%= config[:summary] %>
|
10
11
|
|
@@ -12,7 +13,7 @@
|
|
12
13
|
Copyright (c) <%= Time.now.year %> <%= config[:author] %> <<%= config[:mail] %>>
|
13
14
|
|
14
15
|
|
15
|
-
|
16
|
+
| [Project Page](<%= config[:project_page] %>) | [Sources](<%= config[:source] %>) | [Documentation](httpd://<%= config[:docs_project] %>.readthedocs.org/en/latest/) | [Issues](<%= config[:issues_url] %>) |
|
16
17
|
|
17
18
|
## Synopsis
|
18
19
|
|
@@ -38,7 +39,7 @@ All these components are configured through a set of variables you will find in
|
|
38
39
|
[`manifests/params.pp`](manifests/params.pp).
|
39
40
|
|
40
41
|
_Note_: the various operations that can be conducted from this repository are piloted from a [`Rakefile`](https://github.com/ruby/rake) and assumes you have a running [Ruby](https://www.ruby-lang.org/en/) installation.
|
41
|
-
See
|
42
|
+
See `docs/contributing.md` for more details on the steps you shall follow to have this `Rakefile` working properly.
|
42
43
|
|
43
44
|
## Dependencies
|
44
45
|
|
@@ -57,7 +58,7 @@ It accepts the following parameters:
|
|
57
58
|
|
58
59
|
* `$ensure`: default to 'present', can be 'absent'
|
59
60
|
|
60
|
-
Use
|
61
|
+
Use it as follows:
|
61
62
|
|
62
63
|
include ' <%= config[:shortname] %>'
|
63
64
|
|
@@ -66,6 +67,8 @@ See also [`tests/init.pp`](tests/init.pp)
|
|
66
67
|
<% unless config[:classes].nil? %>
|
67
68
|
<% config[:classes].each do |cl| %>
|
68
69
|
<% next if cl == config[:shortname] %>
|
70
|
+
<% next if cl =~ /common/ %>
|
71
|
+
<% next if cl =~ /params/ %>
|
69
72
|
### Class `<%= cl %>`
|
70
73
|
|
71
74
|
See [`tests/<%= cl.gsub("#{config[:shortname]}::", "").gsub(/::/, '/') %>.pp`](tests/<%= cl.gsub("#{config[:shortname]}::", "").gsub(/::/, '/') %>.pp)
|
@@ -105,8 +108,8 @@ You can of course configure the <%= config[:shortname] %> module in your `Puppet
|
|
105
108
|
or, if you prefer to work on the git version:
|
106
109
|
|
107
110
|
mod "<%= config[:name] %>",
|
108
|
-
:git => <%= config[:source]
|
109
|
-
:ref => <%= FalkorLib.config[:gitflow][:branches][:master] %>
|
111
|
+
:git => '<%= config[:source] %>',
|
112
|
+
:ref => '<%= FalkorLib.config[:gitflow][:branches][:master] %>'
|
110
113
|
|
111
114
|
## Issues / Feature request
|
112
115
|
|
@@ -115,7 +118,7 @@ You can submit bug / issues / feature request using the [<%= config[:name] %> Pu
|
|
115
118
|
## Developments / Contributing to the code
|
116
119
|
|
117
120
|
If you want to contribute to the code, you shall be aware of the way this module is organized.
|
118
|
-
These elements are detailed on [`
|
121
|
+
These elements are detailed on [`docs/contributing.md`](contributing.md).
|
119
122
|
|
120
123
|
You are more than welcome to contribute to its development by [sending a pull request](https://help.github.com/articles/using-pull-requests).
|
121
124
|
|
@@ -124,6 +127,11 @@ You are more than welcome to contribute to its development by [sending a pull re
|
|
124
127
|
The best way to test this module in a non-intrusive way is to rely on [Vagrant](http://www.vagrantup.com/).
|
125
128
|
The `Vagrantfile` at the root of the repository pilot the provisioning various vagrant boxes available on [Vagrant cloud](https://atlas.hashicorp.com/boxes/search?utf8=%E2%9C%93&sort=&provider=virtualbox&q=svarrette) you can use to test this module.
|
126
129
|
|
127
|
-
See [`
|
130
|
+
See [`docs/vagrant.md`](vagrant.md) for more details.
|
128
131
|
|
132
|
+
## Online Documentation
|
133
|
+
|
134
|
+
[Read the Docs](https://readthedocs.org/) aka RTFD hosts documentation for the open source community and the [<%= config[:name] %>](<%= config[:projects_url] %>) puppet module has its documentation (see the `docs/` directly) hosted on [readthedocs](http://<%= config[:docs_project] %>.rtfd.org).
|
135
|
+
|
136
|
+
See [`docs/rtfd.md`](rtfd.md) for more details.
|
129
137
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
This Puppet Module has been implemented in the context of the [UL HPC](http://hpc.uni.lu) Platform of the [University of Luxembourg](http://www.uni.lu).
|
2
|
+
More precisely, the [UL HPC Management Team](https://hpc.uni.lu/about/team.html#system-administrators) took care of this development for this module.
|
3
|
+
|
4
|
+
You can submit bug / issues / feature request using the [<%= config[:name] %> Puppet Module Tracker](<%= config[:issues_url] %>).
|
5
|
+
Alternatively, you can contact them on the following email address: `hpc-sysadmins@uni.lu`
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
This project is released under the terms of the [<%= config[:license].capitalize %> Licence](LICENSE).
|
2
|
+
So you are more than welcome to contribute to its development as follows:
|
3
|
+
|
4
|
+
1. Fork it
|
5
|
+
2. Create your feature branch (`rake git:feature:start[<feature_name>]`)
|
6
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
7
|
+
4. Push to the branch (`git flow feature publish <feature_name>`)
|
8
|
+
5. Create new Pull Request
|
9
|
+
|
10
|
+
This assumes that you have understood the [directory tree structure](layout.md) of this Puppet module.
|
11
|
+
|
12
|
+
There is also a number of pre-requisite programs / framework you shall install to be able to correctly contribute to this Puppet module. This is detailed in the [Repository Setup and Developments](setup.md) page.
|
13
|
+
|
14
|
+
Finally, you shall be aware of the way the [semantic versioning](versioning.md) procedure of this Puppet module are handled.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
The directory hosting the implementation of this puppet module is organized as follows:
|
2
|
+
|
3
|
+
```
|
4
|
+
.gitignore # Git ignore file
|
5
|
+
.ruby-{version,gemset} # [RVM](https://rvm.io/) configuration
|
6
|
+
.vagrant_init.rb # Vagrant provisionner to test this module
|
7
|
+
├── Gemfile[.lock] # [Bundler](http://bundler.io/) configuration
|
8
|
+
├── LICENSE # Licence file
|
9
|
+
├── README.md # This file
|
10
|
+
├── Rakefile # Definition of the [rake](https://github.com/jimweirich/rake) tasks
|
11
|
+
├── Vagrantfile # Pilot Vagrant to test this module
|
12
|
+
├── docs/ # [Read the Docs](readthedocs.org) main directory
|
13
|
+
├── files/ # (eventually) Contains static files, which managed nodes can download
|
14
|
+
├── lib/ # (eventually) Custom facts/type/provider definitions
|
15
|
+
├── manifests/
|
16
|
+
│ ├── init.pp # Main manifests file which defines the sudo class
|
17
|
+
│ ├── common/
|
18
|
+
│ │ ├── debian.pp # Specific Debian setup for the main class
|
19
|
+
│ │ └── redhat.pp # Specific Redhat setup for the main class
|
20
|
+
│ ├── common.pp # Common class setup for all OS
|
21
|
+
│ ├── ... # Implementation of the other <%= config[:shortname] %>::* classes / definitions
|
22
|
+
│ └── params.pp # Class parameters
|
23
|
+
├── metadata.json # Puppet module configuration file -- See http://tinyurl.com/puppet-metadata-json
|
24
|
+
├── mkdocs.yml # [Read the Docs](readthedocs.org) configuration
|
25
|
+
├── pkg/ # Hold build packages to be published on the [Puppet forge](<%= config[:forge_url] %>)
|
26
|
+
├── spec/ # (eventually) [Rspec](https://www.relishapp.com/rspec/) tests
|
27
|
+
├── templates/ # (eventually) Module ERB template files
|
28
|
+
└── tests/ # Tests cases for the module usage
|
29
|
+
```
|
30
|
+
|
31
|
+
Globally, this module follows the [official PuppetLabs guidelines for the predictable directory tree structure of Puppet modules](http://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html#module-layout).
|
32
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
There is a number of pre-requisite programs / framework you shall install to be able to correctly contribute to this Puppet module.
|
2
|
+
|
3
|
+
### Git Branching Model
|
4
|
+
|
5
|
+
The Git branching model for this repository follows the guidelines of [gitflow](http://nvie.com/posts/a-successful-git-branching-model/).
|
6
|
+
In particular, the central repository holds two main branches with an infinite lifetime:
|
7
|
+
|
8
|
+
* `<%= FalkorLib.config[:gitflow][:branches][:master] %>`: the branch holding tags of the successive releases of this tutorial
|
9
|
+
* `<%= FalkorLib.config[:gitflow][:branches][:develop] %>`: the main branch where the sources are in a state with the latest delivered development changes for the next release. This is the *default* branch you get when you clone the repository, and the one on which developments will take places.
|
10
|
+
|
11
|
+
You should therefore install [git-flow](https://github.com/nvie/gitflow), and probably also its associated [bash completion](https://github.com/bobthecow/git-flow-completion).
|
12
|
+
|
13
|
+
### Ruby, [RVM](https://rvm.io/) and [Bundler](http://bundler.io/)
|
14
|
+
|
15
|
+
The various operations that can be conducted from this repository are piloted
|
16
|
+
from a `Rakefile` and assumes you have a running Ruby installation.
|
17
|
+
|
18
|
+
The bootstrapping of your repository is based on [RVM](https://rvm.io/), **thus
|
19
|
+
ensure this tools are installed on your system** -- see
|
20
|
+
[installation notes](https://rvm.io/rvm/install).
|
21
|
+
|
22
|
+
The ruby stuff part of this repository corresponds to the following files:
|
23
|
+
|
24
|
+
* `.ruby-{version,gemset}`: [RVM](https://rvm.io/) configuration, use the name of the
|
25
|
+
project as [gemset](https://rvm.io/gemsets) name
|
26
|
+
* `Gemfile[.lock]`: used by `[bundle](http://bundler.io/)`
|
27
|
+
|
28
|
+
### Repository Setup
|
29
|
+
|
30
|
+
Then, to make your local copy of the repository ready to use the [git-flow](https://github.com/nvie/gitflow) workflow and the local [RVM](https://rvm.io/) setup, you have to run the following commands once you cloned it for the first time:
|
31
|
+
|
32
|
+
$> gem install bundler # assuming it is not yet available
|
33
|
+
$> bundle install
|
34
|
+
$> rake -T # To list the available tasks
|
35
|
+
$> rake setup
|
36
|
+
|
37
|
+
You probably wants to activate the bash-completion for rake tasks.
|
38
|
+
I personnaly use the one provided [here](https://github.com/ai/rake-completion)
|
39
|
+
|
40
|
+
Also, some of the tasks are hidden. Run `rake -T -A` to list all of them.
|
41
|
+
|
42
|
+
### RSpec tests
|
43
|
+
|
44
|
+
A set of unitary tests are defined to validate the different function of my library using [Rspec](http://rspec.info/)
|
45
|
+
|
46
|
+
You can run these tests by issuing:
|
47
|
+
|
48
|
+
$> rake rspec # NOT YET IMPLEMENTED
|
49
|
+
|
50
|
+
By conventions, you will find all the currently implemented tests in the `spec/` directory, in files having the `_spec.rb` suffix. This is expected from the `rspec` task of the `Rakefile`.
|
51
|
+
|
52
|
+
**Important** Kindly stick to this convention, and feature tests for all definitions/classes/modules you might want to add.
|
53
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
The operation consisting of releasing a new version of this repository is
|
2
|
+
automated by a set of tasks within the `Rakefile`.
|
3
|
+
|
4
|
+
In this context, a version number have the following format:
|
5
|
+
|
6
|
+
<major>.<minor>.<patch>
|
7
|
+
|
8
|
+
where:
|
9
|
+
|
10
|
+
* `< major >` corresponds to the major version number
|
11
|
+
* `< minor >` corresponds to the minor version number
|
12
|
+
* `< patch >` corresponds to the patching version number
|
13
|
+
|
14
|
+
Example: `1.2.0`
|
15
|
+
|
16
|
+
The current version number is stored in the file `metadata.json`.
|
17
|
+
For more information on the version, run:
|
18
|
+
|
19
|
+
$> rake version:info
|
20
|
+
|
21
|
+
If a new version number such be bumped, you simply have to run:
|
22
|
+
|
23
|
+
$> rake version:bump:{major,minor,patch}
|
24
|
+
|
25
|
+
This will start the release process for you using `git-flow`.
|
26
|
+
Then, to make the release effective, just run:
|
27
|
+
|
28
|
+
$> rake version:release
|
29
|
+
|
30
|
+
This will finalize the release using `git-flow`, create the appropriate tag and merge all things the way they should be.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
-*- mode: markdown; mode: visual-line; -*-
|
2
|
+
|
3
|
+
# <%= config[:name] %> Puppet Module
|
4
|
+
|
5
|
+
[![Puppet Forge](http://img.shields.io/puppetforge/v/<%= config[:name].gsub(/-/,"/") %>.svg)](<%= config[:forge_url] %>)
|
6
|
+
[![License](http://img.shields.io/:license-<%= config[:license].gsub(/-/, '') %>-blue.svg)](LICENSE)
|
7
|
+
![Supported Platforms](http://img.shields.io/badge/platform-<%= config[:platforms].join('|') %>-lightgrey.svg)
|
8
|
+
[![Documentation Status](https://readthedocs.org/projects/<%= config[:docs_project] %>/badge/?version=latest)](https://readthedocs.org/projects/<%= config[:docs_project] %>/?badge=latest)
|
9
|
+
|
10
|
+
Copyright (c) <%= Time.now.year %> <%= config[:author] %> <<%= config[:mail] %>>
|
11
|
+
|
12
|
+
| [Project Page](<%= config[:project_page] %>) | [Sources](<%= config[:source] %>) | [Documentation](http://<%= config[:docs_project] %>.readthedocs.org/en/latest/) | [Issues](<%= config[:issues_url] %>) |
|
13
|
+
|
14
|
+
|
15
|
+
-----------
|
16
|
+
The [<%= config[:name] %>](<%= config[:project_page] %>) puppet module has been designed to <%= config[:summary].downcase %>
|
17
|
+
|
18
|
+
This is the main page of the documentation for this Puppet module, which is hosted and managed by [Read the Docs](http://<%= config[:name].downcase.gsub(/\//,'-') %>.readthedocs.org/en/latest/).
|
19
|
+
It proposes to detail the following elements:
|
20
|
+
|
21
|
+
* An [Overview](overview.md) of the module is proposed, describing the puppet classes and/or definitions it implements.
|
22
|
+
- you might also wish to check the `tests/` directory for sample test cases
|
23
|
+
* How to [test this module with Vagrant](vagrant.md)
|
24
|
+
* How to [contribute](contributing/index.md) to this puppet module development. In particular, we detail:
|
25
|
+
- the [directory tree structure](contributing/layout.md)
|
26
|
+
- the steps to follow to [setup this repository](contributing/setup.md)
|
27
|
+
- information as regard the [semantic versioning](contributing/versioning.md) of this Puppet module.
|
28
|
+
- Apart form the directory layout, we will cover various configuration aspects ([git-flow](https://github.com/nvie/gitflow), [RVM](https://rvm.io/), [Bundler](http://bundler.io/) etc.)
|
29
|
+
* Details on the [Read the Docs](http://<%= config[:name].downcase.gsub(/\//,'-') %>.readthedocs.org/en/latest/) management.
|
30
|
+
|
31
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
The documentation for this puppet module is handled by [Read the Docs](https://readthedocs.org/), a web service dedicated to documentation management for the open source community.
|
2
|
+
|
3
|
+
* [Reference documentation](https://docs.readthedocs.org/en/latest/)
|
4
|
+
|
5
|
+
By default, the [<%= config[:name] %>](<%= config[:project_page] %>) repository is bound to the [<%= config[:docs_project] %>](http://<%= config[:docs_project] %>.rtfd.org) project on Read the Docs (to avoid confusion with other <%= config[:shortname] %> projects).
|
6
|
+
|
7
|
+
You might wish to generate locally the docs:
|
8
|
+
|
9
|
+
* Install [`mkdocs`](http://www.mkdocs.org/#installation)
|
10
|
+
* Preview your documentation from the project root by running `mkdocs serve` and visite with your favorite browser the URL `http://localhost:8000`
|
11
|
+
* build the full documentation locally by running `mkdocs build`
|
12
|
+
|
13
|
+
|
File without changes
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# License:: <%= config[:license].capitalize %>
|
5
5
|
#
|
6
6
|
# ------------------------------------------------------------------------------
|
7
|
-
# = Class: <%= config[:shortname] %>::debian
|
7
|
+
# = Class: <%= config[:shortname] %>::common::debian
|
8
8
|
#
|
9
9
|
# Specialization class for Debian systems
|
10
10
|
class <%= config[:shortname] %>::common::debian inherits <%= config[:shortname] %>::common { }
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# License:: <%= config[:license].capitalize %>
|
5
5
|
#
|
6
6
|
# ------------------------------------------------------------------------------
|
7
|
-
# = Class: <%= config[:shortname] %>::
|
7
|
+
# = Class: <%= config[:shortname] %>::common::redhat
|
8
8
|
#
|
9
|
-
# Specialization class for
|
9
|
+
# Specialization class for Redhat systems
|
10
10
|
class <%= config[:shortname] %>::common::redhat inherits <%= config[:shortname] %>::common { }
|
@@ -7,6 +7,9 @@
|
|
7
7
|
"description": "<%= config[:description] %>",
|
8
8
|
"license": "<%= config[:license] %>",
|
9
9
|
"source": "<%= config[:source] %>",
|
10
|
+
<% unless config[:docs_project].nil? %>
|
11
|
+
"docs_project": "<%= config[:docs_project] %>",
|
12
|
+
<% end %>
|
10
13
|
"project_page": "<%= config[:project_page] %>",
|
11
14
|
"issues_url": "<%= config[:issues_url] %>",
|
12
15
|
"forge_url": "<%= config[:forge_url] %>",
|
@@ -0,0 +1,12 @@
|
|
1
|
+
site_name: <%= config[:name] %> Puppet Module
|
2
|
+
pages:
|
3
|
+
- ['index.md', 'Home']
|
4
|
+
- ['overview.md', 'Overview']
|
5
|
+
- ['vagrant.md', 'Tests with Vagrant']
|
6
|
+
- ['contributing/index.md', 'Contributing', 'Overview']
|
7
|
+
- ['contributing/layout.md', 'Contributing', 'Directory Layout']
|
8
|
+
- ['contributing/setup.md', 'Contributing', 'Repository Setup and Developments']
|
9
|
+
- ['contributing/versioning.md', 'Contributing', 'Module Versioning']
|
10
|
+
- ['rtfd.md', 'Documentation', 'RTFD']
|
11
|
+
- ['contacts.md', 'Contacts']
|
12
|
+
theme: readthedocs
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falkorlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastien Varrette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -421,8 +421,14 @@ files:
|
|
421
421
|
- templates/puppet/modules/README.md.erb
|
422
422
|
- templates/puppet/modules/Rakefile
|
423
423
|
- templates/puppet/modules/Vagrantfile
|
424
|
-
- templates/puppet/modules/
|
425
|
-
- templates/puppet/modules/
|
424
|
+
- templates/puppet/modules/docs/contacts.md.erb
|
425
|
+
- templates/puppet/modules/docs/contributing/index.md.erb
|
426
|
+
- templates/puppet/modules/docs/contributing/layout.md.erb
|
427
|
+
- templates/puppet/modules/docs/contributing/setup.md.erb
|
428
|
+
- templates/puppet/modules/docs/contributing/versioning.md.erb
|
429
|
+
- templates/puppet/modules/docs/index.md.erb
|
430
|
+
- templates/puppet/modules/docs/rtfd.md.erb
|
431
|
+
- templates/puppet/modules/docs/vagrant.md.erb
|
426
432
|
- templates/puppet/modules/files/README.md.erb
|
427
433
|
- templates/puppet/modules/manifests/common.pp.erb
|
428
434
|
- templates/puppet/modules/manifests/common/debian.pp.erb
|
@@ -431,6 +437,7 @@ files:
|
|
431
437
|
- templates/puppet/modules/manifests/mydef.pp.erb
|
432
438
|
- templates/puppet/modules/manifests/params.pp.erb
|
433
439
|
- templates/puppet/modules/metadata.json.erb
|
440
|
+
- templates/puppet/modules/mkdocs.yml.erb
|
434
441
|
- templates/puppet/modules/templates/README.md.erb
|
435
442
|
- templates/puppet/modules/templates/templatename-variables.erb
|
436
443
|
- templates/puppet/modules/tests/init.pp.erb
|
@@ -1,132 +0,0 @@
|
|
1
|
-
-*- mode: markdown; mode: visual-line; -*-
|
2
|
-
|
3
|
-
# <%= config[:shortname].capitalize %> Puppet Module Developments
|
4
|
-
|
5
|
-
If you want to contribute to the code, you shall be aware of the way this module is organized.
|
6
|
-
|
7
|
-
### Directory Layout
|
8
|
-
|
9
|
-
<%= config[:name] %>/ # Main directory
|
10
|
-
`-- metadata.json # Module configuration - cf [here](https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#write-a-metadatajson-file)
|
11
|
-
`-- README.md # This file
|
12
|
-
`-- files/ # Contains static files, which managed nodes can download
|
13
|
-
`-- lib/ # custom facts/type/provider definitions
|
14
|
-
`-- manifests/
|
15
|
-
`-- init.pp # Main manifests file which defines the <%= config[:shortname] %> class
|
16
|
-
`-- params.pp # <%= config[:name] %> module variables
|
17
|
-
<% unless config[:classes].nil? %>
|
18
|
-
<% config[:classes].each do |cl| %>
|
19
|
-
<% next if cl =~ /params/ %>
|
20
|
-
`-- <%= cl.gsub("#{config[:shortname]}::", "").gsub(/::/, '/') %>.pp
|
21
|
-
<% end %>
|
22
|
-
<% end %>
|
23
|
-
<% unless config[:definitions].nil? %>
|
24
|
-
<% config[:definitions].each do |de| %>
|
25
|
-
`-- <%= de.gsub("#{config[:shortname]}::", "").gsub(/::/, '/') %>.pp
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
`-- templates/ # Module ERB template files
|
29
|
-
`-- tests/ # Contains examples showing how to declare the module’s classes and defined type
|
30
|
-
`-- spec/ # Contains rspec tests
|
31
|
-
`-- Rakefile # Definition of the [rake](https://github.com/jimweirich/rake) tasks
|
32
|
-
`-- .ruby-{version,gemset} # [RVM](https://rvm.io/) configuration
|
33
|
-
`-- Gemfile[.lock] # [Bundler](http://bundler.io/) configuration
|
34
|
-
`-- .git/ # Hold git configuration
|
35
|
-
`-- .vagrant_init.rb # Vagrant provisionner to test this module
|
36
|
-
`-- Vagrantfile # Vagrant file
|
37
|
-
|
38
|
-
### Git Branching Model
|
39
|
-
|
40
|
-
The Git branching model for this repository follows the guidelines of [gitflow](http://nvie.com/posts/a-successful-git-branching-model/).
|
41
|
-
In particular, the central repository holds two main branches with an infinite lifetime:
|
42
|
-
|
43
|
-
* `<%= FalkorLib.config[:gitflow][:branches][:master] %>`: the branch holding tags of the successive releases of this tutorial
|
44
|
-
* `<%= FalkorLib.config[:gitflow][:branches][:develop] %>`: the main branch where the sources are in a state with the latest delivered development changes for the next release. This is the *default* branch you get when you clone the repository, and the one on which developments will take places.
|
45
|
-
|
46
|
-
You should therefore install [git-flow](https://github.com/nvie/gitflow), and probably also its associated [bash completion](https://github.com/bobthecow/git-flow-completion).
|
47
|
-
|
48
|
-
### Ruby, [RVM](https://rvm.io/) and [Bundler](http://bundler.io/)
|
49
|
-
|
50
|
-
The various operations that can be conducted from this repository are piloted
|
51
|
-
from a `Rakefile` and assumes you have a running Ruby installation.
|
52
|
-
|
53
|
-
The bootstrapping of your repository is based on [RVM](https://rvm.io/), **thus
|
54
|
-
ensure this tools are installed on your system** -- see
|
55
|
-
[installation notes](https://rvm.io/rvm/install).
|
56
|
-
|
57
|
-
The ruby stuff part of this repository corresponds to the following files:
|
58
|
-
|
59
|
-
* `.ruby-{version,gemset}`: [RVM](https://rvm.io/) configuration, use the name of the
|
60
|
-
project as [gemset](https://rvm.io/gemsets) name
|
61
|
-
* `Gemfile[.lock]`: used by `[bundle](http://bundler.io/)`
|
62
|
-
|
63
|
-
### Repository Setup
|
64
|
-
|
65
|
-
Then, to make your local copy of the repository ready to use the [git-flow](https://github.com/nvie/gitflow) workflow and the local [RVM](https://rvm.io/) setup, you have to run the following commands once you cloned it for the first time:
|
66
|
-
|
67
|
-
$> gem install bundler # assuming it is not yet available
|
68
|
-
$> bundle install
|
69
|
-
$> rake -T # To list the available tasks
|
70
|
-
$> rake setup
|
71
|
-
|
72
|
-
You probably wants to activate the bash-completion for rake tasks.
|
73
|
-
I personnaly use the one provided [here](https://github.com/ai/rake-completion)
|
74
|
-
|
75
|
-
Also, some of the tasks are hidden. Run `rake -T -A` to list all of them.
|
76
|
-
|
77
|
-
### RSpec tests
|
78
|
-
|
79
|
-
A set of unitary tests are defined to validate the different function of my library using [Rspec](http://rspec.info/)
|
80
|
-
|
81
|
-
You can run these tests by issuing:
|
82
|
-
|
83
|
-
$> rake rspec # NOT YET IMPLEMENTED
|
84
|
-
|
85
|
-
By conventions, you will find all the currently implemented tests in the `spec/` directory, in files having the `_spec.rb` suffix. This is expected from the `rspec` task of the `Rakefile`.
|
86
|
-
|
87
|
-
**Important** Kindly stick to this convention, and feature tests for all definitions/classes/modules you might want to add.
|
88
|
-
|
89
|
-
### Releasing mechanism
|
90
|
-
|
91
|
-
The operation consisting of releasing a new version of this repository is
|
92
|
-
automated by a set of tasks within the `Rakefile`.
|
93
|
-
|
94
|
-
In this context, a version number have the following format:
|
95
|
-
|
96
|
-
<major>.<minor>.<patch>
|
97
|
-
|
98
|
-
where:
|
99
|
-
|
100
|
-
* `< major >` corresponds to the major version number
|
101
|
-
* `< minor >` corresponds to the minor version number
|
102
|
-
* `< patch >` corresponds to the patching version number
|
103
|
-
|
104
|
-
Example: `1.2.0`
|
105
|
-
|
106
|
-
The current version number is stored in the file `metadata.json`.
|
107
|
-
For more information on the version, run:
|
108
|
-
|
109
|
-
$> rake version:info
|
110
|
-
|
111
|
-
If a new version number such be bumped, you simply have to run:
|
112
|
-
|
113
|
-
$> rake version:bump:{major,minor,patch}
|
114
|
-
|
115
|
-
This will start the release process for you using `git-flow`.
|
116
|
-
Then, to make the release effective, just run:
|
117
|
-
|
118
|
-
$> rake version:release
|
119
|
-
|
120
|
-
This will finalize the release using `git-flow`, create the appropriate tag and merge all things the way they should be.
|
121
|
-
|
122
|
-
# Contributing Notes
|
123
|
-
|
124
|
-
This project is released under the terms of the [<%= config[:license] %> Licence](LICENSE).
|
125
|
-
So you are more than welcome to contribute to its development as follows:
|
126
|
-
|
127
|
-
1. Fork it
|
128
|
-
2. Create your feature branch (`rake git:feature:start[<feature_name>]`)
|
129
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
130
|
-
4. Push to the branch (`git flow feature publish <feature_name>`)
|
131
|
-
5. Create new Pull Request
|
132
|
-
|