Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav J. Shah initcron

View GitHub Profile
@initcron
initcron / hiera-json.yaml
Created December 5, 2014 08:21
hiera.yaml with json data store
---
:backends:
- json
- yaml
:json:
:datadir: /etc/puppet/jsondata
:yaml:
:datadir: /etc/puppet/hieradata
:hierarchy:
- "%{clientcert}"
@initcron
initcron / agent.example.com.json
Created December 5, 2014 08:25
hiera json data
{
"ntp::autoupdate" : true,
"ntp::enable" : true,
"ntp::restrict": [
"-7 ::1"
],
"ntp::servers" : [
"jsondemo.example.com iburst",
@initcron
initcron / git_installed.bats
Created February 11, 2015 16:34
TDD 02 test/integration/default/bats/git_installed.bats
#!/usr/bin/env bats
@test "git binary is found in PATH" {
run which git
[ "$status" -eq 0 ]
}
@initcron
initcron / kitchen.yml
Created February 11, 2015 16:37
kitchen.yml after adding new suite
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
- name: centos-6.4
@initcron
initcron / git_daemon_spec.rb
Created February 11, 2015 16:42
test/integration/server/serverspec/git_daemon_spec.rb
require 'serverspec'
# Required by serverspec
set :backend, :exec
describe "Git Daemon" do
it "is listening on port 9418" do
expect(port(9418)).to be_listening
end
@initcron
initcron / server.rb
Created February 11, 2015 16:46
server.rb recipe for git
include_recipe "git"
include_recipe "runit"
package "git-daemon-run"
runit_service "git-daemon" do
sv_templates false
end
@initcron
initcron / r10k
Created March 29, 2015 03:08
r10k puppet
gem install r10k --no-ri --no-rdoc
@initcron
initcron / knife-ec2
Last active August 29, 2015 14:18
knife-ec2
sudo yum install patch libxml2-devel libxslt
sudo /opt/chef/embedded/bin/gem install knife-ec2 --no-ri --no-rdoc
# Add the following to knife.rb
# region: oregon
knife[:aws_access_key_id] = "Your AWS Access Key ID"
knife[:aws_secret_access_key] = "Your AWS Secret Access Key"
knife[:region] = "us-west-2"
#validate
@initcron
initcron / vhost.pp
Created May 12, 2015 08:30
nginx::vhost defined type
define nginx::vhost (
$port = 80,
$site_domain
){
include nginx
file { "/etc/nginx/conf.d/${name}.conf":
content => template('nginx/vhost.conf.erb'),
notify => Service['nginx'],
@initcron
initcron / vhost.conf.erb
Created May 12, 2015 08:33
vhost.conf.erb
server {
listen <%= @port %>;
root /var/www/<%= @name %>;
server_name <%= @site_domain %>;
}