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
/etc/puppet/modules | |
ls | |
development sites stable testing | |
# stable and testing are a SVN TAGs, development is trunk | |
svn info stable|grep URL | |
URL: svn+ssh://svn/repos/AdminToolKit/tags/modules/stable | |
ls stable/ | |
host-logmon_0.1 host-puppetmaster_0.23 host-rd-login-server_0.21 | |
host-puppetmaster_0.12 host-rd-compute_0.11 host-vmware-server_0.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
diff --git a/app/helpers/hosts_helper.rb b/app/helpers/hosts_helper.rb | |
index 217fa7f..fc3e00a 100644 | |
--- a/app/helpers/hosts_helper.rb | |
+++ b/app/helpers/hosts_helper.rb | |
@@ -4,7 +4,7 @@ module HostsHelper | |
return "N/A" | |
else | |
time = time_ago_in_words(record.last_report.getlocal) | |
- image_tag((record.error_count > 0 or record.no_report ? "false.png" : "true.png"), :size => "18x18") + | |
+ image_tag("#{record.error_count > 0 or record.no_report}.png", :size => "18x18") + |
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 'net/http' | |
# Query Foreman | |
module Puppet::Parser::Functions | |
newfunction(:foreman, :type => :rvalue) do |args| | |
#URL to query | |
host = "foreman" | |
url = "/query?" | |
query = [] | |
args.each do |arg| |
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 "puppet" | |
Puppet[:config] = "/etc/puppet/puppet.conf" | |
Puppet.parse_config | |
conf = Puppet.settings.instance_variable_get(:@values) | |
conf[:main][:environments].split(",").each do |e| | |
puts "#{[e.to_sym]}: #{conf[e.to_sym][:modulepath]}" | |
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
#!/usr/bin/ruby | |
query = ARGV[0] | |
if query.nil? | |
warn "usage: #{$0} classname" | |
exit 1 | |
end | |
require "puppet" | |
Dir.glob("/var/lib/puppet/yaml/node/*yaml").each do |node| | |
yaml = YAML.load_file node |
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 "net/http" | |
require "uri" | |
require "cgi" | |
url_new = URI.parse('http://localhost/hosts/new:3000') | |
url_create = URI.parse('http://localhost/hosts/create:3000') | |
resp, data = Net::HTTP.new(url_new.host, url_new.port).get("/hosts/new", 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
module Puppet::Parser::Functions | |
newfunction(:sshkeyfromdb, :type => :rvalue) do |args| | |
#local cache file on each puppetmaster | |
ssh_keys_file = "/tmp/sshkeys" | |
#URL to query | |
host = "puppet" | |
url = "/setting/ssh_keys?script=true" | |
#Time to keep cache - e.g. 1 hours. | |
ttl = (60 * 60) |
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 'puppet' | |
require 'getoptlong' | |
require 'pathname' | |
Puppet[:config] = "/etc/puppet/puppet.conf" | |
Puppet.parse_config | |
trap("QUIT"){ exit(-1)} | |
trap("INT"){ 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
#! /usr/bin/ruby | |
# | |
require 'yaml' | |
classes = ["a","b"] | |
environment = "test" | |
parameters = { "name" => "value", "something" => "else" } | |
puts Hash['classes' => classes, 'parameters' => parameters, 'environment' => environment].to_yaml |
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/sh | |
puppetd --config /etc/puppet/puppet.conf -o --tags no_such_tag --no-daemonize | |
wget http://puppet/chained_ca -q -O - >> /var/lib/puppet/ssl/certs/ca.pem | |
puppetd -tv # (or /etc/init.d/puppet start ) |