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
$first_run = fqdn_rand(30) | |
$second_run = fqdn_rand(30) + 30 | |
cron { 'cron.puppet': | |
command => "/opt/puppet/bin/puppet agent -t > /dev/null", | |
user => "root", | |
minute => [ $first_run, $second_run ], | |
} | |
# make sure we haven't started the pe-puppet daemon ever |
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
// Imports | |
import org.openhab.core.library.types.* | |
import org.openhab.core.persistence.* | |
import org.openhab.model.script.actions.* | |
rule "Initialize all items" | |
when | |
System started | |
then |
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
# lib/puppet/parser/functions/pw_hash.rb | |
module Puppet::Parser::Functions | |
newfunction(:pw_hash, type: :rvalue) do |args| | |
raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2 | |
# SHA512 ($6), default number of rounds (5000) | |
# rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e. | |
# args[0].crypt("$6$rounds=50000$#{args[1]}") | |
args[0].crypt("$6$#{args[1]}") | |
end |
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
--- | |
# Set login timeout to 5 days | |
puppet_enterprise::profile::console::rbac_session_timeout: 7200 |
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
# GETTING STARTED | |
# 1. Install the Puppet agent from http://downloads.puppetlabs.com/windows/puppet-agent-1.3.6-x64.msi | |
# 2. puppet module install chocolatey-chocolatey | |
# 3. puppet module install cyberious-apm | |
# 4. puppet apply windows_dev_node.pp | |
include chocolatey | |
$choco_packages = [ | |
'git', |
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
# Enable gzip. Highly recommending for best peformance | |
gzip on; | |
gzip_comp_level 6; | |
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript; | |
# By default, do not set expire headers | |
expires 0; | |
# Set expires header for console CSS and JS. | |
# These files are timestamped with each new release, so it is safe to cache them agressively. |
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
[alias] | |
# See http://cat.pdx.edu/~hunner/git-lg.png for an example | |
lg = "log --decorate --pretty=format:'%C(yellow)%h%C(reset) %C(green)%G?%C(reset) %C(blue)%an%C(reset) %C(cyan)%cr%C(reset) %s %C(auto)%d%C(reset)' --graph --date-order" |
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
# This class is meant to solve the problem of synchronizing pe_repo agent | |
# packages to compile masters when there is no internet access. | |
# | |
# This profile assumes that the Puppet MoM (master of masters) is able to reach | |
# the internet to download the needed packages, or they've been sneaker-netted to the MoM. | |
# | |
class profile::app::puppet::master::pe_repo_packages { | |
# MoM gets some symlinks setup. | |
if $::servername == $facts['networking']['fqdn'] { |
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
class myclass::config { | |
# get the $config from the main class | |
# and assignto local scope variable | |
$config = $myclass::config | |
file { $config: | |
ensure => present, | |
} | |
} |
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
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |