This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Script to remove GPG key from git-crypt | |
# | |
# It will re-initialize git-crypt for the repository and re-add all keys except | |
# the one requested for removal. | |
# | |
# Note: You still need to change all your secrets to fully protect yourself. | |
# Removing a user will prevent them from reading future changes but they will | |
# still have a copy of the data up to the point of their removal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Create a Kubernetes registry secret for an AWS ECR region | |
# Requires AWS CLI: https://aws.amazon.com/cli/ | |
# Requires kubectl: https://coreos.com/kubernetes/docs/latest/configure-kubectl.html | |
# | |
# | |
# This secret can be used with 'imagePullSecret' for Kubernetes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Jenkins | |
After=network.target | |
Requires=network.target | |
[Service] | |
Type=simple | |
EnvironmentFile=/etc/sysconfig/jenkins | |
ExecStart=/usr/bin/java ${JENKINS_JAVA_OPTIONS} -jar /usr/lib/jenkins/jenkins.war --httpPort=${JENKINS_PORT} --httpListenAddress=${JENKINS_LISTEN_ADDRESS} ${JENKINS_ARGS} | |
Restart=always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright © 2016 Dan Sheridan <dan.sheridan@postman.org.uk> | |
# This work is free. You can redistribute it and/or modify it under the | |
# terms of the Do What The Fuck You Want To Public License, Version 2, | |
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
import salt.client | |
import argparse | |
import sys | |
import fnmatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :environment do | |
errors = [] | |
%w( | |
TF_VAR_dnsimple_email | |
TF_VAR_dnsimple_token | |
AWS_ACCESS_KEY_ID | |
AWS_SECRET_ACCESS_KEY | |
AWS_DEFAULT_REGION | |
).each do |name| | |
errors << name if ENV[name].nil? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For anyone who finds this and wants to run a version of ansible that is not full of bugs (which are not edge case bugs i might add) here are the steps you should use on ubuntu. This is specific to trusty, but should be usable with other ubuntu versions by replacing the download URL: | |
# Make sure we are up to date | |
/usr/bin/apt-get update | |
# Download working ansible deb package | |
wget https://launchpad.net/~ansible/+archive/ubuntu/ansible/+build/8129693/+files/ansible_1.9.4-1ppa~trusty_all.deb -O /tmp/ansible.deb | |
# Manually install deps | |
apt-get install -y python-support \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Sid": "PackerSecurityGroupAccess", | |
"Action": [ | |
"ec2:CreateSecurityGroup", | |
"ec2:DeleteSecurityGroup", | |
"ec2:DescribeSecurityGroups", | |
"ec2:AuthorizeSecurityGroupIngress", | |
"ec2:RevokeSecurityGroupIngress" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class sethostname { | |
file { "/etc/hostname": | |
ensure => present, | |
owner => root, | |
group => root, | |
mode => 644, | |
content => "$::fqdn\n", | |
notify => Exec["set-hostname"], | |
} | |
exec { "set-hostname": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packer build packer.json 2>&1 | sudo tee output.txt | |
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
vars: | |
ec2_access_key: "AKIA-----------A" | |
ec2_secret_key: "i-------------/--------A" | |
remote_user: ec2-user | |
sudo: yes | |
tasks: | |
- name: "make sure package perl-switch is installed for the monitoring scripts" | |
yum: name=perl-Switch state=present | |
when: ansible_os_family == "RedHat" |