This file contains 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
/*** BEGIN META { | |
"name": "List GIT Branches", | |
"comment": "You can use this to fill up a dynamic list parameter with branches. Optionally, you can filter the branches to show.", | |
"parameters": [ 'FILTER', 'REMOTE' ], | |
"core": "1.580", | |
"authors": [ | |
{ name : "Jan Vansteenkiste" } | |
] | |
} END META**/ |
This file contains 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/bash | |
# requirements: | |
# - curl | |
# - nokogiri | |
# usage: fill in username and password here, execute, and it spits out json array with your usage | |
username=<< Fill your username in here >> | |
password=<< Fill your password in here >> |
This file contains 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
# frozen_string_literal: true | |
# File goes into lib/puppet/functions/ of some module | |
# You can use this function to dynamically calculate memory use for a certain process. | |
# The java JVM for example. | |
# | |
# Its possible to calculate memory based upon fixed numbers (would like 512M but with a minimum of 256M) or | |
# with percentages (give me half but with a minimum of 256M). | |
# |
This file contains 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/bash -e | |
errr() { | |
echo "$@" 1>&2 | |
exit 1; | |
} | |
( | |
cd linux/ |
This file contains 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
## Config created by foreman-database.yml.erb | |
production: | |
adapter: mysql2 | |
name: puppet_test | |
password: password | |
server: localhost | |
user: puppet | |
This file contains 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
Original header used now: | |
### File managed with puppet ### | |
## Served by: '<%= scope.lookupvar('::servername') %>' | |
## Module: '<%= scope.to_hash['module_name'] %>' | |
## Template source: 'MODULES<%= template_source.gsub(Regexp.new("^#{Puppet::Node::Environment.current[:modulepath].gsub(':','|')}"),"") %>' | |
Problem: When using puppet apply with relative modulepath, the information can be wrong or messy. | |
Alternative 1: |
This file contains 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 apply --modulepath=. -e 'include test' | |
Warning: ModuleLoader: module 'test' has unresolved dependencies - it will only see those that are resolved. Use 'puppet module list --tree' to see information about modules | |
(file & line not available) | |
Error: Evaluation Error: Error while evaluating a Function Call, can't modify frozen String at /home/jan/tmp/test/manifests/init.pp:4:16 on node minimoose.home.vstone.be |
This file contains 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(:calculate_memory_use, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| | |
calculate_memory_use(use, reserved, minimum=0) | |
[*use*] How much memory should I use (of the non-reserved space left) | |
* Floating numbers smaller than 1 are interpreted as percentage. | |
* Anything else is used as size. |
This file contains 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 'yaml' | |
module RSpecHelper | |
module SystemFacter | |
def self.resolve_fact (fact, stubs = {}, facter_path = (ENV['FACTER_PATH'] || '/usr/bin/facter')) | |
env_values = {} | |
command = [ facter_path, '--yaml'] | |
facts_path = File.expand_path(File.dirname(__FILE__) + '/../../lib/facter') |
NewerOlder