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 is terrible practice. Instead, you should set up a repo locally and build packages | |
# to drop in there. RPM and deb files are approaching trivial to make unless you need to | |
# customize them heavily. | |
exec { 'build nginx': # just a name | |
command => "tar -xvzf $file; cd $dir; make; make install", # build & install the package | |
onlyif => "wget $url", # but only if the download succeeds | |
creates => '/path/to/installed/nginx', # and only if the installed file doesn't already exist | |
cwd => '/tmp', | |
path => '/usr/bin:/bin:...', |
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
$pkg = $osfamily ? { | |
'redhat' => 'gcc', | |
'debian' => [ 'gcc', 'build-essential' ], | |
} | |
package { $pkg: | |
ensure => present, | |
} |
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 'yaml' | |
data = { | |
'somekey' => 'a value', | |
'another key' => [ 'an', 'array', 'of', 'values' ], | |
'a final key' => 'last value', | |
} |
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
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $ | |
# This is the sshd server system-wide configuration file. See | |
# sshd_config(5) for more information. | |
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin | |
# The strategy used for options in the default sshd_config shipped with | |
# OpenSSH is to specify options with their default value where | |
# possible, but leave them commented. Uncommented options change a |
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 | |
# | |
# This script will be executed *after* all the other init scripts. | |
# You can put your own initialization stuff in here if you don't | |
# want to do the full Sys V style init stuff. | |
touch /var/lock/subsys/local | |
if [ ! -d /root/.ssh ] ; then | |
mkdir -p /root/.ssh | |
chmod 0700 /root/.ssh |
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 apache { | |
#### update this section ##### | |
case $::osfamily { | |
'RedHat': { | |
$httpd_user = 'apache' | |
$httpd_group = 'apache' | |
$httpd_pkg = 'httpd' | |
$httpd_svc = 'httpd' | |
$httpd_conf = 'httpd.conf' | |
$httpd_confdir = '/etc/httpd/conf' |
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
path /certificate_status | |
method find, search, save, destroy | |
auth yes | |
allow pe-internal-dashboard,provisioner.mydomain.com |
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 booga::booga ( | |
$setting, | |
$another = 'baz', | |
) { | |
# use the variables passed in. $name is a magic variable that comes from the title of the declared resource | |
exec { "/path/to/some/script --enable ${setting} --with-${another} ${name}": } | |
} | |
# declare three copies, identical except for title/name | |
booga::booga { ['one', 'two', 'three']: |
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
# /etc/mcollective/policies/service.policy | |
# The file is active, because if I change this to allow, then actions are allowed | |
policy default deny | |
# but this line doesn't work. These are hard tabs. | |
allow * restart * | |
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
when_invoked do |path, options| | |
require 'puppet/network/http_pool' | |
connection = Puppet::Network::HttpPool.http_instance(Puppet[:server], Puppet[:masterport]) | |
connection.request_get(path, {"Accept" => options[:accept]}).body | |
end |