Skip to content

Instantly share code, notes, and snippets.

@jaybrueder
jaybrueder / gist:8b25fbcd6d69f8d8ccda4b91c1be957f
Created February 28, 2024 08:43
TFE Provider - variable distribution
variable "workspaces" {
type = set(string)
}
variable "common_environment_variables" {
type = map(string)
}
provider "tfe" {
hostname = "app.terraform.io" # Terraform Cloud
@jaybrueder
jaybrueder / loadbalancer.yml
Created February 23, 2022 09:05
Ansible HAProxy Playbook
---
- hosts: webservers
become_user: root
become: yes
tasks:
- name: gather facts from web servers
amazon.aws.ec2_metadata_facts:
- hosts: loadbalancers
become_user: root
source 'https://rubygems.org/'
gem 'sinatra', '2.1.0'
gem 'sinatra-activerecord', '2.0.21'
gem 'sqlite3', '1.4.1'
gem 'capybara', '3.34.0'
gem 'cucumber', '5.2.0'
gem 'rake', '12.3.3'
gem 'rspec-expectations', '3.10.0'
version: 2
jobs:
build:
docker:
- image: docker:18.06.1-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Build application Docker image
it 'correctly captures output' do
allow(plugin).to receive(:shell_out).with('apachectl -t -D DUMP_MODULES').and_return(double(stdout: 'OUTPUT'))
expect(plugin_attribute('apache/modules')).to eq('OUTPUT')
end
@jaybrueder
jaybrueder / gist:d88e327e9721a5108616ccb76d36ca9b
Created January 31, 2018 12:57
Install ChefDK on Cloud9
sudo rpm -Uvh https://packages.chef.io/files/stable/chefdk/2.0.28/el/7/chefdk-2.0.28-1.el7.x86_64.rpm
#!/bin/sh
# prevent adding of unencrypted files
if test $(git-crypt status | grep "WARNING" | wc -l) != 0
then
echo "WARNING: There are unencrypted files in your staging area. Commit aborted!"
exit 1;
fi
$ sudo apt-get install git-all libssl-dev
$ cd /tmp && wget https://github.com/AGWA/git-crypt/archive/0.5.0.zip
$ unzip 0.5.0.zip && cd git-crypt-0.5.0/
$ make && sudo make install
@jaybrueder
jaybrueder / Gemfile
Last active April 24, 2017 09:54
Automatic Testing: Blog Gemfile
source 'https://rubygems.org/'
gem 'activerecord', '4.2.8'
gem 'sinatra', '1.4.8'
gem 'sinatra-activerecord', '2.0.13'
gem 'sqlite3', '1.3.13'
gem 'capybara', '2.13.0'
gem 'cucumber', '2.4.0'
gem 'cucumber-sinatra', '0.5.0'
@jaybrueder
jaybrueder / att_setup.md
Last active April 20, 2017 11:37
Automatic Testing Prerequisites

UBUNTU

OS dependencies

sudo apt-get update

sudo apt-get install git-core curl zlib1g-dev build-essential 

sudo apt-get install libssl-dev libreadline-dev libyaml-dev libsqlite3-dev