Assuming you are in root
Make sure the locale is set to UTF-8
locale-gen UTF-8
Create a .bash_profile in the ~/ with the following entries
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
Vagrant.require_version ">= 1.6.5" | |
unless Vagrant.has_plugin?("vagrant-vbguest") | |
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`" | |
end | |
VAGRANTFILE_API_VERSION = "2" | |
MEMORY = 4096 | |
CPU_COUNT = 2 |
# define some variables | |
variable "aws_ubuntu_ami" { | |
default = "ami-972444ad" | |
} | |
variable "aws_keypair" { | |
default = "xxxx" | |
} | |
# AWS account details |
from jinja2.utils import soft_unicode | |
''' | |
USAGE: | |
- debug: | |
msg: "{{ ec2.results | get_ec2_info('id') }}" | |
Some useful ec2 keys: | |
id | |
dns_name |
from boto.s3.lifecycle import Lifecycle, Transition, Rule | |
import boto | |
c = boto.connect_s3() | |
b = c.lookup('mybucket') | |
t = Transition(days=0, storage_class='GLACIER') | |
r = Rule('foo rule', 'foo', 'Enabled', 1, t) | |
l = Lifecycle() | |
l.append(r) |
I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):
For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.
This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].
First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as
- hosts: all | |
gather_facts: no | |
become: yes | |
tasks: | |
- shell: ls /files/* | |
register: files_to_rename | |
- copy: | |
src: "{{ item.1 }}" | |
dest: "/files/file-{{ item.0 + 1 }}" |
provider "aws" { | |
region = "${var.aws_region}" | |
} | |
// Setup your S3 Bucket | |
resource "aws_s3_bucket" "cdn_bucket" { | |
bucket = "${var.bucket_name}" | |
acl = "public-read" | |
policy = <<POLICY | |
{ |