Sam Newman recently published a very interesting blog entry on using fabric to apply puppet scripts on remote machines. He left the provision_using_boto() method as an exercise to the reader. That just sounded tempting enough to be a challenge since I hadn’t gotten around to looking at boto. You can find the result of my attempt on GitHub. To be precise aws.py implements the provisioning using boto and fabfile.py drives fabric and puppet. Hope you find it as useful as I have.
Posts Tagged Python
AWS CloudFront invalidation
Aug 23
It is now possible to invalidate objects (files) inĀ AWS CloudFront distributions. Handy when someone, like me, occasionally publishes files with the wrong content type. Here is how I implement this invalidation in python.
PostgreSQL & Python on Mac
Aug 31
I’ve been playing with Django & MySQL for a while but for my next project I wanted to integrate it with a PostgreSQL database. Everything went well until I wanted to install Psycopg as my python adapter to PostgreSQL.
After a bit of blundering about here’s what it eventually took:
- Download and install PostgreSQL one-click installer from http://www.postgresql.org/download/macosx. Remember to read the README file before actually running the installer.
- Download the psycopg2 source from http://initd.org/pub/software/psycopg/.
- Edit the setup.cfg file to provide a path to the pg_config executable. On my Mac it sits in
/Library/PostgreSQL/8.4/bin/pg_configand is not by default on the PATH so if you don’t put it on the PATH or in this configuration file the next step will fail in a spectacular manner. - Run ‘
sudo easy_install .‘ in the top level psycopg2 source directory. - Specify
postgresql_psycopg2when you configure Django’s database layer for your project.