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
### Keybase proof
I hereby claim:
* I am jaybrueder on github.
* I am jaybrueder (https://keybase.io/jaybrueder) on keybase.
* I have a public key whose fingerprint is EDE7 EE48 E434 B972 402F CFB9 99E0 917B 0ACF 5646
To claim this, I am signing this object:
@jaybrueder
jaybrueder / gist:f72f74dcbd157f1a40c6
Created December 6, 2015 13:15
Automatic Testing: spec_helper.rb
ENV['RACK_ENV'] = 'test'
require File.join(File.dirname(__FILE__), '..', 'app.rb')
require 'rack/test'
def app
Sinatra::Application
end
RSpec.configure do |config|