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 | |
# | |
# This scripts runs on remote puppetmasters that you wish to import their nodes facts into Foreman | |
# it uploads all of the new facts its encounter based on a control file which is stored in /tmp directory. | |
# This script can run in cron, e.g. once every minute | |
# if you run it on many puppetmasters at the same time, you might consider adding something like: | |
# sleep rand(10) # that not all PM hammers the DB at once. | |
# [email protected] | |
# puppet config dir |
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 "rubygems" | |
require "rest_client" | |
require "json" | |
require "uri" | |
fqdn = ARGV[0] || raise("Must define a fqdn") | |
mac = ARGV[1] || raise("Must define a mac") | |
ip = ARGV[2] || raise("Must define a IP") |
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 Foreman | |
# example usage: | |
# | |
# query for hosts | |
# ~~~~~~~~~~~~~~~ | |
# $myhosts = foreman("hosts","facts.domain ~ lab") | |
# returns all hosts which have lab as part of their domain. | |
# |
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 | |
curl -H "Accept:application/json" \ | |
-k -u admin:changeme \ | |
-d "_method=put" \ | |
-d "architecture[name]=x86_64_new" \ | |
http://0.0.0.0:3000/architectures/x86_64 |
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 | |
# Copyright (C) 2011 Vijay Brian Gupta [email protected] | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 | |
SETTINGS = { | |
:url => "http://foreman", | |
:puppetdir => "/var/lib/puppet", | |
:timeout => 3, | |
} | |
### Do not edit below this line |
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 | |
# | |
USER="admin" | |
PASS="changeme" | |
NAME=$1 | |
KATELLO_HOSTGROUP="15" | |
curl -H "Accept:application/json" \ | |
-k -u $USER:$PASS \ | |
-d "host[name]=$NAME" -d "host[hostgroup_id]=$KATELLO_HOSTGROUP" \ |
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
Puppet::Parser::Functions::newfunction(:add_arguments, :doc => <<-'ENDHEREDOC') do |args| | |
Converts a hash into a set of arguments that are added to the specified resource. | |
This function takes two arguments: a resource name, and a hash describing | |
a set of resources. The hash should be in the form `{title => {parameters} }`: | |
# A hash of arguments: | |
$myarguments = { | |
uid => '1330', | |
group => allstaff, |
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 tester { | |
class { "params": variable => $enc_foo } | |
} |
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/application_helper.rb b/app/helpers/application_helper.rb | |
index e9af70b..6f66db2 100644 | |
--- a/app/helpers/application_helper.rb | |
+++ b/app/helpers/application_helper.rb | |
@@ -63,7 +63,7 @@ module ApplicationHelper | |
def link_to_add_puppetclass klass, type | |
options = klass.name.size > 28 ? {:'data-original-title'=>klass.name, :rel=>'twipsy'} : {} | |
- content_tag(:span, truncate(klass.name, :length => 28), options).html_safe + | |
+ content_tag(:span, truncate(klass.name, :length => 28), options.merge(:'data-type' => type)).html_safe + |