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 'spec_helper' | |
# Example rspec_puppet function rspec test (i.e. subject is the function 'min') | |
# This works for other rspec subjects as well as a compiler is always involved. | |
# This kind of mocking can be required when it is not enough to simply override | |
# a function with another implementation (which can be done with a `let(:pre_condition) { 'function min($x, $y) { ... }'}` | |
# | |
# The main difficulty that this overcomes is the need to let the compiler initialize and | |
# create the context in which it will operate before making any mocks. | |
# |
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
$LOAD_PATH.push *(Dir[File.expand_path('.gems/gems/*/lib',Dir.pwd)] ) |
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
```yaml | |
--- | |
version: 2 | |
groups: | |
- name: named_local_targets | |
targets: ['not_localhost'] | |
config: | |
transport: local | |
``` |
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
--- | |
version: 2 | |
groups: | |
- name: repo_targets | |
targets: [] | |
config: | |
transport: local | |
local: | |
tmpdir: | |
_plugin: env_var |
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
# Sequence diagram with emoji+labels using the MscGen language | |
# | |
# https://mscgen.js.org/ | |
# https://mscgen.js.org/tutorial.html | |
msc { | |
hscale="0.7", | |
width="700"; | |
"👳" [label="👳\ndude", linecolor="darkgreen", textcolor="darkgreen", arclinecolor="darkgreen", arctextcolor="darkgreen"], |
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
#!/opt/puppetlabs/puppet/bin/ruby | |
# ------------------------------------------------------------------- | |
# Report the latest nodes whose catalogs that took over 300s to apply | |
# | |
# Setup: | |
# | |
# puppet-query --cert CERTNAME.cert.pem --key KEYFILE.key.pem 'reports[certname,status,catalog_uuid,receive_time,start_time,end_time,noop,noop_pending,environment,configuration_version,metrics] { latest_report? = true }' > latest_reports.json | |
# | |
# Usage: | |
# |
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
module OctocatalogDiff | |
class Config | |
def self.config | |
settings = {} | |
settings[:puppet_binary] = File.join( `bundle show puppet`.chomp, 'bin', 'puppet') | |
settings[:hiera_path_strip] = '/etc/puppetlabs/code/environments' | |
settings[:hiera_config] = 'hiera.yaml' | |
settings[:fact_file] = 'spec/factsets/sampled.facts.json' | |
settings[:from_env] = 'origin/master' | |
settings[:basedir] = Dir.pwd |
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
Vagrant.configure('2') do |c| | |
c.ssh.insert_key = false | |
c.vm.box = "centos/7" | |
c.vm.define 'target' do |v| | |
v.vm.network 'private_network', ip: '10.10.101.102' | |
end | |
c.vm.define 'bolt', primary: true do |v| | |
v.vm.network 'private_network', ip: '10.10.101.101' |
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
# Tested https://github.com/obahareth/base16-builder-ruby and WeTTY | |
default: | |
extension: .json | |
output: xtermjs |
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/sh | |
# | |
# adapted from https://gist.github.com/mitsuji/8397836 | |
# | |
# For usage, run without arguments | |
# | |
VM_NAME=$1 | |
DVD_PATH=${2:---} | |
OS_TYPE="${3:-${OS_TYPE:-RedHat_64}}" |