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 | |
# Pin Ubuntu to use Puppet 2.7.* rather than Puppet 3. | |
# Assumes you're using the Puppet APT repo at apt.puppetlabs.com. | |
# Thanks to haus for the technique. | |
cat > /etc/apt/preferences.d/00-puppet.pref <<EOF | |
Package: puppet puppet-common puppetmaster puppetmaster-common | |
Pin: version 2.7* | |
Pin-Priority: 501 | |
EOF | |
echo Release pinned. |
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
$ curl -vH "Accept: application/json" 'http://localhost:8080/resources' --data-urlencode 'query=["not", ["=", "type", "Nonsense"]]' | |
* About to connect() to localhost port 8080 (#0) | |
* Trying ::1... Connection refused | |
* Trying 127.0.0.1... connected | |
* Connected to localhost (127.0.0.1) port 8080 (#0) | |
> POST /resources HTTP/1.1 | |
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 | |
> Host: localhost:8080 | |
> Accept: application/json | |
> Content-Length: 78 |
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
@echo on | |
setlocal | |
set DAYS=31 | |
set DOWNLOADS=C:\WINDOWS\SoftwareDistribution\Download | |
rem http://bit.ly/IttCwo | |
rem http://stackoverflow.com/a/51069/5700 | |
net stop wuauserv | |
forfiles /p %DOWNLOADS% /s /d -%DAYS% /c "cmd /c if @isdir==FALSE (del @file) else (rd /s /q @file)" | |
net start wuauserv |
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
var http = require('http'), | |
util = require('util'), | |
MemoryStream = require('memorystream'), | |
argv = require('optimist') | |
.usage('Usage: $0 [-a addr] [-p port]') | |
.options('a', { alias: 'addr', default: '0.0.0.0' }) | |
.options('p', { alias: 'port', default: 1337 }) | |
.options('h', { alias: 'help' }) | |
.check(function(args) { if (args.h !== undefined) { throw ""; }}) | |
.argv; |
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@lsserver:/tmp/vagrant-puppet/manifests# puppet --version | |
2.7.19 | |
root@lsserver:/tmp/vagrant-puppet/manifests# which puppet | |
/usr/bin/puppet | |
root@lsserver:/tmp/vagrant-puppet/manifests# `which puppet` --version | |
3.0.2 | |
root@lsserver:/tmp/vagrant-puppet/manifests# echo $PATH | |
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/vagrant_ruby/bin:/opt/vagrant_ruby/bin | |
root@lsserver:/tmp/vagrant-puppet/manifests# alias | |
alias egrep='egrep --color=auto' |
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 | |
### BEGIN INIT INFO | |
# Provides: dashboard-workers | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: dashboard workers | |
# Description: Start dashboard-workers daemon placed in /etc/init.d. | |
### END INIT INFO |
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
MANIFESTS = [ | |
'vagrant-prereq.pp', # prerequisites, e.g. other Puppet modules | |
'vagrant.pp' # the Logstash configuration we're testing | |
] | |
# Run the Puppet provisioner for each manifest | |
for manifest in MANIFESTS | |
ls.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "tests" | |
puppet.manifest_file = manifest |
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
diff --git a/manifests/params.pp b/manifests/params.pp | |
index 3278a7a..06b2db5 100644 | |
--- a/manifests/params.pp | |
+++ b/manifests/params.pp | |
@@ -89,27 +89,4 @@ class logstash::params { | |
for \"${::operatingsystem}\"") | |
} | |
} | |
- | |
- # parameters when using a custom jar sourcea |
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 elastic_template($host='localhost', $port='9200', $prefix='', $require=undef) { | |
$es_templ = "${name}-template.json" | |
file { "/tmp/${es_templ}": | |
ensure => present, | |
source => "puppet:///modules/${module_name}/${prefix}${es_templ}", | |
require => $require, | |
} | |
$es_locn = "http://${host}:${port}/_template/${name}" | |
exec { "curl -s -XPUT ${es_locn} -d @/tmp/${es_templ}": |