Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix libxslt-dev package install failure. #7

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ Vagrant.configure('2') do |config|
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.synced_folder './code', '/home/vagrant/code', nfs: true

config.ssh.forward_agent = true

config.vm.provision :chef_solo do |chef|
chef.json = {
repo: 'foo/bar'
}

chef.cookbooks_path = ['chef/cookbooks']
chef.add_recipe 'recipe[cocoon]'
end
Expand Down
18 changes: 18 additions & 0 deletions chef/cookbooks/bash/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.vagrant
Berksfile.lock
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
/cookbooks

# Bundler
Gemfile.lock
bin/*
.bundle/*

# RVM
.rvmrc
.ruby-*
6 changes: 6 additions & 0 deletions chef/cookbooks/bash/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rvm:
- 1.9.3
- 2.0.0
script:
- bundle exec foodcritic -f any .
- bundle exec rspec --color --format progress
11 changes: 11 additions & 0 deletions chef/cookbooks/bash/Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
site :opscode
group :integration do
cookbook 'minitest-handler'
end

group :unit do
cookbook 'test',
path: 'spec/support/cookbooks/test'
end

metadata
8 changes: 8 additions & 0 deletions chef/cookbooks/bash/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'berkshelf'
gem 'thor-foodcritic'

group :dev do
gem 'chefspec'
end
13 changes: 13 additions & 0 deletions chef/cookbooks/bash/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (C) 2013 Guilhem Lettron

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
50 changes: 50 additions & 0 deletions chef/cookbooks/bash/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# bash cookbook

[![Build Status](https://travis-ci.org/optiflows-cookbooks/bash.png)](https://travis-ci.org/optiflows-cookbooks/bash)

This cookbook provides a simple `bash_profile` LWRP.

It create multiple files in bash\_profile.d folder and merge them into bash\_profile file without loosing any local existing version.

Obviously, it works only on Linux platform.

## Usage
Just add `bash` to your cookbook dependency list.

## Requirement
N/C

## Resource / Provider
* `bash_profile` : does the init/setup/parse/merge process. This LWRP will create bash\_profile.d folder if not present.

If an existing bash_profile file exists in user home folder, it will be saved in a permanent init file at the very first run and then will be merged each time LWRP is called.

### Action
* `add:` (default) - add a specified file to bash\_profile.d folder and merge all files from this folder to given user bash\_profile file.
* `remove:` - remove a specified file from bash\_profile.d folder.

## Attributes

* `filename` - name of the file

* `user` - user to interact with. Group and home folder will be automaticly resolved from system informations.

* `content` - String to be set on the new profile file. It easily works with simple string, multiline string, or strings loaded from a file.

#### Syntax

bash_profile 'profile.addin' do
user 'jdoe'
content "PATH=/home/jdoe/my_bin:$PATH"
end

## Testing

Includes basic [chefspec](sethvargo/chefspec) support and matchers.

1. `bundle install`
2. `rspec`

## Author

Author:: Guilhem Lettron (<guilhem.lettron@optiflows.com>)
6 changes: 6 additions & 0 deletions chef/cookbooks/bash/Thorfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# encoding: utf-8

require 'bundler'
require 'bundler/setup'
require 'thor/foodcritic'
require 'berkshelf/thor'
87 changes: 87 additions & 0 deletions chef/cookbooks/bash/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

config.vm.hostname = "bash-berkshelf"

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "Berkshelf-CentOS-6.3-x86_64-minimal"

# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box"

# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
config.vm.network :private_network, ip: "33.33.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.

# config.vm.network :public_network

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider :virtualbox do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
# end
#
# View the documentation for the provider you're using for more
# information on available options.

config.ssh.max_tries = 40
config.ssh.timeout = 120

# The path to the Berksfile to use with Vagrant Berkshelf
# config.berkshelf.berksfile_path = "./Berksfile"

# Enabling the Berkshelf plugin. To enable this globally, add this configuration
# option to your ~/.vagrant.d/Vagrantfile file
config.berkshelf.enabled = true

# An array of symbols representing groups of cookbook described in the Vagrantfile
# to exclusively install and copy to Vagrant's shelf.
# config.berkshelf.only = []

# An array of symbols representing groups of cookbook described in the Vagrantfile
# to skip installing and copying to Vagrant's shelf.
# config.berkshelf.except = []

config.vm.provision :chef_solo do |chef|
chef.json = {
:mysql => {
:server_root_password => 'rootpass',
:server_debian_password => 'debpass',
:server_repl_password => 'replpass'
}
}

chef.run_list = [
"recipe[minitest-handler::default]",
"recipe[bash::default]"
]
end
end
96 changes: 96 additions & 0 deletions chef/cookbooks/bash/chefignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Put files/directories that should be ignored in this file when uploading
# or sharing to the community site.
# Lines that start with '# ' are comments.

# OS generated files #
######################
.DS_Store
Icon?
nohup.out
ehthumbs.db
Thumbs.db

# SASS #
########
.sass-cache

# EDITORS #
###########
\#*
.#*
*~
*.sw[a-z]
*.bak
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log

## COMPILED ##
##############
a.out
*.o
*.pyc
*.so
*.com
*.class
*.dll
*.exe
*/rdoc/

# Testing #
###########
.watchr
.rspec
spec/*
spec/fixtures/*
test/*
features/*
Guardfile
Procfile

# SCM #
#######
.git
*/.git
.gitignore
.gitmodules
.gitconfig
.gitattributes
.svn
*/.bzr/*
*/.hg/*
*/.svn/*

# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp

# Cookbooks #
#############
CONTRIBUTING
CHANGELOG*

# Strainer #
############
Colanderfile
Strainerfile
.colander
.strainer

# Vagrant #
###########
.vagrant
Vagrantfile

# Travis #
##########
.travis.yml
6 changes: 6 additions & 0 deletions chef/cookbooks/bash/files/default/bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Managed by Chef. Local changes will be overwritten.
# To manually add resources to the bash_profile, create a file in the ~/.bash_profile.d folder and add your changes there.

for file in ~/.bash_profile.d/* ; do
source ${file}
done
11 changes: 11 additions & 0 deletions chef/cookbooks/bash/files/default/tests/minitest/default_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require File.expand_path('../support/helpers', __FILE__)

describe 'bash::default' do

include Helpers::Bash

# Example spec tests can be found at http://git.io/Fahwsw
it 'runs no tests by default' do
end

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Helpers
module Bash
include MiniTest::Chef::Assertions
include MiniTest::Chef::Context
include MiniTest::Chef::Resources
end
end
9 changes: 9 additions & 0 deletions chef/cookbooks/bash/libraries/matchers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if defined?(ChefSpec)
def add_bash_profile(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:bash_profile, :add, resource_name)
end

def remove_bash_profile(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:bash_profile, :remove, resource_name)
end
end
7 changes: 7 additions & 0 deletions chef/cookbooks/bash/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name 'bash'
maintainer 'Guilhem Lettron'
maintainer_email 'guilhem.lettron@optiflows.com'
license 'Apache 2.0'
description 'Installs/Configures bash'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.3'
Loading