Skip to content

Instantly share code, notes, and snippets.

@actionjack
actionjack / mcollective-plugins.spec
Created August 4, 2011 15:10 — forked from dcarley/mcollective-plugins.spec
RPM SPEC for bundling up some of the official mcollective plugins.
%define giturl git://github.com/puppetlabs/mcollective-plugins.git
%define gitrev d9305be
%define gituser puppetlabs
%define plugindir %{_libexecdir}/mcollective/mcollective
%define agents puppetd nettest service package filemgr nrpe puppetca puppetral
Name : mcollective-plugins
Version : 0.0.1
Release : 3.%{gitrev}
@actionjack
actionjack / gist:1245003
Created September 27, 2011 13:05 — forked from rantav/gist:626051
mvn snippet to create an rpm for tomcat war
<pluginManagement>
<plugins>
<!--
The RPM plugin is used to create distributable apps from our war file.
To use it fire:
$ mvn install rpm:rpm
...
The resulting rpm is then found at Project/target/rpm/Project/RPMS/noarch/Project-versoin-1.noarch.rpm
For example: ImageServer/target/rpm/ImageServer/RPMS/noarch/ImageServer-6.5.0-1.noarch.rpm
@actionjack
actionjack / gist:2973543
Created June 22, 2012 15:38
updating foreman host's environment with the rest api
command line used: (need to change username and password)
curl -k -u [USERNAME]:[PASSWORD] -X PUT -H "Content-Type:application/json" -H "Accept:application/json" -d '{"host":{"subnet_id":null,"serial":null,"puppetproxy_id":null,"name":"cittavld10.globoi.com","managed":null,"last_report":null,"comment":"","architecture_id":1,"created_at":"2011-10-10T17:46:30Z","sp_mac":"","puppetmaster_name":"puppet-lab.dev.globoi.com","image_file":null,"updated_at":"2012-02-29T14:41:29Z","sp_name":"","mac":"00:16:3e:16:69:b8","installed_at":null,"domain_id":2,"use_image":null,"root_pass":"xybxa6JUkz63w","owner_id":2,"medium_id":null,"id":896,"hostgroup_id":null,"enabled":true,"build":false,"ptable_id":null,"sp_subnet_id":null,"puppet_status":0,"last_freshcheck":null,"ip":"127.0.01","environment_id":2,"source_file_id":null,"model_id":1,"environment":{"environment":{"name":"lab2","id":2}},"sp_ip":"","disk":null,"owner_type":"User","operatingsystem_id":5,"last_compile":"2011-08-21T04:02:27Z"}}' http://localhost:3000/hosts/citta
@actionjack
actionjack / logstash RPM spec
Created August 31, 2012 13:38 — forked from slojo404/logstash RPM spec
logstash monolithic init script and spec file for CentOS / RedHat
Name: logstash
Version: 1.1.0
Release: 1%{?dist}
Summary: logstash is a tool for managing events and logs
Group: System/Logging
License: ASL 2.0
URL: http://logstash.net/
Source0: http://semicomplete.com/files/logstash/logstash-%{version}-monolithic.jar
Source1: logstash
@actionjack
actionjack / tomcat.sh
Created September 20, 2012 14:06 — forked from valotas/tomcat.sh
Tomcat init.d script
#!/bin/bash
#
# tomcat7 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@actionjack
actionjack / gist:4059791
Created November 12, 2012 14:44 — forked from faxm0dem/gist:4059786
collectd unquote filter
<Chain PreCache>
<Rule unquote>
<Match regex>
Plugin "^GenericJMX$"
</Match>
<Target replace>
PluginInstance "\"" ""
</Target>
</Rule>
</Chain>
require 'rubygems'
require 'fog'
require 'yaml'
config = YAML::load_file(File.dirname(__FILE__) + '/config.yml')
cf = Fog::AWS::CloudFormation.new(
:aws_access_key_id => config['key'],
:aws_secret_access_key => config['secret']
)

A Continuous Packaging Pipeline

A list of tools mentioned in my Ignite talk from Devopsdays Rome 2012 on a continuous packaging pipeline, with links and short description for each tool.

The talk slides are at https://speakerdeck.com/mpasternacki/a-continuous-packaging-pipeline; a longer blog post will be written soon.

Vendorificator

Available at https://github.com/3ofcoins/vendorificator/ or with gem install vendorificator

Include third party modules in your git repo, using pristine branches to sanely maintain local changes, upgrades, and merges.

#!/bin/bash
#
# This is the script responsible for updating our Puppet master data,
# which includes modules, manifests, hiera data, etc. All of this data is
# managed in a git repository and upon "deploy" it is synced into the Puppet
# master.
#
# This script mirrors the remote git repository, looking for branches that
# match "env-*" (such as "env-production" or "env-test"). Each of these branches
# is setup as an environment into the Puppet master's data files. The
databases => {
'default' =>
{
'ENGINE' => 'postgresql_psycopg2',
'NAME' => 'defaultdb',
'HOST' => '2.2.2.2.2',
'USER' => 'username',
'PASSWORD' => 'secretinfo',
'OPTIONS' =>
{