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
--- !ruby/object:Puppet::Transaction::Report | |
status: failed | |
environment: staging3 | |
transaction_uuid: "1334b82a-bbd5-4562-914d-c07cd96139db" | |
puppet_version: "3.6.2" | |
logs: | |
- !ruby/object:Puppet::Util::Log | |
source: Puppet | |
tags: | |
- err |
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 String | |
old_format = instance_method(:%) | |
define_method(:%) do |arg| | |
return self unless self =~ /%/ | |
if arg.is_a?(Hash) | |
(self.gsub(/%\{([^%]*?)\}/) { | |
a = $1 | |
if a =~ /([^\[]+)\[([^\]]*)\](.*)/ | |
h = arg[$1.to_sym][$2.to_sym] |
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
values = {} | |
format.scan(/%{([^}]+)}/).flatten.map { |e| values[e.to_sym] = eval(e) } | |
format % values |
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 firewall rules | |
firewall { '000 accept all icmp': | |
proto => 'icmp', | |
action => 'accept', | |
} | |
firewall { '001 accept all to lo interface': | |
proto => 'all', | |
iniface => 'lo', | |
action => 'accept', | |
} |
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/ruby | |
require 'mcollective' | |
include ::MCollective::RPC | |
mc = rpcclient('rpcutil') | |
mc.discovery_method = 'puppetdb' | |
mc.progress = false | |
mc.ping |
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
augeas { 'disable-nagios-result-limit': | |
changes => 'set /files/etc/nagios3/cgi.cfg/result_limit 0', | |
} |
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
inventory do | |
format "%s\t|\t%s\t|\t%s\t|\t%s\t|\t%s\t|\t%s" | |
fields { | |
[ identity, facts["puppetversion"], facts["facterversion"], facts["augeasversion"], facts["rubyversion"], facts["lsbdistcodename"] ] | |
} | |
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
# Setting up !requiretty | |
augtool> touch /files/etc/sudoers/Defaults[last()]/requiretty/negate | |
# For a user alias, the best is to use a variable with defnode | |
augtool> defnode alias /files/etc/sudoers/User_Alias/alias/name "EXAMPLE_ADMINS" | |
augtool> set $alias/../user "cslack" | |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Venir depuis la gare</title> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
<meta http-equiv="content-script-type" content="text/javascript" /> | |
<meta http-equiv="content-style-type" content="text/css" /> | |
<meta http-equiv="content-language" content="en" /> | |
<meta name="generator" content="Easymap" /> | |
<link rel="stylesheet" type="text/css" href="map.css" /> |
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/ruby | |
require 'puppetdb' | |
require 'puppet' | |
require 'json' | |
Puppet.initialize_settings | |
key = Puppet.settings['hostprivkey'] | |
cert = Puppet.settings['hostcert'] | |
ca_file = Puppet.settings['localcacert'] |