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
RSpec.configure do |conf| | |
conf.module_path = File.join(fixture_path, 'modules') | |
conf.manifest_dir = File.join(fixture_path, 'manifests') | |
conf.hiera_config = File.join(fixture_path, 'hiera.yaml') | |
end | |
# Not sure this works for all types of https://github.com/rodjek/rspec-puppet tests. I think it works with host tests | |
if ENV['PUPPET_DEBUG'] | |
Puppet::Util::Log.level = :debug | |
Puppet::Util::Log.newdestination(:console) |
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 : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "dummy" | |
config.vm.provider :rackspace do |rs| |
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
require 'rouge' | |
module Rouge | |
module Lexers | |
class Android < Rouge::Lexers::Java | |
tag 'android' | |
end | |
end | |
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
... | |
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
def vcr_to_pacto_request vcr_request | |
uri = URI(vcr_request.uri) | |
definition = { | |
'method' => vcr_request.method, | |
'path' => uri.path, | |
# How do we get params from VCR? | |
'params' => {}, | |
'headers' => vcr_request.headers | |
} | |
Pacto::Request.new uri.host, definition |
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
#!/bin/bash | |
if [[ -z $GOLANG_VERSION ]]; then | |
GOLANG_VERSION=1.1.1 | |
echo "No version provided for go, will use the last one: $GOLANG_VERSION" 1>&2 | |
fi | |
set -e | |
ARCH=`uname -m` |
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 |
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
# -*- 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" |
NewerOlder