ansible/ansible — pull request #5156 by jalaziz (2013-12-04 09:13:47+00:00)
Title: Improved EC2 multiple account support

These changes allow a user to define a simple shell wrapper script that they can symlink to define different accounts for different environments. I'm not entirely convinced this is the best way to do this, but it seems the simplest without modifying the way dynamic inventory works. I'd love feedback if anyone thinks there's a better way.

For reference, here is the wrapper script I use:
```bash
#!/bin/sh

EC2_INI_PATH=../inventory/$(basename "$0").ini
export EC2_INI_PATH
exec ../inventory/ec2.py "$@"
```

I then create a symlink to this file for each config file representing an environment. For example, if I have a `production.ini` config file, I create a symlink named `production`.

**NOTE**: The path to the config and ec2.py scripts should be adjusted for your setup.