This file contains hidden or 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
# robin at Robins-MacBook-Pro in ~/tmp | |
cat test.pp | |
$test = 1 | |
case $test { | |
/^\d+$/: { | |
fail('MATCH') | |
} | |
default: { | |
fail('Not MATCH') |
This file contains hidden or 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 'spec_helper' | |
describe 'cxtool' do | |
context 'supported operating systems' do | |
['Debian', 'RedHat'].each do |osfamily| | |
describe "cxtool class without any parameters on #{osfamily}" do | |
let(:params) {{ }} | |
let(:facts) {{ | |
:osfamily => osfamily, | |
}} |
This file contains hidden or 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 documentation goes here | |
class example::config( | |
$listen_port, | |
$username, | |
$password, | |
) { | |
include ::example::params | |
file{$::example::params::config_file: | |
content => template('example/example.conf.erb'), |
This file contains hidden or 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
# - - - - - - - - - - - | |
intersection() { | |
# - - - - - - - - - - - | |
# | |
# Considers each file in a directory as being a set | |
# and each line in the file is a member of that set. | |
# Returns the intersection of all sets, ie. the | |
# items that are present in *all* sets | |
# | |
# Use it like this: |
This file contains hidden or 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
yum install perl m4 zlib-devel git | |
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/autoconf26x-2.63-4.ius.el5.noarch.rpm | |
cd /tmp | |
git clone https://github.com/sstephenson/ruby-build | |
cd ruby-build | |
RUBY_CONFIGURE_OPTS="--without-gdbm --without-dbm" ./bin/ruby-build 1.9.3-p484 /opt/ruby | |
cd /opt/ruby | |
rm -rf /tmp/ruby-build | |
echo 'export PATH=/opt/ruby/bin:$PATH' > /etc/profile.d/ruby_path.sh | |
chmod +x /etc/profile.d/ruby_path.sh |
This file contains hidden or 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
bundle exec rake spec | |
Cloning into 'spec/fixtures/modules/stdlib'... | |
remote: Reusing existing pack: 5462, done. | |
remote: Total 5462 (delta 0), reused 0 (delta 0) | |
Receiving objects: 100% (5462/5462), 1.07 MiB | 796.00 KiB/s, done. | |
Resolving deltas: 100% (2257/2257), done. | |
Checking connectivity... done. | |
Cloning into 'spec/fixtures/modules/cxtool'... | |
remote: Counting objects: 67, done. | |
remote: Compressing objects: 100% (57/57), done. |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'trollop' | |
require 'fpm' | |
# used to ensure versions extracted from gems are converted to | |
# semantic versioning-compliant strings before being used | |
# in RPM requires | |
require 'semverly' |
This file contains hidden or 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 command(command, payload, version) | |
path = '/commands' | |
form_payload = { | |
'command' => command, | |
'version' => version, | |
'payload' => payload | |
}.to_json |
This file contains hidden or 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 _create_resources(class_names) | |
resources = [ | |
{ | |
'exported' => false, | |
'parameters' => {}, | |
'tags' => [], | |
'title' => 'main', | |
'type' => 'Stage' | |
} | |
] |
This file contains hidden or 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
# install katello client | |
# ensure node is registered with katello | |
class katello::client( | |
$candlepin_package_name, | |
$candlepin_package_ensure, | |
$org, | |
$activationkey, | |
$pools = [] | |
) { |