This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pipeline name="deploy"> | |
<stage name="deploy"> | |
<jobs> | |
<job name="deploy"> | |
<tasks> | |
<exec command="bundle" workingdir="rpm"> | |
<arg>install</arg> | |
<arg>--quiet</arg> | |
<arg>--path</arg> | |
<arg>/var/go/gems</arg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fog' | |
service = Fog::Compute.new({ | |
:provider => 'rackspace', | |
:rackspace_username => Fog.credentials[:rackspace_username], | |
:rackspace_api_key => Fog.credentials[:rackspace_api_key], | |
:version => :v2, # Use Next Gen Cloud Servers | |
:rackspace_region => :dfw | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
config.vm.provision :shell, :inline => "facter --yaml > /vagrant/fixtures/facts/$HOSTNAME.yaml" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Validates the syntax of the puppet manifest files' | |
task :validate do | |
puts `puppet parser validate #{Dir['**/*.pp'].join(' ')}` | |
fail unless $?.to_i == 0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppet-lint' | |
PuppetLint.configuration.log_format = '%{path}:%{linenumber} - %{KIND}: %{message}' | |
PuppetLint.configuration.send('disable_80chars') | |
task :lint do | |
linter = PuppetLint.new | |
PuppetLint.configuration.send("disable_documentation") | |
Dir['manifests/**/*.pp'].each do |pp| | |
linter.file = pp | |
linter.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
class WhitespaceCheck < Struct.new(:pattern, :message) | |
def lines | |
@lines ||= [] | |
end | |
def check(line, number) | |
lines << number if line =~ pattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class apps::my_frontend($ensure = 'present', $port = 8080) { | |
$args = get_scope_args() | |
$schema = { | |
'type' => 'map', | |
'mapping' => { | |
'ensure' => { | |
'type' => 'str', | |
'enum' => ['present', 'absent'], | |
}, | |
'port' => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.synced_folder "..", "/etc/puppet" | |
config.vm.provision :shell, :inline => "puppet apply --modulepath '/etc/puppet/modules:/etc/puppet/my_modules/' #{ENV['MANIFEST_FILE']} --detailed-exitcodes || [ $? -eq 2 ]" | |
config.vm.box = "ubuntu_precise64" | |
config.vm.hostname = "module-test.example.com" | |
config.vm.box_url = "http://f.willianfernandes.com.br/vagrant-boxes/UbuntuServer12.04amd64.box" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: map | |
mapping: | |
redis_password: | |
type: str | |
required: yes | |
# Uncomment the next line to require redis passwords to be encrypted | |
# pattern: /ENC[.*]/ | |
toggles: | |
type: map | |
required: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
module Puppet::Parser::Functions | |
newfunction(:has_role, :type => :rvalue) do |role| | |
has_role?(role) | |
end | |
end | |
def has_role?(role) | |
pool = lookupvar "#{role.first}_pool" | |
if pool |
OlderNewer