Skip to content

Instantly share code, notes, and snippets.

class roles::role_phantomjs inherits roles::role_procserver {
Class['::phantomjs'] {
manage_service => true
}
}
class hubspot::roles::jenkins::slave {
vcsrepo { 'heroku-buildpack-play':
ensure => latest,
provider => git,
source => $repos[heroku-buildpack-play][repo],
revision => $repos[heroku-buildpack-play][ref],
path => "${repos_dir}/${title}",
}
require 'facter'
require 'json'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("aws ec2 describe-tags --region #{region} --filters \"Name=resource-id,Values=#{instance_id}\" --query 'Tags[*].{value:Value,key:Key}'")
parsed_tags = JSON.parse(tags)
parsed_tags.each do |tag|
/etc/puppet/csr_attributes.yaml:
---
extension_requests:
pp_preshared_key: PUPPET_PSK
Puppet output:
Info: Creating a new SSL key for puppet.hubspot.local
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
@tmclaugh
tmclaugh / gist:cc7488749dd78156824f
Last active August 29, 2015 14:09
Packer - Post-processors
"post-processors":
[
{
"type" : "vagrant",
"output" : "centos65.box"
}
]
@tmclaugh
tmclaugh / gist:81f7bca4273f304829fd
Last active August 29, 2015 14:09
Packer - Provisioners
"provisioners":
[
{
"type" : "shell",
"environment_vars" :
[
"os_name=CentOS",
"os_version=6.5"
],
@tmclaugh
tmclaugh / gist:9f605008f76f872d2ed3
Last active August 29, 2015 14:09
Packer - Builders
"builders":
[
{
"type" : "virtualbox-iso",
"boot_command":
[
"<esc>",
" linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks/centos65.ks",
"<enter>",
[root@c6 ~]# fdisk -lu mnt/images/aws-paravirt/CentOS-6.5-x86_64-1410576856-paravirt.img
You must set cylinders.
You can do this from the extra functions menu.
Disk mnt/images/aws-paravirt/CentOS-6.5-x86_64-1410576856-paravirt.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002d42f
Vagrant.configure('2') do |config|
config.vm.define "nginx-lb", primary: true do |nginx|
nginx.vm.hostname = 'lb.hubspot.local'
nginx.vm.provision :puppet_server, id: 'default_puppet_server' do |p|
p.puppet_server = "puppetmaster.hubspot.local"
p.options = "--verbose --waitforcert 120"
p.facter = { 'role' => 'hubspot::roles::puppet::role_puppetmaster',
'hs_lb_type' => $hs_lb_type,
'hs_server_names' => $hs_server_names
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
$vg_role = ENV['VG_ROLE'] || "hubspot::roles::role_basenode"
$vg_profile = ENV['VG_PROFILE'] || ''
$inst_home = ENV['VG_INST_HOME'] || File.dirname(__FILE__)
$inst_name = ENV['VG_INST_NAME'] || $inst_home.split(File::SEPARATOR)[-1]
$vm_box = ENV['VG_VM_BOX'] || "CentOS-6.5-x86_64-201407100058"
$hostname = ENV['VG_HOSTNAME'] || "%s.hubspot.local" % $inst_name