Skip to content

Instantly share code, notes, and snippets.

@arandilopez
Created February 24, 2016 02:38
Show Gist options
  • Save arandilopez/5f97c11a58bfe394e9e5 to your computer and use it in GitHub Desktop.
Save arandilopez/5f97c11a58bfe394e9e5 to your computer and use it in GitHub Desktop.
my site.pp
# This file manages Puppet module dependencies.
#
# It works a lot like Bundler. We provide some core modules by
# default. This ensures at least the ability to construct a basic
# environment.
# Shortcut for a module from GitHub's boxen organization
def github(name, *args)
options ||= if args.last.is_a? Hash
args.last
else
{}
end
if path = options.delete(:path)
mod name, :path => path
else
version = args.first
options[:repo] ||= "boxen/puppet-#{name}"
mod name, version, :github_tarball => options[:repo]
end
end
# Shortcut for a module under development
def dev(name, *args)
mod "puppet-#{name}", :path => "#{ENV['HOME']}/src/boxen/puppet-#{name}"
end
# Includes many of our custom types and providers, as well as global
# config. Required.
github "boxen", "3.11.1"
# Support for default hiera data in modules
github "module_data", "0.0.4", :repo => "ripienaar/puppet-module-data"
# Core modules for a basic development environment. You can replace
# some/most of these if you want, but it's not recommended.
github "brewcask", "0.0.6"
github "dnsmasq", "2.0.1"
github "foreman", "1.2.0"
github "gcc", "3.0.2"
github "git", "2.7.92"
github "go", "2.1.0"
github "homebrew", "1.13.0"
github "hub", "1.4.1"
github "inifile", "1.4.1", :repo => "puppetlabs/puppetlabs-inifile"
github "nginx", "1.6.0"
github "nodejs", "5.0.5"
github "openssl", "1.0.0"
github "phantomjs", "3.0.0"
github "pkgconfig", "1.0.0"
github "repository", "2.4.1"
github "ruby", "8.5.4"
github "stdlib", "4.7.0", :repo => "puppetlabs/puppetlabs-stdlib"
github "sudo", "1.0.0"
github "xquartz", "1.2.1"
# Optional/custom modules. There are tons available at
# https://github.com/boxen.
github "zsh", "1.0.0"
github "mysql", "2.2.0"
github "wget", "1.0.1"
github "autoconf", "1.0.0"
github "libtool", "1.0.0"
github "pcre", "1.0.0"
github "libpng", "1.0.0"
github "imagemagick", "1.3.0"
github "java", "1.8.4"
github "php", "2.0.1"
github "virtualbox", "1.0.13"
github "vagrant", "3.3.4"
# github "elasticsearch", "2.8.0"
# github "mysql", "2.0.1"
# github "postgresql", "4.0.1"
# github "redis", "3.1.0"
# github "sysctl", "1.0.1"
require boxen::environment
require homebrew
require gcc
Exec {
group => 'staff',
logoutput => on_failure,
user => $boxen_user,
path => [
"${boxen::config::home}/rbenv/shims",
"${boxen::config::home}/rbenv/bin",
"${boxen::config::home}/rbenv/plugins/ruby-build/bin",
"${boxen::config::homebrewdir}/bin",
'/usr/bin',
'/bin',
'/usr/sbin',
'/sbin'
],
environment => [
"HOMEBREW_CACHE=${homebrew::config::cachedir}",
"HOME=/Users/${::boxen_user}"
]
}
File {
group => 'staff',
owner => $boxen_user
}
Package {
provider => homebrew,
require => Class['homebrew']
}
Repository {
provider => git,
extra => [
'--recurse-submodules'
],
require => File["${boxen::config::bindir}/boxen-git-credential"],
config => {
'credential.helper' => "${boxen::config::bindir}/boxen-git-credential"
}
}
Service {
provider => ghlaunchd
}
Homebrew::Formula <| |> -> Package <| |>
node default {
# core modules, needed for most things
include dnsmasq
include git
include hub
include nginx
# fail if FDE is not enabled
if $::root_encrypted == 'no' {
fail('Please enable full disk encryption and try again')
}
# node versions
# nodejs::version { '0.8': }
# nodejs::version { '0.10': }
nodejs::version { '0.12': }
nodejs::version { '5.5.0': }
# default ruby versions
# ruby::version { '1.9.3': }
# ruby::version { '2.0.0': }
# ruby::version { '2.1.8': }
ruby::version { '2.2.4': }
# common, useful packages
package {
[
'ack',
'findutils',
'gnu-tar'
]:
}
file { "${boxen::config::srcdir}/our-boxen":
ensure => link,
target => $boxen::config::repodir
}
}
include zsh
include java
include mysql
include wget
include libtool
include pcre
include libpng
include autoconf
include imagemagick
include php
include virtualbox
# include vagrant
php::version { '5.6.18': }
php::extension::imagick
include php::composer
# class { 'vagrant':
# completion => true,
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment