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 openssh { | |
| # The openssh::params class dynamically sets variables for things like the | |
| # service name and package name, dependent on platform-specific | |
| # considerations. | |
| include openssh::params | |
| package { 'openssh-server': | |
| ensure => installed, | |
| name => $openssh::params::package, |
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 app ( | |
| $ensure = running, | |
| ) { | |
| file { '/tmp/example.txt': | |
| ensure => present, | |
| content => "valuable words\n", | |
| mode => '0644', | |
| } |
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 | |
| forge "http://forge.puppetlabs.com" | |
| mod "apt", | |
| :git => "https://github.com/reidmv/puppetlabs-apt", | |
| :ref => "0a753ae6962fb139fd0f1d374e739b1b5a504b5a" | |
| mod "jenkins", | |
| :git => "git://github.com/jenkinsci/puppet-jenkins.git", |
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
| $value = '2' | |
| if $value == '1' { | |
| $conditional_require = 'example1' | |
| } elsif $value == '3' { | |
| $conditional_require = 'example3' | |
| } else { | |
| $conditional_require = [] | |
| } |
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/indirector/facts/puppetdb' | |
| require 'puppet/node/facts' | |
| require 'hiera' | |
| class Puppet::Node::Facts::PuppetdbWithNetwork < Puppet::Node::Facts::Puppetdb | |
| # Here we override the normal save, injecting a custom fact | |
| def save(args) | |
| name = args.instance.name | |
| facts = args.instance.values | |
| facts.define_singleton_method(:lookupvar) do |key| |
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 | |
| # Assumptions: the new master system is called "remotehost.tld" | |
| rsync -PHa --files-from - /etc/puppetlabs/ remotehost.tld:/etc/puppetlabs/ <<EOF | |
| puppet/ssl/certs/pe-internal-broker.pem | |
| puppet/ssl/certs/pe-internal-mcollective-servers.pem | |
| puppet/ssl/certs/pe-internal-peadmin-mcollective-client.pem | |
| puppet/ssl/certs/pe-internal-puppet-console-mcollective-client.pem | |
| puppet/ssl/private_keys/pe-internal-broker.pem |
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
| metadata :name => "Yum", | |
| :description => "Agent to manage packages using yum", | |
| :author => "Reid Vandewiele", | |
| :license => "Apache 2.0", | |
| :version => "1.0", | |
| :timeout => 60 | |
| action "checkupdate", :description => "Checks for available yum updates" do | |
| display :always |
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
| vagrant_suppress_expected_warnings() | |
| { | |
| if [ "$1" = "sandbox" ]; then | |
| { \vagrant "$@" 2>&1 >&3 | egrep -v \ | |
| -e 'Check your GSSAPI C librar' \ | |
| -e 'WARNING: Nokogiri was built against LibXML' \ | |
| >&2 | |
| } 3>&1 | { egrep -v \ | |
| -e 'Invalid machine state: PoweredOff' \ | |
| -e 'code VBOX_E_INVALID_VM_STATE (0x80bb0002),' \ |
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 Hiera | |
| module Backend | |
| class File_backend | |
| def initialize | |
| Hiera.debug("Hiera File backend starting") | |
| end | |
| def lookup(key, scope, order_override, resolution_type) | |
| answer = nil |
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
| # This custom fact pulls out all local users from the /etc/passwd file | |
| # and returns the collection as a comma-separated list. | |
| Facter.add(:local_users) do | |
| setcode do | |
| users = Array.new | |
| File.open("/etc/passwd").each do |line| | |
| next if line.match(/^\s|^#|^$/) | |
| users << line.split(':').first | |
| end |