From the talk "Automation in the Small: Code to Cloud"
Switch branches/tags
Nothing to show
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.
ansible
doc
packer
.gitattributes
.gitignore
LICENSE.txt
README.md
setup-mac.sh

README.md

dev-automation-small

Developer automation in the small.

An example of integrated tools for machine configuration, local software development, and deployment to a cloud hosting provider.

Overview

Setup on a Mac

You may run setup-mac.sh to install the required tools on a Mac.

 $ ./setup-mac.sh

This example has been created & verified on Mac OS X 10.9.x.

Configuring your SSH public key

You must update the script at /packer/scripts/common/publickey.sh to copy your public key. This will allow Ansible to access your machines. Without this change Ansible will attempt to use the default public key, and you will not be able to access your machines.

You must also update your local SSH configuration. In your local file ~/.ssh/config add an entry that tells SSH to use your private key when connecting to your virtual machine:

Host localhost
HostName localhost
Port 3022
IdentitiesOnly yes
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
User packer

You should edit the above line IdentityFile ~/.ssh/id_rsa so that the file path is your private key that matches your public key configured in the script at /packer/scripts/common/publickey.sh.

Build a machine for VirtualBox

Use packer to configure machines. First, confirm the packer template file is valid.

$ cd packer
$ packer validate debian-7.x-amd64.json
Template validated successfully.

Build with virtualbox-iso to configure local machines for development use.

$ packer build -only=virtualbox-iso -force debian-7.x-amd64.json

Run a machine with VirtualBox

You may run the machine with VirtualBox. First, import the newly built machine:

 $ cd packer
 $ ./vm-import.sh

Then, run the virtual machine:

 $ ./vm-start.sh

The virtual machine will run in headless mode, no UI should be visible.

Configure a machine with Ansible

Use ansible for configuration management of machines.

When your machines are running, you may connect to them via SSH and configure them with Ansible.

You may setup your machines with the command:

$ cd ansible
$ ansible -i inventory.ini all -m setup -vvvv

You may ping your machines with the command:

$ ansible -i inventory.ini all -m ping

Related

Resources