falkorlib 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.Manifest.txt +15 -0
- data/.gitignore +11 -0
- data/.travis.yml +21 -0
- data/Gemfile.lock +1 -1
- data/binscripts/bootstrap.sh +47 -0
- data/falkorlib.gemspec +5 -5
- data/lib/falkorlib/version.rb +1 -1
- data/templates/puppet/modules/.gitignore +6 -0
- data/templates/puppet/modules/Gemfile +6 -0
- data/templates/puppet/modules/README.md.erb +87 -0
- data/templates/puppet/modules/Rakefile +28 -0
- data/templates/puppet/modules/doc/contributing.md.erb +140 -0
- data/templates/puppet/modules/files/README.md +21 -0
- data/templates/puppet/modules/manifests/classes/templatename-params.pp.erb +151 -0
- data/templates/puppet/modules/manifests/classes/templatename.pp.erb +197 -0
- data/templates/puppet/modules/manifests/definitions/templatename-mydef.pp.erb +111 -0
- data/templates/puppet/modules/manifests/init.pp.erb +11 -0
- data/templates/puppet/modules/metadata.json.erb +19 -0
- data/templates/puppet/modules/templates/README.md +24 -0
- data/templates/puppet/modules/templates/templatename-variables.erb +16 -0
- data/templates/puppet/modules/tests/init.pp.erb +12 -0
- metadata +19 -2
- data/.falkorlib.noespec +0 -321
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3016d72370c962b095a38b6c661376d8c5937f4
|
4
|
+
data.tar.gz: f7085f04b36a1da05630dedafd8ab66c51db9bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81b1c0874548dfe44c7a2f7a9485ccdf95b4d1e1b978d024570494c6a6a330f9ad3f3f749b480f7297778219465f39f401fbb6f19f7cbb151f2d2a337e2cfb13
|
7
|
+
data.tar.gz: 3ee861b38638d8138b190e4f2debc5949c0b918de6a6c10445f81a0b6dfe33dfd2ace0324bd8de2e43ca1a1b262bd5b818905917280ae54d01e8fa17a3d05937
|
data/.Manifest.txt
ADDED
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
bundler_args: "--without=release doc"
|
4
|
+
before_install:
|
5
|
+
- sudo apt-get update -qq
|
6
|
+
- sudo apt-get install -y git-flow git-core
|
7
|
+
rvm:
|
8
|
+
- 1.9.2
|
9
|
+
- 1.9.3
|
10
|
+
- 2.0.0
|
11
|
+
- 2.1.1
|
12
|
+
- 2.1.2
|
13
|
+
- rbx-2.2.7
|
14
|
+
notifications:
|
15
|
+
hipchat:
|
16
|
+
rooms:
|
17
|
+
secure: E0V9xQtCyPSB+SZ5n+ztdM5tzJ7d1eR+XR1gIBfAwe0JYnRb735B1v0Z3CVBmosKpv16KEoKUDjum1vHGk8fnOOcxoHx+TtTCF1TVpuBtKzXqG6t4YZAYjkGSIBUM1Zd7kXLlsdmdwRToGmKRqblQHutnm0LkyII/CAwaO+UeY8=
|
18
|
+
# addons:
|
19
|
+
# code_climate:
|
20
|
+
# repo_token:
|
21
|
+
# secure: "ZBtaK84ZnjyT4X7mGSYDx31HgD94nZccxAzKA2SBjakW/hfsx9sBGOusxYN7EuC6JydjwLFN3MwLfEGMgjC1zxNwvLO9PGQbh52QawKBue09qouitJbOODwUfQgzNHj/Z0x3dMv3X1Qz31gbfDaC6DJsnTtG2q7R7Kni8hq4/FU="
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
#! /bin/bash
|
2
|
+
################################################################################
|
3
|
+
# bootstrap.sh - Bootstrap a fresh new directory for using FalkorLib and its
|
4
|
+
# associated Rake tasks.
|
5
|
+
# Creation : 26 Jun 2014
|
6
|
+
# Time-stamp: <Jeu 2014-06-26 11:33 svarrette>
|
7
|
+
#
|
8
|
+
# Copyright (c) 2014 Sebastien Varrette <Sebastien.Varrette@uni.lu>
|
9
|
+
# http://varrette.gforge.uni.lu
|
10
|
+
################################################################################
|
11
|
+
|
12
|
+
RUBY_VERSION='2.1.0'
|
13
|
+
GEMSET=`basename $PWD`
|
14
|
+
|
15
|
+
echo "=> initialize RVM -- see http://rvm.io"
|
16
|
+
[ ! -f .ruby-version ] && echo ${RUBY_VERSION} > .ruby-version
|
17
|
+
rvm install `cat .ruby-version`
|
18
|
+
[ ! -f .ruby-gemset ] && echo ${GEMSET} > .ruby-gemset
|
19
|
+
|
20
|
+
echo "=> Force reloading RVM configuration within $PWD"
|
21
|
+
cd .. && cd -
|
22
|
+
|
23
|
+
echo "=> installing the Bundler gem -- see http://bundler.io"
|
24
|
+
gem install bundler
|
25
|
+
|
26
|
+
echo "=> setup the FalkorLib gem in the directory ${GEMSET}"
|
27
|
+
bundle init
|
28
|
+
if ! grep -Fq "falkorlib" Gemfile; then
|
29
|
+
echo "gem 'falkorlib'" >> Gemfile
|
30
|
+
fi
|
31
|
+
bundle
|
32
|
+
if [ ! -f Rakefile ]; then
|
33
|
+
cat > Rakefile <<EOF
|
34
|
+
#
|
35
|
+
# Rakefile - Configuration file for rake (http://rake.rubyforge.org/)
|
36
|
+
#
|
37
|
+
require 'falkorlib'
|
38
|
+
|
39
|
+
## placeholder for custom configuration of FalkorLib.config.*
|
40
|
+
## See https://github.com/Falkor/falkorlib
|
41
|
+
|
42
|
+
require 'falkorlib/tasks/git'
|
43
|
+
EOF
|
44
|
+
|
45
|
+
fi
|
46
|
+
|
47
|
+
#echo "=> That's all folks!"
|
data/falkorlib.gemspec
CHANGED
@@ -81,17 +81,17 @@ Gem::Specification.new do |s|
|
|
81
81
|
# of the project. Entries of the manifest are interpreted as Dir[...]
|
82
82
|
# patterns so that lazy people may use wilcards like lib/**/*
|
83
83
|
#
|
84
|
-
here = File.expand_path(File.dirname(__FILE__))
|
85
|
-
s.files = File.readlines(File.join(here, '.Manifest.txt')).
|
86
|
-
|
87
|
-
|
84
|
+
# here = File.expand_path(File.dirname(__FILE__))
|
85
|
+
# s.files = File.readlines(File.join(here, '.Manifest.txt')).
|
86
|
+
# inject([]){|files, pattern| files + Dir[File.join(here, pattern.strip)]}.
|
87
|
+
# collect{|x| x[(1+here.size)..-1]}
|
88
88
|
|
89
89
|
# Test files included in this gem.
|
90
90
|
#
|
91
91
|
s.test_files = Dir["test/**/*"] + Dir["spec/**/*"]
|
92
92
|
|
93
93
|
# Alternative:
|
94
|
-
|
94
|
+
s.files = `git ls-files`.split("\n")
|
95
95
|
#s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
96
96
|
#s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
97
97
|
|
data/lib/falkorlib/version.rb
CHANGED
@@ -0,0 +1,87 @@
|
|
1
|
+
-*- mode: markdown; mode: auto-fill; fill-column: 80 -*-
|
2
|
+
|
3
|
+
# <%= config[:name].gsub(/.*-/, '').capitalize %> Puppet Module
|
4
|
+
|
5
|
+
[ %>.svg)](<%= config[:forge_url] %>)
|
6
|
+
[ %>-blue.svg)](LICENSE)
|
7
|
+
 %>-lightgrey.svg)
|
8
|
+
|
9
|
+
<%= config[:summary] %>
|
10
|
+
|
11
|
+
|
12
|
+
Copyright (c) <%= Time.now.year %> <%= config[:author] %> <<%= config[:mail] %>>
|
13
|
+
|
14
|
+
|
15
|
+
* [Online Project Page](<%= config[:project_page] %>) -- [Sources](<%= config[:source] %>) -- [Issues](<%= config[:issues_url] %>)
|
16
|
+
|
17
|
+
## Synopsis
|
18
|
+
|
19
|
+
<%= config[:description] %>
|
20
|
+
|
21
|
+
The various operations of this repository are piloted from a `Rakefile` which
|
22
|
+
assumes that you have [RVM](https://rvm.io/) installed on your system.
|
23
|
+
|
24
|
+
## Dependencies
|
25
|
+
|
26
|
+
See `metadata.json`.
|
27
|
+
|
28
|
+
## <%= config[:name].gsub(/.*-/, '') %> class parameters
|
29
|
+
|
30
|
+
* `$ensure` [Default: 'present']: Ensure <%= config[:name].gsub(/^puppet-/,'')
|
31
|
+
%> is present, absent etc.
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
### class <%= config[:name].gsub(/.*-/, '') %>
|
36
|
+
|
37
|
+
include '<%= config[:name].gsub(/.*-/,'') %>'
|
38
|
+
|
39
|
+
|
40
|
+
## Documentation
|
41
|
+
|
42
|
+
Please refer to the header of each manifest files to understand the usage of
|
43
|
+
classes and definitions associated to the '<%= config[:name] %>' module.
|
44
|
+
|
45
|
+
Alternatively, generate automatically the documentation via
|
46
|
+
[`puppet doc`](http://docs.puppetlabs.com/man/doc.html) as follows:
|
47
|
+
|
48
|
+
$> rake doc # Not yet implemented
|
49
|
+
|
50
|
+
For other information, please refer to the `metadata.json` file in this directory
|
51
|
+
|
52
|
+
## Librarian-Puppet / R10K Setup
|
53
|
+
|
54
|
+
You can of course configure <%= config[:name] %> in your `Puppetfile` to make it
|
55
|
+
available with [Librarian puppet](http://librarian-puppet.com/) or
|
56
|
+
[r10k](https://github.com/adrienthebo/r10k) by adding the following entry:
|
57
|
+
|
58
|
+
mod <%= config[:name] %>,
|
59
|
+
:git => <%= config[:source] %>,
|
60
|
+
:ref => <%= FalkorLib.config[:gitflow][:branches][:master] %>
|
61
|
+
|
62
|
+
|
63
|
+
## Issues / Feature request
|
64
|
+
|
65
|
+
You can submit bug / issues / feature request using the
|
66
|
+
[<%= config[:name] %> Tracker](<%= config[:issues_url] %>).
|
67
|
+
|
68
|
+
|
69
|
+
## Developments / Contributing to the code
|
70
|
+
|
71
|
+
If you want to contribute to the code, you shall be aware of the way this module
|
72
|
+
is organized.
|
73
|
+
These elements are detailed on [`doc/contributing.md`](doc/contributing.md)
|
74
|
+
|
75
|
+
You are more than welcome to contribute to its development by
|
76
|
+
[sending a pull request](https://help.github.com/articles/using-pull-requests).
|
77
|
+
|
78
|
+
## Resources
|
79
|
+
|
80
|
+
### Git
|
81
|
+
|
82
|
+
You should become familiar (if not yet) with Git. Consider these resources:
|
83
|
+
|
84
|
+
* [Git book](http://book.git-scm.com/index.html)
|
85
|
+
* [Github:help](http://help.github.com/mac-set-up-git/)
|
86
|
+
* [Git reference](http://gitref.org/)
|
87
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Rakefile - Configuration file for rake (http://rake.rubyforge.org/)
|
3
|
+
#
|
4
|
+
require 'falkorlib'
|
5
|
+
|
6
|
+
## placeholder for custom configuration of FalkorLib.config.*
|
7
|
+
## See https://github.com/Falkor/falkorlib
|
8
|
+
|
9
|
+
# Adapt the versioning aspects
|
10
|
+
FalkorLib.config.versioning do |c|
|
11
|
+
c[:type] = 'puppet_module'
|
12
|
+
end
|
13
|
+
|
14
|
+
# Adapt the Git flow aspects
|
15
|
+
FalkorLib.config.gitflow do |c|
|
16
|
+
c[:branches] = {
|
17
|
+
:master => 'production',
|
18
|
+
:develop => 'devel'
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
require 'falkorlib/tasks/git'
|
24
|
+
require 'falkorlib/tasks/puppet'
|
25
|
+
|
26
|
+
##############################################################################
|
27
|
+
#TOP_SRCDIR = File.expand_path(File.join(File.dirname(__FILE__), "."))
|
28
|
+
|
@@ -0,0 +1,140 @@
|
|
1
|
+
-*- mode: markdown; mode: auto-fill; fill-column: 80 -*-
|
2
|
+
|
3
|
+
# <%= config[:name].gsub(/.*-/, '').capitalize %> Puppet Module Developments
|
4
|
+
|
5
|
+
If you want to contribute to the code, you shall be aware of the way this module
|
6
|
+
is organized.
|
7
|
+
|
8
|
+
### Directory Layout
|
9
|
+
|
10
|
+
<%= config[:name] %>/ # Main directory
|
11
|
+
`-- metadata.json # Module configuration - cf [here](https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#write-a-metadatajson-file)
|
12
|
+
`-- README.md # This file
|
13
|
+
`-- files/ # Contains static files, which managed nodes can download
|
14
|
+
`-- lib/ # custom facts/type/provider definitions
|
15
|
+
`-- manifests/
|
16
|
+
`-- init.pp # Main manifests file
|
17
|
+
`-- classes/ # Hold manifest for <%= config[:name] %> classes/
|
18
|
+
`-- <%= config[:name] %>.pp # defines the <%= config[:name] %> class
|
19
|
+
`-- <%= config[:name] %>-params.pp # <%= config[:name] %> module variables
|
20
|
+
`-- definitions/ # Hold manifest for <%= config[:name] %> definitions
|
21
|
+
`-- <%= config[:name] %>-mydef.pp # defines the <%= config[:name] %>::mydef definition `-- templates/ # Module ERB template files
|
22
|
+
`-- tests/ # Contains examples showing how to declare the module’s classes and defined type
|
23
|
+
`-- spec/ # Contains spec tests for any plugins in the lib directory
|
24
|
+
`-- Rakefile # Definition of the [rake](https://github.com/jimweirich/rake) tasks
|
25
|
+
`-- .ruby-{version,gemset} # [RVM](https://rvm.io/) configuration
|
26
|
+
`-- Gemfile[.lock] # [Bundler](http://bundler.io/) configuration
|
27
|
+
`-- .git/ # Hold git configuration
|
28
|
+
|
29
|
+
### Git Branching Model
|
30
|
+
|
31
|
+
The Git branching model for this repository follows the guidelines of
|
32
|
+
[gitflow](http://nvie.com/posts/a-successful-git-branching-model/).
|
33
|
+
In particular, the central repository holds two main branches with an infinite
|
34
|
+
lifetime:
|
35
|
+
|
36
|
+
* `<%= FalkorLib.config[:gitflow][:branches][:master] %>`: the branch holding
|
37
|
+
tags of the successive releases of this tutorial
|
38
|
+
* `<%= FalkorLib.config[:gitflow][:branches][:develop] %>`: the main branch
|
39
|
+
where the sources are in a state with the latest delivered development changes
|
40
|
+
for the next release. This is the *default* branch you get when you clone the
|
41
|
+
repository, and the one on which developments will take places.
|
42
|
+
|
43
|
+
You should therefore install [git-flow](https://github.com/nvie/gitflow), and
|
44
|
+
probably also its associated
|
45
|
+
[bash completion](https://github.com/bobthecow/git-flow-completion).
|
46
|
+
|
47
|
+
### Ruby, [RVM](https://rvm.io/) and [Bundler](http://bundler.io/)
|
48
|
+
|
49
|
+
The various operations that can be conducted from this repository are piloted
|
50
|
+
from a `Rakefile` and assumes you have a running Ruby installation.
|
51
|
+
|
52
|
+
The bootstrapping of your repository is based on [RVM](https://rvm.io/), **thus
|
53
|
+
ensure this tools are installed on your system** -- see
|
54
|
+
[installation notes](https://rvm.io/rvm/install).
|
55
|
+
|
56
|
+
The ruby stuff part of this repository corresponds to the following files:
|
57
|
+
|
58
|
+
* `.ruby-{version,gemset}`: [RVM](https://rvm.io/) configuration, use the name of the
|
59
|
+
project as [gemset](https://rvm.io/gemsets) name
|
60
|
+
* `Gemfile[.lock]`: used by `[bundle](http://bundler.io/)`
|
61
|
+
|
62
|
+
You should now be able to access the list of available tasks by running:
|
63
|
+
|
64
|
+
$> rake -T
|
65
|
+
|
66
|
+
You probably wants to activate the bash-completion for rake tasks.
|
67
|
+
I personnaly use the one provided [here](https://github.com/ai/rake-completion)
|
68
|
+
|
69
|
+
Also, some of the tasks are hidden. Run `rake -T -A` to list all of them.
|
70
|
+
|
71
|
+
### Repository Setup
|
72
|
+
|
73
|
+
Then, to make your local copy of the repository ready to use the
|
74
|
+
[git-flow](https://github.com/nvie/gitflow) workflow and the local
|
75
|
+
[RVM](https://rvm.io/) setup, you have to run the following commands once you
|
76
|
+
cloned it for the first time:
|
77
|
+
|
78
|
+
$> rake setup
|
79
|
+
|
80
|
+
### RSpec tests
|
81
|
+
|
82
|
+
A set of unitary tests are defined to validate the different function of my
|
83
|
+
library using [Rspec](http://rspec.info/)
|
84
|
+
|
85
|
+
You can run these tests by issuing:
|
86
|
+
|
87
|
+
$> rake rspec # NOT YET IMPLEMENTED
|
88
|
+
|
89
|
+
By conventions, you will find all the currently implemented tests in the `spec/`
|
90
|
+
directory, in files having the `_spec.rb` suffix. This is expected from the
|
91
|
+
`rspec` task of the `Rakefile`.
|
92
|
+
|
93
|
+
**Important** Kindly stick to this convention, and feature tests for all
|
94
|
+
definitions/classes/modules you might want to add.
|
95
|
+
|
96
|
+
### Releasing mechanism
|
97
|
+
|
98
|
+
The operation consisting of releasing a new version of this repository is
|
99
|
+
automated by a set of tasks within the `Rakefile`.
|
100
|
+
|
101
|
+
In this context, a version number have the following format:
|
102
|
+
|
103
|
+
<major>.<minor>.<patch>
|
104
|
+
|
105
|
+
where:
|
106
|
+
|
107
|
+
* `< major >` corresponds to the major version number
|
108
|
+
* `< minor >` corresponds to the minor version number
|
109
|
+
* `< patch >` corresponds to the patching version number
|
110
|
+
|
111
|
+
Example: `1.2.0`
|
112
|
+
|
113
|
+
The current version number is stored in the file `metadata.json`.
|
114
|
+
For more information on the version, run:
|
115
|
+
|
116
|
+
$> rake version:info
|
117
|
+
|
118
|
+
If a new version number such be bumped, you simply have to run:
|
119
|
+
|
120
|
+
$> rake version:bump:{major,minor,patch}
|
121
|
+
|
122
|
+
This will start the release process for you using `git-flow`.
|
123
|
+
Then, to make the release effective, just run:
|
124
|
+
|
125
|
+
$> rake version:release
|
126
|
+
|
127
|
+
This will finalize the release using `git-flow`, create the appropriate tag and
|
128
|
+
merge all things the way they should be.
|
129
|
+
|
130
|
+
# Contributing Notes
|
131
|
+
|
132
|
+
This project is released under the terms of the [<%= config[:license] %> Licence](LICENSE).
|
133
|
+
So you are more than welcome to contribute to its development as follows:
|
134
|
+
|
135
|
+
1. Fork it
|
136
|
+
2. Create your feature branch (`rake git:feature:start[<feature_name>]`)
|
137
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
138
|
+
4. Push to the branch (`git flow feature publish <feature_name>`)
|
139
|
+
5. Create new Pull Request
|
140
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Files
|
2
|
+
=====
|
3
|
+
|
4
|
+
Puppet comes with both a client and server for copying files around. The file
|
5
|
+
serving function is provided as part of the central Puppet daemon,
|
6
|
+
puppetmasterd, and the client function is used through the source attribute of
|
7
|
+
file objects. Learn more [here](http://projects.puppetlabs.com/projects/puppet/wiki/File_Serving_Configuration)
|
8
|
+
|
9
|
+
You can use managed files like this:
|
10
|
+
|
11
|
+
class <%= config[:name] %> {
|
12
|
+
package { <%= config[:name].gsub(/^puppet-/, '') %>: ensure => latest }
|
13
|
+
file { "/etc/<%= config[:name] %>.conf":
|
14
|
+
source => "puppet://$servername/modules/<%= config[:name] %>/myfile"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
The files are searched for in:
|
19
|
+
|
20
|
+
$modulepath/<%= config[:name] %>/files/myfile
|
21
|
+
|