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 'puppet' | |
Puppet.initialize_settings | |
def encrypt(data, destination) | |
certpath = Puppet.settings[:cacert] | |
keypath = Puppet.settings[:cakey] | |
destpath = "#{Puppet.settings[:signeddir]}/#{destination}.pem" | |
cert = OpenSSL::X509::Certificate.new(File.read(certpath)) |
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
11:01 $ rangefinder ~/Projects/puppet-remote_file/lib/puppet/type/remote_file.rb | |
[remote_file] is a _type_ | |
================================== | |
Breaking changes to this file MAY impact these modules: | |
* papertrail-papertrail (https://github.com/papertrail/puppet-papertrail) | |
* opstree-snoopy (https://github.com/OpsTree/opstree-snoopy.git) | |
* pcfens-topbeat (https://github.com/pcfens/puppet-topbeat) | |
* poolski-packetbeat (https://github.com/poolski/puppet-packetbeat) | |
* pcfens-ca_cert (https://github.com/pcfens/puppet-ca_cert) | |
* dodevops-githubreleases (https://github.com/dodevops/puppet-githubreleases) |
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
12:29 $ ./label_provider.rb | |
Object (label provider is incomplete for Puppet::Pops::Model::Factory) | |
12:29 $ |
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
notify { ['hello', 'there', 'trailing', 'comma', ]: } |
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 nginx::conf ( | |
Optional[String] $source = undef, | |
Enum[ | |
'reload','restart', | |
'configtest','upgrade', | |
] $service_action = 'upgrade', | |
) { | |
} |
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 cfg_kvm_libvirt::install { | |
package { 'libvirt': | |
ensure => latest, | |
} | |
user { 'virtmgr': | |
ensure => 'present', | |
comment => 'virt user', | |
forcelocal => true, | |
home => '/home/virtmgr', |
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 | |
require 'json' | |
ENV['facter_cache'] ||= `/opt/puppetlabs/bin/facter --show-legacy --no-external-facts --json` | |
cache = JSON.parse(ENV['facter_cache']) rescue {} | |
value = ARGV.first.split('.').reduce(cache) do |collector, key| | |
break unless collector.keys.include? key | |
collector[key] | |
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
class first { | |
notify { 'first': } | |
} | |
class outside { | |
include floater # this class is uncontained, so it will "float" outside the graph | |
} | |
class floater { | |
notify { 'floater': } |
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 apply parse_order.pp | |
Notice: Compiled catalog for ganymede.corp.puppetlabs.net in environment production in 0.16 seconds | |
Notice: foo | |
Notice: /Stage[main]/Foo/Notify[foo]/message: defined 'message' as 'foo' | |
Notice: after the include | |
Notice: /Stage[main]/Main/Notify[after the include]/message: defined 'message' as 'after the include' | |
Notice: Applied catalog in 0.05 seconds |
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
[root@ip-172-31-20-152 modules]# cat foo/manifests/params.pp | |
class foo::params { | |
$bar = 'baz' | |
} | |
[root@ip-172-31-20-152 modules]# cat foo/manifests/something.pp | |
class foo::something { | |
# this does NOT resolve up to $foo::bar because it has no parent class | |
notify { $bar: } | |
} |