Skip to content
Ansible/Vagrant/etc. configuration for my personal projects
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
group_vars
roles
templates
.gitignore
LICENSE.md
README.md
Vagrantfile
ansible.cfg
blog.yml
config_dev_environment
cruzalinhas.yml
hosts
provisioning.yml
redirect_sites
rpi.yml
rpi_provisioning.yml
totransit.yml
vagrant_hosts

README.md

chester-ansible-configs

This project contains the configuration for my personal projects (which I automated in an effort to further explore Ansible, Vagrant and related tools), and published because:

  • Ansible exemples may be useful to someone else (despite being very specific to my stuff);
  • It keeps me honest (makes me write scripts that don't suck much, forces me not to have plaintext secrets, exposes security flaws, etc.);
  • Public github is free! ;-)

Feel free to use it (I'm licensing as MIT to ensure that) and to open issues or contact me if you find something awry.

If you want to learn Ansible, I strongly recommend Jeff Geerling's Ansible for DevOps. Several tasks here were based on tasks on his book or some of his tasks in Ansble Galaxy.

(Se você lê Português, veja também o Caixa de Ferramentas DevOps do Gleicon Moraes)

What does it configure?

chester.me (blog)

My personal blog, currently based on a forked Octopress 2.x.

cruzalinhas.com

An app that allows quickly finding public transportation routes in São Paulo. See source code or website for details. It shares she same nginx with the blog above.

Home automation Raspberry Pi

I used my RPi to add voice control to my lights and TV. I added plabooks to provision it and configure the apps, so I can tinker with confidence.

Toronto Transit for Pebble

Back-end for a Pebble app that finds the nearest bus/streetcar stops and shows how long it will take for the next vehicles to arrive.

miniTruco server [TODO]

This is a simple Java app that listens on the 6912 port, handling communication between miniTruco clients and spawning bot players to fill incomplete tables (a miniTruco table requires 4 players).

Quick setup (Mac OS X)

This will get you a VM capable of running any of those services:

brew update
brew install rbenv ansible
brew cask install virtualbox vagrant
vagrant up

To install one (or more) of the services on the virtual machine, run its playbook:

ansible-playbook blog.yml -i vagrant_hosts,

(alternatively you can use -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory, but it will log in with the default user for Ubuntu provisioning, not the {{ admin_user }} defined on the global vars)

Run this script to enable development sites (it redirects ports - until reboot - and add entries to /etc/hosts; run it again to revert all changes):

sudo ./config-dev-environment

Now you can open, say, http://dev.chester.me.

Passwords vault

A few tasks (including the initial run of each playbook) require you to supply your own password vault. See the sample file for details.

Production provisioning

Initial server setup is done by running provisioning.yml with the root user (-u root) against the proper host (one of its tasks is to create the proper user, then disable root and password-based logins).

Once that is done, playbooks may be ran on the proper hosts. Currently I ran all of them on the same host, but they can theoretically live in different machines.

Maintenance tasks

Those are tagged on the playbooks, please check them for such tags and add to ansible-playbook. Examples:

  • To download new data from sptrans: --tags update_sptrans_data;
  • To publish the blog from its repository: --tags publish_blog;
  • To deploy the latest master of cruzalinhas or toronto-transit-time: --tags update_app.
You can’t perform that action at this time.