Skip to content

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
* installs awscli (and python dependencies if necessary)
* TravisCI tests setup and passing
* Vagrantfile defaults to Ubuntu and works
  • Loading branch information
jdowning committed Jan 8, 2014
0 parents commit 328afc2
Show file tree
Hide file tree
Showing 18 changed files with 233 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fixtures:
symlinks:
awscli: "#{source_dir}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pkg/*
.vagrant*
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
branches:
only:
- master
language: ruby
rvm:
- 1.9.3
bundler_args: --without development
script: bundle exec rake spec SPEC_OPTS='--format documentation'
env:
matrix:
- PUPPET_VERSION="2.7.23"
- PUPPET_VERSION="3.0.2"
- PUPPET_VERSION="3.1.1"
- PUPPET_VERSION="3.2.4"
- PUPPET_VERSION="3.3.1"
notifications:
email:
- [email protected]
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.2']

gem 'rake'
gem 'puppet', puppetversion
gem 'puppet-lint'
gem 'puppetlabs_spec_helper'
42 changes: 42 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
facter (1.7.4)
hiera (1.3.0)
json_pure
json_pure (1.8.1)
metaclass (0.0.1)
mocha (0.14.0)
metaclass (~> 0.0.1)
puppet (3.4.1)
facter (~> 1.6)
hiera (~> 1.0)
rgen (~> 0.6.5)
puppet-lint (0.3.2)
puppetlabs_spec_helper (0.4.1)
mocha (>= 0.10.5)
rake
rspec (>= 2.9.0)
rspec-puppet (>= 0.1.1)
rake (10.1.1)
rgen (0.6.6)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-puppet (1.0.1)
rspec

PLATFORMS
ruby

DEPENDENCIES
puppet (>= 3.2)
puppet-lint
puppetlabs_spec_helper
rake
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2014 Justin Downing

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions Modulefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name 'jdowning/awscli'
version '0.1.0'
source 'https://github.com/justindowning/puppet-awscli'
author 'Justin Downing'
license 'Apache License, Version 2.0'
summary 'Install awscli'
description 'Install awscli'
project_page 'https://github.com/justindowning/puppet-awscli'
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# awscli

[![Build Status](https://travis-ci.org/justindowning/puppet-awscli.png)](https://travis-ci.org/justindowning/puppet-awscli)

## Description

This Puppet module will install [awscli](https://github.com/aws/aws-cli). It is works with Debian/Ubuntu based distros. It should also work with RedHat/CentOS as long as the EPEL repository is available.

## Installation

`puppet module install --modulepath /path/to/puppet/modules jdowning-awscli`

## Usage

`class { 'awscli': }`

## Testing

`vagrant up`
5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'puppet-lint/tasks/puppet-lint'
require 'puppetlabs_spec_helper/rake_tasks'

PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.ignore_paths = ["pkg/**/**/*.pp"]
29 changes: 29 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.hostname = 'puppet-awscli'
config.vm.synced_folder ".", "/tmp/awscli"

#config.vm.define "centos" do |centos|
# centos.vm.box = 'centos64'
# centos.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box'
# centos.vm.provision :puppet do |puppet|
# puppet.manifests_path = "tests"
# puppet.manifest_file = "vagrant.pp"
# puppet.options = ["--modulepath", "/tmp"]
# end
#end

config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.box = 'ubuntu64'
ubuntu.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box'
ubuntu.vm.provision :shell, :inline => 'aptitude update'
ubuntu.vm.provision :puppet do |puppet|
puppet.manifests_path = "tests"
puppet.manifest_file = "vagrant.pp"
puppet.options = ["--modulepath", "/tmp"]
end
end

end
10 changes: 10 additions & 0 deletions manifests/deps.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ==Class: awscli::deps
class awscli::deps {
if ! defined(Package['python-dev']) {
package { 'python-dev': ensure => installed }
}

if ! defined(Package['python-pip']) {
package { 'python-pip': ensure => installed }
}
}
33 changes: 33 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# == Class: awscli
#
# Install awscli
#
# === Parameters
#
# None
#
# === Variables
#
# None
#
# === Examples
#
# class { awscli: }
#
# === Authors
#
# Justin Downing <[email protected]>
#
# === Copyright
#
# Copyright 2014 Justin Downing
#
class awscli {
include awscli::deps

package { 'awscli':
ensure => 'latest',
provider => 'pip',
require => Class['awscli::deps'],
}
}
12 changes: 12 additions & 0 deletions spec/classes/awscli_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'spec_helper'

describe 'awscli', :type => 'class' do
let(:facts) { { :osfamily => 'Debian' } }

it { should contain_class('awscli::deps') }

it do should contain_package('awscli').with(
'ensure' => 'latest',
'provider' => 'pip',
) end
end
Empty file added spec/fixtures/manifests/site.pp
Empty file.
1 change: 1 addition & 0 deletions spec/fixtures/modules/awscli/manifests
8 changes: 8 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'rspec-puppet'

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))

RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
end
12 changes: 12 additions & 0 deletions tests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The baseline for module testing used by Puppet Labs is that each manifest
# should have a corresponding test manifest that declares that class or defined
# type.
#
# Tests are then run by using puppet apply --noop (to check for compilation
# errors and view a log of events) or by fully applying the test in a virtual
# environment (to compare the resulting system state to the desired state).
#
# Learn more about module testing here:
# http://docs.puppetlabs.com/guides/tests_smoke.html
#
include awscli
1 change: 1 addition & 0 deletions tests/vagrant.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class { 'awscli': }

0 comments on commit 328afc2

Please sign in to comment.