Install ansible on Amazon EC2

Amazon Linux variety

# enable root ssh login as per http://tinyurl.com/d46d3o8
# as root
cd /usr/local/src
yum -y install git python-jinja2 python-paramiko PyYAML make MySQL-python
git clone git://github.com/ansible/ansible.git
cd ansible && make install

As per http://ansible.cc/docs/gettingstarted.html add your EC2 instance to /etc/ansible/hosts on your local (master) ansible install. You may also want to add your ansible key file to ssh-agent


# if you haven't enable root ssh login, use -u ec2-user
ansible all -u root -m ping

Testing out cobbler with virtuabox

Some of the steps from my test of cobbler / centos / virtualbox.

  1. Download Centos 6 minimal ISO, install it on a virtualbox guest #1.
    1. Call it centos6a.
    2. Configure it with ~8GB root partition, 1GB memory & 2 network interfaces, eth0 bridged adaptor, eth1 internal network.
    3. Unless you really want it I recommend disabling SELinux.
    4. Manually configure eth1 on a private network (system-config-network), you will configure dnsmasq/cobbler later to use this private network
  2. Install & configure cobbler & cobbler-web as per this HOWTO.
    1. Review settings & modules.conf in /etc/cobbler/ – particularly dhcp & tftp settings.
  3. Copy the centos 6 iso over to centos6a and mount it
    1. mount -o loop /tmp/c6a.iso /mnt
  4. Import the centos 6 iso
    1. cobbler import –path=/mnt –name=Centos6 –arch=x86_64
  5. cp /etc/cobbler/dnsmasq.template /etc/cobbler/dnsmasq.conf clean up & restart dnsmasq
  6. cobbler sync
  7. Create virtualbox client #2 (centos6b)
    1. 512MB memory, 1 network interface (eth0 internal, adaptor type PC-Net III (for PXE boot)), ~4GB diskspace
    2. Settings -> Motherboard, move network to top of boot order
  8. Boot centos6b – it should install from cobbler

Other resources: Start Here

 

 

Using makefiles to manage config

I last used makefiles a long time ago, so this took some refreshing…

Recently I’ve been looking at using qtile, a python based window manager. I’ve also been thinking about managing my config files using git and makefiles to “publish”. Here’s an example makefile for config.py:


SRCFILE = config.py
DSTDIR = ~/.config/qtile/

.PHONY: all
all: $(DSTDIR)/$(SRCFILE)

$(DSTDIR)/%.py: $(SRCFILE)
@cp -fp -- $(SRCFILE) $(DSTDIR)/$(SRCFILE)