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
## Based on tknetwork's bacula cookbook | |
filedaemon_nodes = search(:node, "roles:bacula_filedaemon") | |
filedaemon_nodes.each do |n| | |
bacula_client "#{n.hostname}-fd" do | |
extend Chef::Bacula | |
address getClientName(n.fqdn) | |
end | |
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
loop(){ | |
function1(arg1, arg2); | |
function2(arg3) | |
} |
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
global_variables = data_bag_item("backupservers", "_global") | |
if global_variables['primary'].length > 1 then | |
default[:backups][:primary] = global_variables['primary'][1] | |
else | |
default[:backups][:primary] = global_variables['primary'][0] | |
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
define host{ | |
use generic-host | |
contact_groups admins | |
host_name localhost | |
address localhost | |
icon_set server | |
} |
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
############################################################################### | |
############################################################################### | |
# | |
# HOST TEMPLATES | |
# | |
############################################################################### | |
############################################################################### | |
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
# Here are some sample commands for checking classics things like | |
# systems and websites | |
# ----------------------------------------------------------------- | |
# | |
# Localhost checks | |
# | |
# ----------------------------------------------------------------- | |
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
# Log file of the discovery command | |
log_file=/tmp/discovery.log | |
# Configuration files with common discovery objects | |
# like discoveryrules or runners | |
cfg_dir=packs | |
# Default discovery rules and runners. Should be AFTER | |
# the packs ones ;) |
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
Name Pattern View | |
---- ------- ---- | |
home / <function home at 0x419a8c0> | |
__static/ /static/*subpath <function <pyramid.static.static_view object at 0x411e5d0> at 0x4194b18> | |
location_index /location <function location_index at 0x419ab90> | |
location_new /location/new <function location_new at 0x419acf8> | |
location_create /location/create <function location_create at 0x419aa28> | |
location_show /location/{id} <function location_show at 0x419ae60> | |
timingload_index /timingload <function timingload_index at 0x419d758> | |
timingload_new /timingload/new <function timingload_new at 0x419d8c0> |
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
@msg = @connection.receive | |
message_body = JSON.parse(@msg.body)[0]['body'] | |
#Resque.enqueue(NrodLookup,message_body) | |
current_sql_statement = "SELECT nlcdesc FROM tiplocdata WHERE stanox = '#{message_body['reporting_stanox']}'" | |
next_sql_statement = "SELECT nlcdesc FROM tiplocdata WHERE stanox = '#{message_body['next_report_stanox']}'" | |
# puts sql_statement | |
@client.query(current_sql_statement).each do | row | | |
@current_loc = row['nlcdesc'] | |
end | |
@client.query(next_sql_statement).each do | row | |
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
ud = "#cloud-config\nfqdn: " + server_fqdn + "\nhostname: " + hostname + "\nmanage_etc_hosts: true" | |
# get the image | |
image_details = self.get_image(image,region) | |
new_server = self.cx[region].servers.create(hostname,flavor=flavor,image=image_details,key_name=key_name,userdata=ud) |