Skip to content

Instantly share code, notes, and snippets.

if FileTest.exists?("#{selinux_mount_point}/enforce")
if FileTest.exists?("/proc/self/attr/current")
if (File.read("/proc/self/attr/current") != "kernel\0")
[root@training cobbler]# cat zone.template
\$TTL 300
@ IN SOA $cobbler_server. nobody.example.com. (
$serial ; Serial
600 ; Refresh
1800 ; Retry
604800 ; Expire
300 ; TTL
)
#!/bin/env ruby
require 'yaml'
YAML.load_file ARGV[0]
#!/bin/env ruby
require 'yaml'
require "net/https"
require 'socket'
node=ARGV[0]
http = Net::HTTP.new('localhost', 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
begin
with pe-httpd stopped
bash|curl
real 0m0.962s
user 0m0.198s
sys 0m0.580s
ruby
https://github.com/jordansissel/fpm
require 'irb/completion'
# THIS FILE MANAGED BY PUPPET - EDIT BY HAND AT YOUR PERIL
<% foo = scope.to_hash -%>
<% foo.sort.each do |k,v| -%>
<%= "#{k} = #{v}" %>
<% end -%>
class mcocertcollector ( $mcoclass = 'pe_mcollective', $clientpubkeydir = '/tmp/foo' ) {
$hosts = query_nodes("Class[${mcoclass}]")
file { $clientpubkeydir:
ensure => directory,
purge => true,
recurse => true,
}
#!/opt/puppet/bin/puppet apply
include foo
class foo {
notify {'foomomomo': }
}
@fiddyspence
fiddyspence / gist:7585436
Created November 21, 2013 16:56
Broken/missing init script
service { 'iptables':
ensure => stopped,
enable => false,
hasstatus => false,
status => 'if [ -f /etc/init.d/iptables ]; then service iptables status; else false; fi',
}
if 'false' {
notify { 'foo': }
}
[root@master2 ntp]# puppet apply foo.pp
Notice: Compiled catalog for master2 in environment production in 0.05 seconds
Notice: foo
Notice: /Stage[main]//Notify[foo]/message: defined 'message' as 'foo'
Notice: Finished catalog run in 0.40 seconds