vagrant-boxen 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.vimrc +1 -0
- data/Puppetfile +9 -0
- data/Puppetfile.lock +18 -0
- data/README.md +15 -8
- data/Rakefile +3 -2
- data/Vagrantfile +16 -1
- data/lib/vagrant-boxen/base_module.rb +24 -0
- data/lib/vagrant-boxen/hash_slice.rb +11 -0
- data/lib/vagrant-boxen/manifest_builder.rb +21 -0
- data/lib/vagrant-boxen/modules/memcached.rb +24 -0
- data/lib/vagrant-boxen/modules/redis.rb +29 -0
- data/lib/vagrant-boxen/options_evaluator.rb +23 -0
- data/lib/vagrant-boxen/provisioner.rb +32 -13
- data/lib/vagrant-boxen/version.rb +1 -1
- data/lib/vagrant-boxen.rb +7 -3
- data/{puppet/modules → puppet-modules}/README.md +0 -0
- data/puppet-modules/gcc/CHANGELOG +3 -0
- data/puppet-modules/gcc/LICENSE +201 -0
- data/puppet-modules/gcc/Modulefile +10 -0
- data/puppet-modules/gcc/manifests/init.pp +21 -0
- data/puppet-modules/gcc/manifests/params.pp +23 -0
- data/puppet-modules/gcc/metadata.json +25 -0
- data/{puppet/modules → puppet-modules}/memcached/.fixtures.yml +0 -0
- data/{puppet/modules → puppet-modules}/memcached/.gemfile +0 -0
- data/{puppet/modules → puppet-modules}/memcached/LICENSE +0 -0
- data/{puppet/modules → puppet-modules}/memcached/Modulefile +0 -0
- data/{puppet/modules → puppet-modules}/memcached/README-DEVELOPER +0 -0
- data/{puppet/modules → puppet-modules}/memcached/README.md +0 -0
- data/{puppet/modules → puppet-modules}/memcached/lib/puppet/parser/functions/memcached_max_memory.rb +0 -0
- data/{puppet/modules → puppet-modules}/memcached/manifests/init.pp +0 -0
- data/{puppet/modules → puppet-modules}/memcached/manifests/params.pp +0 -0
- data/{puppet/modules → puppet-modules}/memcached/templates/memcached.conf.erb +0 -0
- data/{puppet/modules → puppet-modules}/memcached/templates/memcached_sysconfig.erb +0 -0
- data/puppet-modules/redis/.fixtures.yml +6 -0
- data/puppet-modules/redis/.gemfile +7 -0
- data/puppet-modules/redis/CHANGES.md +39 -0
- data/puppet-modules/redis/Modulefile +7 -0
- data/puppet-modules/redis/README.md +44 -0
- data/puppet-modules/redis/files/redis-2.4.13.tar.gz +0 -0
- data/puppet-modules/redis/files/redis.conf +492 -0
- data/puppet-modules/redis/manifests/init.pp +199 -0
- data/puppet-modules/redis/templates/redis.init.erb +96 -0
- data/puppet-modules/redis/templates/redis_port.conf.erb +412 -0
- data/puppet-modules/wget/Modulefile +8 -0
- data/puppet-modules/wget/README.md +37 -0
- data/puppet-modules/wget/manifests/init.pp +98 -0
- data/puppet-modules/wget/metadata.json +27 -0
- data/spec/unit/manifest_builder_spec.rb +18 -0
- data/spec/unit/modules/memcached_spec.rb +15 -0
- data/spec/unit/modules/redis_spec.rb +19 -0
- data/spec/unit/provisioner_spec.rb +54 -52
- metadata +49 -17
- data/lib/vagrant_init.rb +0 -1
data/.vimrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
set wildignore+=*/puppet-modules/*
|
data/Puppetfile
CHANGED
@@ -1,3 +1,12 @@
|
|
1
1
|
forge "http://forge.puppetlabs.com"
|
2
2
|
|
3
|
+
# These guys are required by the git modules and librarian-puppet seems
|
4
|
+
# to have issues when they are not specified here, even though they are listed
|
5
|
+
# as modules dependencies
|
6
|
+
mod 'maestrodev/wget'
|
7
|
+
mod 'puppetlabs/gcc'
|
8
|
+
|
3
9
|
mod 'memcached', :git => 'https://github.com/saz/puppet-memcached.git'
|
10
|
+
|
11
|
+
mod 'redis', :git => 'https://github.com/thomasvandoren/puppet-redis.git',
|
12
|
+
:ref => '546c34e3d11423cd77d1c1316c8811739aa7fc03'
|
data/Puppetfile.lock
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
FORGE
|
2
|
+
remote: http://forge.puppetlabs.com
|
3
|
+
specs:
|
4
|
+
maestrodev/wget (1.1.0)
|
5
|
+
puppetlabs/gcc (0.0.3)
|
6
|
+
|
1
7
|
GIT
|
2
8
|
remote: https://github.com/saz/puppet-memcached.git
|
3
9
|
ref: master
|
@@ -5,6 +11,18 @@ GIT
|
|
5
11
|
specs:
|
6
12
|
memcached (2.1.0)
|
7
13
|
|
14
|
+
GIT
|
15
|
+
remote: https://github.com/thomasvandoren/puppet-redis.git
|
16
|
+
ref: 546c34e3d11423cd77d1c1316c8811739aa7fc03
|
17
|
+
sha: 546c34e3d11423cd77d1c1316c8811739aa7fc03
|
18
|
+
specs:
|
19
|
+
redis (0.0.9)
|
20
|
+
maestrodev/wget (>= 0)
|
21
|
+
puppetlabs/gcc (>= 0)
|
22
|
+
|
8
23
|
DEPENDENCIES
|
24
|
+
maestrodev/wget (>= 0)
|
9
25
|
memcached (>= 0)
|
26
|
+
puppetlabs/gcc (>= 0)
|
27
|
+
redis (>= 0)
|
10
28
|
|
data/README.md
CHANGED
@@ -27,20 +27,27 @@ $ vagrant gem install vagrant-boxen
|
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
|
-
|
31
|
-
`Vagrantfile` with:
|
30
|
+
Just add a `Vagrant::Boxen::Provisioner` to your Vagrantfile:
|
32
31
|
|
33
32
|
```ruby
|
33
|
+
require 'vagrant-boxen'
|
34
34
|
Vagrant::Config.run do |config|
|
35
35
|
# ... other settings ...
|
36
36
|
config.vm.provision Vagrant::Boxen::Provisioner do |boxen|
|
37
|
-
|
37
|
+
# Install redis and memcached with defaults
|
38
|
+
boxen.install :redis, :memcached
|
39
|
+
|
40
|
+
# or specify configuration options for the module
|
41
|
+
boxen.redis {
|
42
|
+
port '1234'
|
43
|
+
memory '1gb'
|
44
|
+
}
|
38
45
|
end
|
39
46
|
end
|
40
47
|
```
|
41
48
|
|
42
|
-
While the modules provided might work on most linux distributions, I'm
|
43
|
-
|
49
|
+
While the modules provided might work on most linux distributions, [I'm developing
|
50
|
+
against](Vagrantfile) an Ubuntu 12.10 64bits box based on https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box
|
44
51
|
|
45
52
|
To find out more about the planned functionality, check out the
|
46
53
|
[project's issues](https://github.com/fgrehm/vagrant-boxen/issues).
|
@@ -49,9 +56,9 @@ To find out more about the planned functionality, check out the
|
|
49
56
|
## How does it work?
|
50
57
|
|
51
58
|
Under the hood, [`Vagrant::Boxen::Provisioner`](https://github.com/fgrehm/vagrant-boxen/blob/master/lib/vagrant-boxen/provisioner.rb)
|
52
|
-
will
|
53
|
-
[`Vagrant::Provisioners::Puppet`](https://github.com/mitchellh/vagrant/blob/1-0-stable/lib/vagrant/provisioners/puppet.rb)
|
54
|
-
|
59
|
+
will generate a puppet manifest based on the configured modules that will get
|
60
|
+
passed to a [`Vagrant::Provisioners::Puppet`](https://github.com/mitchellh/vagrant/blob/1-0-stable/lib/vagrant/provisioners/puppet.rb)
|
61
|
+
configured to use the bundled puppet modules.
|
55
62
|
|
56
63
|
|
57
64
|
## Contributing
|
data/Rakefile
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
+
desc 'Update puppet module dependencies using librarian-puppet'
|
3
4
|
task :update do
|
4
5
|
require 'fileutils'
|
5
|
-
sh 'librarian-puppet install --path="puppet
|
6
|
-
Dir['./puppet
|
6
|
+
sh 'librarian-puppet install --path="puppet-modules" --strip-dot-git --clean --verbose'
|
7
|
+
Dir['./puppet-modules/*/{.git,.gitignore,tests,spec,Rakefile,.travis.yml,TODO.md,Gemfile}'].each do |path|
|
7
8
|
FileUtils.rm_rf path
|
8
9
|
end
|
9
10
|
end
|
data/Vagrantfile
CHANGED
@@ -7,7 +7,22 @@ Vagrant::Config.run do |config|
|
|
7
7
|
config.vm.box = "quantal64"
|
8
8
|
config.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box"
|
9
9
|
|
10
|
+
if defined? VagrantVbguest::Config
|
11
|
+
config.vbguest.auto_update = false
|
12
|
+
config.vbguest.no_remote = true
|
13
|
+
end
|
14
|
+
|
10
15
|
config.vm.provision Vagrant::Boxen::Provisioner do |boxen|
|
11
|
-
|
16
|
+
# Install modules with defaults (the defaults are listed as examples below):
|
17
|
+
# boxen.install :memcached, :redis
|
18
|
+
|
19
|
+
# or set module parameters:
|
20
|
+
|
21
|
+
boxen.redis {
|
22
|
+
memory '5mb'
|
23
|
+
port '6379'
|
24
|
+
}
|
25
|
+
|
26
|
+
boxen.memcached { memory '25' }
|
12
27
|
end
|
13
28
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Vagrant::Boxen::BaseModule
|
2
|
+
# TODO: Auto include module config on provisioner config class
|
3
|
+
|
4
|
+
protected
|
5
|
+
|
6
|
+
def build_options(allowed_options, options, &options_block)
|
7
|
+
if !options && options_block
|
8
|
+
eval_options(allowed_options, &options_block)
|
9
|
+
else
|
10
|
+
options
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def eval_options(allowed_options, &block)
|
15
|
+
Vagrant::Boxen::OptionsEvaluator.new(allowed_options, &block).to_hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def puppet_options
|
19
|
+
beggining = @options.size > 1 ? "\n" : ''
|
20
|
+
beggining + @options.map do |key, value|
|
21
|
+
" #{key} => '#{value}',\n" if value
|
22
|
+
end.compact.join
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module HashSlice
|
2
|
+
# From ActiveSupport
|
3
|
+
def slice(*keys)
|
4
|
+
keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
|
5
|
+
hash = self.class.new
|
6
|
+
keys.each { |k| hash[k] = self[k] if has_key?(k) }
|
7
|
+
hash
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Hash.instance_eval { include HashSlice } unless Hash.instance_methods.include?(:slice)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Boxen
|
3
|
+
class ManifestBuilder
|
4
|
+
def initialize(config)
|
5
|
+
@config = config
|
6
|
+
end
|
7
|
+
|
8
|
+
def build
|
9
|
+
exec_defaults + @config.enabled_modules.map do |mod|
|
10
|
+
mod.build_manifest
|
11
|
+
end.join("\n\n")
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def exec_defaults
|
17
|
+
"Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/'] }\n\n"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Vagrant::Boxen::Modules
|
2
|
+
class Memcached
|
3
|
+
module Config
|
4
|
+
def memcached(options = nil, &options_block)
|
5
|
+
enable_module Memcached.new(options, &options_block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
include Vagrant::Boxen::BaseModule
|
10
|
+
|
11
|
+
def initialize(options = nil, &options_block)
|
12
|
+
options = build_options([:memory], options, &options_block)
|
13
|
+
@options = { :max_memory => options.fetch(:memory, '25') }
|
14
|
+
end
|
15
|
+
|
16
|
+
def build_manifest
|
17
|
+
"class { 'memcached': #{puppet_options}}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Vagrant::Boxen::Provisioner.config_class.instance_eval do
|
23
|
+
include Vagrant::Boxen::Modules::Memcached::Config
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'vagrant-boxen/base_module'
|
2
|
+
|
3
|
+
module Vagrant::Boxen::Modules
|
4
|
+
class Redis
|
5
|
+
module Config
|
6
|
+
def redis(options = nil, &options_block)
|
7
|
+
enable_module Redis.new(options, &options_block)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
include Vagrant::Boxen::BaseModule
|
12
|
+
|
13
|
+
def initialize(options = nil, &options_block)
|
14
|
+
options = build_options([:memory, :port], options, &options_block)
|
15
|
+
@options = {
|
16
|
+
:redis_max_memory => options.fetch(:memory, '5mb'),
|
17
|
+
:redis_port => options[:port]
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def build_manifest
|
22
|
+
"class { 'redis': #{puppet_options}}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Vagrant::Boxen::Provisioner.config_class.instance_eval do
|
28
|
+
include Vagrant::Boxen::Modules::Redis::Config
|
29
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Vagrant::Boxen
|
2
|
+
# TODO: Write specs ;)
|
3
|
+
class OptionsEvaluator
|
4
|
+
def initialize(allowed_options, &block)
|
5
|
+
@allowed_options = allowed_options
|
6
|
+
@block = block
|
7
|
+
@hash = {}
|
8
|
+
end
|
9
|
+
|
10
|
+
def method_missing(method, *args)
|
11
|
+
if @allowed_options.include?(method)
|
12
|
+
@hash[method] = args.first
|
13
|
+
else
|
14
|
+
super
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_hash
|
19
|
+
instance_eval(&@block)
|
20
|
+
@hash
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -2,12 +2,32 @@ module Vagrant
|
|
2
2
|
module Boxen
|
3
3
|
class Provisioner < Vagrant::Provisioners::Base
|
4
4
|
class Config < Vagrant::Config::Base
|
5
|
-
|
6
|
-
|
5
|
+
attr_reader :enabled_modules
|
6
|
+
|
7
|
+
def initialize(*args)
|
8
|
+
super
|
9
|
+
@enabled_modules = []
|
10
|
+
end
|
11
|
+
|
12
|
+
def install(mod)
|
13
|
+
enable_module module_for(mod).new
|
7
14
|
end
|
8
15
|
|
9
|
-
def
|
10
|
-
@
|
16
|
+
def enable_module(mod)
|
17
|
+
@enabled_modules << mod
|
18
|
+
end
|
19
|
+
|
20
|
+
protected
|
21
|
+
|
22
|
+
def module_for(mod)
|
23
|
+
Vagrant::Boxen::Modules.const_get classify_string(mod)
|
24
|
+
end
|
25
|
+
|
26
|
+
def classify_string(string)
|
27
|
+
string.to_s.split('_').map do |word|
|
28
|
+
word[0] = word[0].upcase
|
29
|
+
word
|
30
|
+
end.join
|
11
31
|
end
|
12
32
|
end
|
13
33
|
|
@@ -17,18 +37,14 @@ module Vagrant
|
|
17
37
|
|
18
38
|
def initialize(env, config, provisioner = nil)
|
19
39
|
super(env, config)
|
20
|
-
@
|
21
|
-
@manifests_dir = "/tmp/vagrant-boxen-#{env['vm'].uuid}"
|
40
|
+
@manifests_dir = "/tmp/vagrant-boxen-#{env['vm'].uuid}"
|
22
41
|
@puppet_provisioner = provisioner ? provisioner : setup_puppet_provisioner
|
23
42
|
end
|
24
43
|
|
25
44
|
def prepare
|
26
45
|
Dir.mkdir @manifests_dir unless File.directory? @manifests_dir
|
27
|
-
|
28
|
-
|
29
|
-
else
|
30
|
-
File.open("#{@manifests_dir}/site.pp", 'w') { |f| f.print "" }
|
31
|
-
end
|
46
|
+
builder = ManifestBuilder.new(config)
|
47
|
+
File.open("#{@manifests_dir}/site.pp", 'w') { |f| f.print builder.build }
|
32
48
|
@puppet_provisioner.prepare
|
33
49
|
end
|
34
50
|
|
@@ -42,11 +58,14 @@ module Vagrant
|
|
42
58
|
config = Vagrant::Provisioners::Puppet::Config.new
|
43
59
|
config.manifests_path = @manifests_dir
|
44
60
|
config.manifest_file = "site.pp"
|
45
|
-
config.module_path = File.join(File.expand_path('../../../', __FILE__), 'puppet
|
61
|
+
config.module_path = File.join(File.expand_path('../../../', __FILE__), 'puppet-modules')
|
46
62
|
# The root path to be used on the guest machine, changed to avoid
|
47
63
|
# collision with the default path for puppet provisioner
|
48
64
|
config.pp_path = '/tmp/vagrant-boxen-puppet'
|
49
|
-
|
65
|
+
|
66
|
+
config.options << [ '--verbose ' ] if ENV['VERBOSE'] == '1'
|
67
|
+
config.options << [ '--debug '] if ENV['DEBUG'] == '1'
|
68
|
+
|
50
69
|
Vagrant::Provisioners::Puppet.new(env, config)
|
51
70
|
end
|
52
71
|
end
|
data/lib/vagrant-boxen.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
require 'vagrant'
|
2
2
|
|
3
3
|
if File.exists?(File.join(File.expand_path('../../', __FILE__), '.git'))
|
4
|
+
ENV['VERBOSE'] = '1'
|
4
5
|
$:.unshift(File.expand_path('../../lib', __FILE__))
|
5
6
|
end
|
6
7
|
|
7
|
-
require "vagrant-boxen/version"
|
8
|
-
require "vagrant-boxen/provisioner"
|
9
|
-
|
10
8
|
module Vagrant
|
11
9
|
module Boxen
|
10
|
+
module Modules
|
11
|
+
end
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
Dir[File.dirname(__FILE__) + '/**/*.rb'].each do |file|
|
16
|
+
require file
|
17
|
+
end
|
File without changes
|
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
name 'puppetlabs-gcc'
|
2
|
+
version '0.0.3'
|
3
|
+
source 'git://github.com/puppetlabs/puppetlabs-gcc.git'
|
4
|
+
author 'puppetlabs'
|
5
|
+
license 'Apache 2.0'
|
6
|
+
summary 'module for installing gcc build utils'
|
7
|
+
description 'module for installing gcc build utils'
|
8
|
+
project_page 'https://github.com/puppetlabs/puppetlabs-gcc/'
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Class: gcc
|
2
|
+
#
|
3
|
+
# This class installs gcc
|
4
|
+
#
|
5
|
+
# Parameters:
|
6
|
+
#
|
7
|
+
# Actions:
|
8
|
+
# - Install the gcc package
|
9
|
+
#
|
10
|
+
# Requires:
|
11
|
+
#
|
12
|
+
# Sample Usage:
|
13
|
+
#
|
14
|
+
class gcc {
|
15
|
+
|
16
|
+
include gcc::params
|
17
|
+
|
18
|
+
package { $gcc::params::gcc_package:
|
19
|
+
ensure => installed
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Class: gcc::params
|
2
|
+
#
|
3
|
+
# This class manages parameters for the gcc module
|
4
|
+
#
|
5
|
+
# Parameters:
|
6
|
+
#
|
7
|
+
# Actions:
|
8
|
+
#
|
9
|
+
# Requires:
|
10
|
+
#
|
11
|
+
# Sample Usage:
|
12
|
+
#
|
13
|
+
class gcc::params{
|
14
|
+
|
15
|
+
case $operatingsystem {
|
16
|
+
'fedora', 'centos', 'redhat': {
|
17
|
+
$gcc_package = 'gcc'
|
18
|
+
}
|
19
|
+
'ubuntu', 'debian': {
|
20
|
+
$gcc_package = [ 'gcc', 'build-essential' ]
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"license": "Apache 2.0",
|
3
|
+
"description": "module for installing gcc build utils",
|
4
|
+
"checksums": {
|
5
|
+
"manifests/params.pp": "9a06d348c7689e7b9c811a3bc8d17502",
|
6
|
+
"CHANGELOG": "457a1f5fbbdc54009aca57949087f59e",
|
7
|
+
"LICENSE": "0e5ccf641e613489e66aa98271dbe798",
|
8
|
+
"tests/params.pp": "34196cd17ebe3b0665a909625dc384f7",
|
9
|
+
"tests/init.pp": "d97b158981e1e2b710a0dec5ce8d40d0",
|
10
|
+
"Modulefile": "7e533294bc8d86a046246bbea0046a1e",
|
11
|
+
"manifests/init.pp": "a9f1f5821033784692ca044e5a06d278"
|
12
|
+
},
|
13
|
+
"summary": "module for installing gcc build utils",
|
14
|
+
"types": [
|
15
|
+
|
16
|
+
],
|
17
|
+
"source": "git://github.com/puppetlabs/puppetlabs-gcc.git",
|
18
|
+
"project_page": "https://github.com/puppetlabs/puppetlabs-gcc/",
|
19
|
+
"author": "puppetlabs",
|
20
|
+
"name": "puppetlabs-gcc",
|
21
|
+
"version": "0.0.3",
|
22
|
+
"dependencies": [
|
23
|
+
|
24
|
+
]
|
25
|
+
}
|