Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# [email protected] | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
--- | |
- name: Ansible tips | |
connection: local | |
hosts: localhost | |
tasks: | |
- name: Ping only if OSX | |
ping: | |
when: "{{ lookup('pipe', 'uname -s') | match('Darwin') }}" |
Create a policy like this, substituting your AWS account number, then attach it to all groups and roles. It will prevent deletion of RDS instances containing the string "prod" in their name.
Note: This is intended to prevent accidental deletion, and is easily sidestepped.
#!/usr/bin/expect | |
set timeout -1; | |
spawn {{django_dir}}/venv/bin/python manage.py changepassword {{admin_user}}; | |
expect { | |
"Password:" { exp_send "{{admin_pass}}\r" ; exp_continue } | |
"Password (again):" { exp_send "{{admin_pass}}\r" ; exp_continue } | |
eof | |
} |
--- | |
# test SSH agent forwarding | |
- shell: echo "Client= [$SSH_CLIENT] Sock= [$SSH_AUTH_SOCK]" | |
sudo: no | |
register: myecho | |
- debug: msg="{{myecho.stdout}}" | |
- shell: ssh-add -l | |
sudo: no | |
register: myecho | |
- debug: msg="{{myecho.stdout}}" |
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
[ssh_connection] | |
ssh_args = -F ssh.cfg | |
control_path = ~/.ssh/mux-%r@%h:%p |
Desktop linux has been late to the show with high dpi support, but gnome seems to be leading the pack. I decided to try again. It's worked fairly well out of the box. Here are my steps if anyone wishes to repeat.
Download the iso from http://ubuntugnome.org/ubuntu-gnome-14-10-is-released/
Insert usb stick, umount using diskutil and dd the image. (make sure to use the right devices when using dd, your setup may vary)
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "aws" | |
config.vm.synced_folder ".", "/vagrant", disabled: true | |
config.vm.provider :aws do |aws, override| | |
aws.access_key_id = ENV['AWS_ACCESS_KEY'] | |
aws.secret_access_key = ENV['AWS_SECRET_KEY'] |