Skip to content

Instantly share code, notes, and snippets.

@kylog
kylog / gist:2888fefb4d87bcaf38e3
Created February 18, 2016 00:49
strict_environment_mode logic
if !strict_environment_mode
# do like today
else
if environment was not specified and use_cached_catalog == false
# do like today
elif environment was specified and use_cached_catalog == true
if environment != catalog.environment
raise
end
else # we have only one source of environment, woot
Error: Failed to compile catalog for node ql984m0t73uexu7.delivery.puppetlabs.net: Attempt to assign to a reserved variable name: 'trusted' on node ql984m0t73uexu7.delivery.puppetlabs.net
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:619:in `setvar'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:713:in `[]='
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:787:in `block in set_node_parameters'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:786:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:786:in `set_node_parameters'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:172:in `block (2 levels) in compile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:172:in `block in comp
@kylog
kylog / gist:8996caf68a863e718ccd
Created October 4, 2015 23:11
rakefile that produces failure
require 'puppet'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
[31] puppet-agent git:(stable) ✗ git diff
diff --git a/Gemfile b/Gemfile
index c86961a..fbaafb7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,8 +5,8 @@ def vanagon_location_for(place)
[{ :git => $1, :branch => $2, :require => false }]
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
- elsif place =~ /(\d+\.\d+\.\d+)/
@kylog
kylog / gist:bf859fc5537e41443c0f
Last active August 29, 2015 14:26
cthun renaming
# Take 42, assuming:
# * puppet-connector is the name of the thing
# * switchboard is the thing's service
# * we're still blocked on some decisioning for some items but not others
# We could possibly agree today on this stuff:
cthun -> puppet-connector-switchboard-service
cthun-specifications -> puppet-connector-specifications
cthun-images -> puppet-connector-images # no customer facing artifacts
cthun-test -> puppet-connector-test # no customer facing artifacts
[root@vagrant-freebsd-10 /usr/home/vagrant/facter/release]# bin/facter
facterversion => 3.0.2
filesystems => devfs,zfs
identity => {
gid => 0,
group => "wheel",
uid => 0,
user => "root"
}
kernel => FreeBSD
[11:54:52] <prometheanfire> should the puppetdb-termini line be puppetdb-terminus in http://docs.puppetlabs.com/puppetdb/latest/connect_puppet_master.html ?
[11:55:41] <prometheanfire> need to know for packaging puppetdb and puppet-server (unliess db access is built into puppet-server)
[11:55:46] Mode is +cnt
[11:57:04] <prometheanfire> also, are there instructions for connecting puppet-db to puppet-server? the link provided doesn't show
[11:58:53] <daenney> So those are usage questions and should be directed to #puppet, not #puppet-dev
[11:59:14] <prometheanfire> the first question is not
[11:59:19] <prometheanfire> I think it's a doc problem
[11:59:27] <daenney> That's still a usage question
[11:59:34] <daenney> And it's not, the package has been renamed
[11:59:37] <prometheanfire> I can find no refrence to puppetdb-termini as a package
@kylog
kylog / gist:8c2a4ae9eb12db4a756d
Created June 17, 2015 22:20
puppet 3.8.2 ... maybe
[22] puppet git:(master) git log 3.8.1..origin/3.x --pretty=oneline --no-merges
5e7fb72e4ea6ae801a70d7aff582dc9ba4fdfdff (PUP-3088) Make spec test provider agnostic
f4b50eea8d51f8570a65b0aebf3420acd5726314 (PUP-3088) Fix provider logging calls
2ae5598ad8993e3e8775271d152e3606682ea4e6 (PUP-4753) Add test of call_function
6058f95cb9ee791d873ebd2224dc087f798831b1 (PUP-4753) Fix faulty code - operating on wrong object
60193391ba3916a8e8a44303c6e8518261f0519e (PUP-4753) Fix typo in comment
e738bda05b9dd870a7bc118e850dc56f0c32236f (PUP-4753) Add ability to call 3.x and 4.x function from scope
1173b42101da8a49f0fad1f2388ee22145805006 (RE-4831) Update RubyGems and to OpenSSL 1.0.0.s
06981e586476ab28ed5f1c8551d3e206d394d47b (PUP-4747) Format resource_type arguments as source code
445974415d74b1f8bec534c292fdee9d50f49edf (PUP-4703) Optimize copy_as_resource checks for future parser
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb
index 8762429..ccf890c 100644
--- a/lib/puppet/node/environment.rb
+++ b/lib/puppet/node/environment.rb
@@ -376,6 +376,7 @@ class Puppet::Node::Environment
def modules_by_path
modules_by_path = {}
modulepath.each do |path|
+ if File.exists?(path)
Dir.chdir(path) do
[12] pe-puppet git:(3.8.x) git log 3.8.x..3.8.1 --no-merges --pretty=oneline
f7f1ece3427b1d30643da8ff38cc4a30afe3a095 (PUP-4636) Fix problem with environment.conf parser=future
cddfcc504f3ab7b3259b2f650303c0e3e5836f99 (PUP-4573) Raise the version to Puppet 3.8.1
8fe9cad8cf3f7ddc7cc5a6b4c0a30b86e7f3da63 (maint) Eliminate one-shot use of a const that generated warnings
9491efce2959e944c5ef8714dbddc8a56f32a7fc (maint) Make use of Beaker's epel_url option
bc90726cf9e30ac5d0b4017d44519ac2cfba26fe (PUP-3829) : call 'pip' instead of 'pip-python' on RedHat > 6 in the pip package provider
9305e30d213026e27c3f45e16319ad27cbf385a5 (maint) Fix for PUP-4483.
ad9f2ce07bb6bca67f95b2f0d1e66f7908868408 (PUP-4552) Use TypeCalculator.infer_set for type validation errors
6482836109e80c4ad246a314128fbc7b5f964b3f (PUP-4551) Do not generalize struct key types
99766313d3469c3cf76ce2edb3b36be71a0f199a (PUP-4524) Stub command execution in base service provider spec.