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
#!/bin/bash | |
message="" | |
# what OS is this? | |
cur_os=$(uname -s) | |
# do we have jq? | |
if ! which jq >/dev/null 2>&1 ; then | |
echo "please install jq" >&2 | |
exit 1 |
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
# Configure a serial port for IPMI (which provides virtual ones). | |
# Depends on the "serial_ports" custom fact, included in this module | |
define ipmi::serial { | |
include stdlib | |
include ipmi::serial_prerequisites | |
$port_exists = member($::serial_ports, "/dev/${title}") | |
if $port_exists { | |
service { $title: |
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 foo ($external_volume = true) { | |
if $external_volume { | |
notice("True!") | |
} else { | |
notice("False!") | |
} | |
} | |
class { 'foo': | |
external_volume => false, |
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
matches = { | |
[true, true] => 'fizzbuzz', | |
[true, false] => 'fizz', | |
[false, true] => 'buzz' | |
} | |
(1..100).each do |num| | |
results = [num % 3 == 0, num % 5 == 0] | |
puts matches[results] || num | |
end |
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
$alias_interface = ['primary:2'] | |
if $alias_interface =~ /^primary\:(\d+)/ { | |
notice("Match!") | |
} else { | |
notice("No 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 'yaml' | |
ldap_info = { | |
'main' => { | |
'label' => @label, | |
'host' => @host, | |
'port' => @port, | |
'uid' => @uid, | |
'method' => @method, | |
'bind_dn' => @bind_dn, |
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
include_recipe 'nginx' | |
resources(service: 'nginx').tap do |r| | |
r.action :enable | |
end | |
template '/etc/nginx/conf.d/my_file.conf' do | |
... | |
notifies :start, 'service[nginx]', :delayed | |
end |
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
default_redis_ip = 'localhost' | |
master_node = search(:node, 'role:redis-master').first | |
default_redis_ip = master_node.ipaddress unless master_node.nil? |
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 'net/http' | |
require 'open-uri' | |
require 'rubygems' | |
require 'http' # this is the http gem | |
require 'faraday' | |
class ProxyTest | |
def initialize(url) |
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
Converging 2 resources | |
Recipe: bar::default | |
* file[/tmp/bar.txt] action create[2014-10-16T23:14:38+00:00] INFO: Processing file[/tmp/bar.txt] action create (bar::default line 13) | |
[2014-10-16T23:14:38+00:00] INFO: file[/tmp/bar.txt] created file /tmp/bar.txt | |
- create new file /tmp/bar.txt[2014-10-16T23:14:38+00:00] INFO: file[/tmp/bar.txt] updated file contents /tmp/bar.txt | |
- update content in file /tmp/bar.txt from none to 4cee35 | |
--- /tmp/bar.txt 2014-10-16 23:14:38.033893771 +0000 | |
+++ /tmp/.bar.txt20141016-1369-yghu83 2014-10-16 23:14:38.033893771 +0000 |
NewerOlder