Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| filter { | |
| if [type] == "elasticsearch" { | |
| grok { | |
| match => [ "message", "\[%{TIMESTAMP_ISO8601:timestamp}\]\[%{DATA:severity}%{SPACE}\]\[%{DATA:source}%{SPACE}\]%{SPACE}(?<message>(.|\r|\n)*)" ] | |
| overwrite => [ "message" ] | |
| } | |
| if "_grokparsefailure" not in [tags] { | |
| grok { # regular logs | |
| match => [ |
| #!/bin/sh | |
| # setup ~/.pgpass to allow passwordless connection to postgres | |
| # keep last 30 executions for each job | |
| KEEP=30 | |
| cd /var/lib/rundeck/logs/rundeck | |
| JOBS=`find . -maxdepth 3 -path "*/job/*" -type d` |
| #!/bin/bash | |
| # keep last 30 executions for each job | |
| set -e | |
| KEEP=60 | |
| MYSQLHOST=mysql | |
| MYSQLUSER=rundeck | |
| MYSQLPASSWORD=password | |
| MYSQLDB=rundeck |
| #!/bin/bash | |
| # | |
| # consul Manage the consul agent | |
| # | |
| # chkconfig: 2345 95 95 | |
| # description: Consul is a tool for service discovery and configuration | |
| # processname: consul | |
| # config: /etc/consul.conf | |
| # pidfile: /var/run/consul.pid |
| #!/usr/bin/env python | |
| from collections import deque | |
| import Queue | |
| import csv | |
| import datetime | |
| import os | |
| import re | |
| import subprocess | |
| import multiprocessing as mp |
| """ | |
| Settings for root logger. | |
| Log messages will be printed to console and also to log file (rotated, with | |
| specified size). All log messages from used libraries will be also handled. | |
| Three approaches for defining logging settings are used: | |
| 1. using logging classes directly (py25+, py30+) | |
| 2. using fileConfig (py26+, py30+) | |
| 3. using dictConfig (py27+, py32+) | |
| Choose any variant as you like, but keep in mind python versions, that |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| # sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| # sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| augeas { "ntp.conf": | |
| context => "/files/etc/ntp.conf", | |
| changes => [ | |
| "rm server[.]", | |
| "set server timehost.tconet.net", | |
| "clear server[. = 'timehost.tconet.net']/iburst", | |
| "set server[. = 'timehost.tconet.net']/maxpoll 9", | |
| "clear server[. = 'timehost.tconet.net']/prefer", | |
| ], | |
| require => Package["ntp"], |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000