librarian-puppet 0.0.1.pre2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +167 -0
- data/lib/librarian/puppet.rb +1 -1
- data/librarian-puppet.gemspec +1 -0
- metadata +17 -6
data/README.md
CHANGED
@@ -0,0 +1,167 @@
|
|
1
|
+
# Librarian-puppet
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Librarian-puppet is a bundler for your puppet infrastructure. You can use
|
6
|
+
librarian-puppet to manage the puppet modules your infrastructure depends on.
|
7
|
+
It is based on [Librarian](https://github.com/applicationsonline/librarian), a
|
8
|
+
framework for writing bundlers, which are tools that resolve, fetch, install,
|
9
|
+
and isolate a project's dependencies.
|
10
|
+
|
11
|
+
Librarian-puppet manages your `modules/` directory for you based on your
|
12
|
+
`Puppetfile`. Your `Puppetfile` becomes the authoritative source for what
|
13
|
+
modules you require and at what version, tag or branch.
|
14
|
+
|
15
|
+
Once using Librarian-puppet you should not modify the contents of your `modules`
|
16
|
+
directory. The individual modules' repos should be updated, tagged with a new
|
17
|
+
release and the version bumped in your Puppetfile.
|
18
|
+
|
19
|
+
## The Puppetfile
|
20
|
+
|
21
|
+
Every Puppet repository that uses Librarian-puppet will have a file named
|
22
|
+
`Puppetfile` in the root directory of that repository. The full specification
|
23
|
+
for which modules your puppet infrastructure repository depends goes in here.
|
24
|
+
|
25
|
+
### Example Puppetfile
|
26
|
+
|
27
|
+
forge "http://forge.puppetlabs.com"
|
28
|
+
|
29
|
+
mod "puppetlabs/razor"
|
30
|
+
mod "puppetlabs/ntp", "0.0.3"
|
31
|
+
|
32
|
+
mod "apt",
|
33
|
+
:git => "git://github.com/puppetlabs/puppetlabs-apt.git"
|
34
|
+
|
35
|
+
mod "stdlib",
|
36
|
+
:git => "git://github.com/puppetlabs/puppetlabs-stdlib.git"
|
37
|
+
|
38
|
+
*See [jenkins-appliance](https://github.com/aussielunix/jenkins-appliance) for
|
39
|
+
a puppet repo already setup to use librarian-puppet.*
|
40
|
+
|
41
|
+
### Puppetfile Breakdown
|
42
|
+
|
43
|
+
forge "http://forge.puppetlabs.com"
|
44
|
+
|
45
|
+
This declares that we want to use the official Puppet Labs Forge as our default
|
46
|
+
source when pulling down modules. If you run your own local forge, you may
|
47
|
+
want to change this.
|
48
|
+
|
49
|
+
mod "puppetlabs/razor"
|
50
|
+
|
51
|
+
Pull in the latest version of the Puppet Labs Razor module from the default
|
52
|
+
source.
|
53
|
+
|
54
|
+
mod "puppetlabs/ntp", "0.0.3"
|
55
|
+
|
56
|
+
Pull in version 0.0.3 of the Puppet Labs NTP module from the default source.
|
57
|
+
|
58
|
+
mod "apt",
|
59
|
+
:git => "git://github.com/puppetlabs/puppetlabs-apt.git"
|
60
|
+
|
61
|
+
Our puppet infrastructure repository depends on the `apt` module from the
|
62
|
+
Puppet Labs GitHub repos and checks out the `master` branch.
|
63
|
+
|
64
|
+
mod "apt",
|
65
|
+
:git => "git://github.com/puppetlabs/puppetlabs-apt.git"
|
66
|
+
:ref => '0.0.3'
|
67
|
+
|
68
|
+
Our puppet infrastructure repository depends on the `apt` module from the
|
69
|
+
Puppet Labs GitHub repos and checks out a tag of `0.0.3`.
|
70
|
+
|
71
|
+
mod "apt",
|
72
|
+
:git => "git://github.com/puppetlabs/puppetlabs-apt.git"
|
73
|
+
:ref => 'feature/master/dans_refactor'
|
74
|
+
|
75
|
+
Our puppet infrastructure repository depends on the `apt` module from the
|
76
|
+
Puppet Labs GitHub repos and checks out the `dans_refactor` branch.
|
77
|
+
|
78
|
+
When using a Git source, we do not have to use a `:ref =>`.
|
79
|
+
If we do not, then librarian-puppet will assume we meant the `master` branch.
|
80
|
+
|
81
|
+
If we use a `:ref =>`, we can use anything that Git will recognize as a ref.
|
82
|
+
This includes any branch name, tag name, SHA, or SHA unique prefix. If we use a
|
83
|
+
branch, we can later ask Librarian-pupet to update the modulek by fetching the
|
84
|
+
most recent version of the module from that same branch.
|
85
|
+
|
86
|
+
The Git source also supports a `:path =>` option. If we use the path option,
|
87
|
+
Librarian-puppet will navigate down into the Git repository and only use the
|
88
|
+
specified subdirectory. Some people have the habit of having a single repository
|
89
|
+
with many modules in it. If we need a module from such a repository, we can
|
90
|
+
use the `:path =>` option here to help Librarian-puppet drill down and find the
|
91
|
+
module subdirectory.
|
92
|
+
|
93
|
+
mod "apt",
|
94
|
+
:git => "git://github.com/fake/puppet-modules.git"
|
95
|
+
:path => "modules/apt"
|
96
|
+
|
97
|
+
Our puppet infrastructure repository depends on the `apt` module, which we have
|
98
|
+
stored as a directory under our `puppet-modules` git repos.
|
99
|
+
|
100
|
+
## How to Use
|
101
|
+
|
102
|
+
Install librarian-puppet:
|
103
|
+
|
104
|
+
$ gem install --pre librarian-puppet
|
105
|
+
|
106
|
+
Prepare your puppet infrastructure repository:
|
107
|
+
|
108
|
+
$ cd ~/path/to/puppet-inf-repos
|
109
|
+
$ (git) rm -rf modules
|
110
|
+
$ librarian-puppet init
|
111
|
+
|
112
|
+
Librarian-puppet takes over your `modules/` directory, and will always
|
113
|
+
reinstall (if missing) the modules listed the `Puppetfile.lock` into your
|
114
|
+
`modules/` directory, therefore you do not need your `modules/` directory to be
|
115
|
+
tracked in Git.
|
116
|
+
|
117
|
+
Librarian-puppet uses a `.tmp/` directory for tempfiles and caches. You should
|
118
|
+
not track this directory in Git.
|
119
|
+
|
120
|
+
Running `librarian-puppet init` will create a skeleton Puppetfile for you as
|
121
|
+
well as adding `tmp/` and `modules/` to your `.gitignore`.
|
122
|
+
|
123
|
+
$ librarian-puppet install [--clean] [--verbose]
|
124
|
+
|
125
|
+
This command looks at each `mod` declaration and fetches the module from the
|
126
|
+
source specified. This command writes the complete resolution into
|
127
|
+
`Puppetfile.lock` and then copies all of the fetched modules into your
|
128
|
+
`modules/` directory, overwriting whatever was there before.
|
129
|
+
|
130
|
+
Get an overview of your `Puppetfile.lock` with:
|
131
|
+
|
132
|
+
$ librarian-puppet show
|
133
|
+
|
134
|
+
Inspect the details of specific resolved dependencies with:
|
135
|
+
|
136
|
+
$ librarian-puppet show NAME1 [NAME2, ...]
|
137
|
+
|
138
|
+
Find out which dependencies are outdated and may be updated:
|
139
|
+
|
140
|
+
$ librarian-puppet outdated [--verbose]
|
141
|
+
|
142
|
+
Update the version of a dependency:
|
143
|
+
|
144
|
+
$ librarian-puppet update apt [--verbose]
|
145
|
+
$ git diff Puppetfile.lock
|
146
|
+
$ git add Puppetfile.lock
|
147
|
+
$ git commit -m "bumped the version of apt up to 0.0.4."
|
148
|
+
|
149
|
+
## How to Contribute
|
150
|
+
|
151
|
+
* Pull requests please.
|
152
|
+
* Bonus points for feature branches.
|
153
|
+
|
154
|
+
## Reporting Issues
|
155
|
+
|
156
|
+
Bug reports to the github issue tracker please.
|
157
|
+
Please include:
|
158
|
+
|
159
|
+
* relevant `Puppetfile` and `Puppetfile.lock` files.
|
160
|
+
* version of ruby, librarian-puppet
|
161
|
+
* What distro
|
162
|
+
* Please run the `librarian-puppet` commands in verbose mode by using the
|
163
|
+
`--verbose` flag, and include the verbose output in the bug report as well.
|
164
|
+
|
165
|
+
## License
|
166
|
+
Please see the [LICENSE](https://github.com/rodjek/librarian-puppet/blob/master/LICENSE)
|
167
|
+
file.
|
data/lib/librarian/puppet.rb
CHANGED
data/librarian-puppet.gemspec
CHANGED
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librarian-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Tim Sharpe
|
@@ -13,7 +13,7 @@ date: 2012-06-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70190725563440 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,18 @@ dependencies:
|
|
21
21
|
version: '0.15'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70190725563440
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: json
|
27
|
+
requirement: &70190725562580 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70190725562580
|
25
36
|
description: another placeholder!
|
26
37
|
email:
|
27
38
|
- tim@sharpe.id.au
|
@@ -152,9 +163,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
164
|
none: false
|
154
165
|
requirements:
|
155
|
-
- - ! '
|
166
|
+
- - ! '>='
|
156
167
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
168
|
+
version: '0'
|
158
169
|
requirements: []
|
159
170
|
rubyforge_project:
|
160
171
|
rubygems_version: 1.8.11
|