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 | |
against=$1 | |
FILES=`git diff --cached --name-only --diff-filter=ACM` | |
# validate json files | |
for file in $FILES | |
do | |
# validate json files | |
if [[ $file == *.json ]]; then |
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
<html> | |
<head> | |
<script> | |
var xmlhttp = null; | |
var jsondata = null; | |
function getFactData(hostname, factname, handler) | |
{ | |
var foreman="http://foreman/api"; | |
var factpath="fact_values?search=host=" + hostname + "+and+fact=" + factname; | |
var url = foreman + "/" + factpath; |
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
localhost:bmclib cosman$ rake spec | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S rspec spec/unit/provider/bmc/ipmitool_spec.rb spec/unit/provider/bmcuser/ipmitool_spec.rb spec/unit/type/bmc_spec.rb spec/unit/type/bmcuser_spec.rb --color | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/sync.rb:58:in `Fail': Thread(#<Thread:0x10c00d360 run>) not locked. (Sync_m::Err::UnknownLocker) | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/sync.rb:64:in `Fail' | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/sync.rb:184:in `sync_unlock' | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/sync.rb:232:in `synchronize' | |
from /Library/Ruby/Gems/1.8/gems/puppet-3.3.0/lib/puppet/settings.rb:977:in `find_value' | |
from /Library/Ruby/Gems/1.8/gems/puppet-3.3.0/lib/puppet/settings.rb:1139:in `each_source' | |
from /Library/Ruby/Gems/1.8/gems/puppet-3.3.0/lib/puppet/settings.rb:1135:in `each' | |
from /Libra |
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
rake spec | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S rspec spec/unit/provider/bmc/ipmitool_spec.rb spec/unit/provider/bmcuser/ipmitool_spec.rb spec/unit/type/bmc_spec.rb spec/unit/type/bmcuser_spec.rb --color | |
/Library/Ruby/Gems/1.8/gems/puppet-3.2.4/lib/puppet/util/autoload.rb:68:in `load_file': Could not autoload puppet/type/bmc: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet/provider/bmc/ipmitool: Could not autoload puppet |
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
if File.exists?File.expand_path('~/.env_config') | |
File.open(File.expand_path('~/.env_config'), "r") do |file| | |
file.each_line do | line| | |
fact = line.split('=') | |
if fact.count > 1 | |
Facter.add(fact.first.strip) do | |
setcode do | |
fact.last.strip | |
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
#!/usr/bin/env bash | |
# first create the file with puppet just like sensu does | |
puppet apply --verbose -e 'file{"/tmp/testfile.txt": ensure => present, content => "foobar"}' | |
# now try to write to the file from ruby code (aka. the provide) just like puppet | |
cat > /tmp/providertest.rb << 'EOF' | |
#!/usr/bin/env ruby |
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
#!/usr/bin/env bash | |
# first create the file with puppet just like sensu does | |
puppet apply --verbose -e 'file{"/tmp/testfile.txt": ensure => present, content => "foobar"}' | |
# now try to write to the file from ruby code (aka. the provide) just like puppet | |
cat > /tmp/providertest.rb << 'EOF' | |
#!/usr/bin/env ruby |
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 'json' | |
require 'puppet/parser/functions' | |
module Puppet::Parser::Functions | |
newfunction(:dump_args, :type => :statement,:doc => <<-EOS | |
dump_args - prints the args to STDOUT in Pretty JSON format. | |
Useful for debugging purposes only. | |
EOS |
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
#!/usr/bin/env ruby | |
# Author: Corey Osman | |
# Date: 10/29/14 | |
# Purpose: converts the puppetfile to a .fixtures file yaml format | |
# | |
# State: works on my machine, but needs further development to support the full Puppetfile DSL and .fixtures DSL | |
# Usage: from the module directory ensure you have a Puppetfile. | |
# because destruction of any .fixtures file could be deadly you must set the WIPE_FIXTURES env varialble to true. | |
# $ WIPE_FIXTURES=true ruby puppetfile_to_fixtures.rb |
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 'beaker-rspec/spec_helper' | |
require 'beaker-rspec/helpers/serverspec' | |
require 'beaker-rspec' | |
require 'beaker' | |
RSpec.configure do |c| | |
# Project root | |
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) |
OlderNewer