{ "info": { "author": "Chris Lam", "author_email": "chris@knetgb.com", "bugtrack_url": null, "classifiers": [], "description": "# ec2ansible: EC2 inventory generator for Ansible\n\n[![Build Status](https://travis-ci.org/hehachris/ec2ansible.svg?branch=master)](https://travis-ci.org/hehachris/ec2ansible) [![Downloads](https://img.shields.io/pypi/dm/ec2ansible.svg)](https://pypi.python.org/pypi/ec2ansible) [![MIT License](https://img.shields.io/pypi/l/ec2ansible.svg)](https://github.com/hehachris/ec2ansible)\n\n`ec2ansible` is a cli tool written in Python (2.7+) for generating realtime AWS EC2 inventory for [Ansible](http://docs.ansible.com/).\n\nThere is an [official script](http://docs.ansible.com/intro_dynamic_inventory.html#example-aws-ec2-external-inventory-script) doing the similar thing. But usually when we are provisioning a server, we only care about its **role**, eg. web server, database server, proxy server, etc, instead of its availability zone, AMI ID, nor instance type. `ec2ansible` groups your EC2 servers into Ansible inventory hierarchically based on the `Role` tag associated with them.\n\n## Use Case\nAsumming we have two main types of servers in the us-east-1 region: web servers and worker servers. And we have totally 5 servers as follow:\n- Apache\n- Nginx reverse proxy\n- HAProxy reverse proxy\n- Gearman worker\n- Celery worker\n\nFirstly we will add a `Role` tag for each of them with the following values:\n- web_apache\n- web_proxy_nginx\n- web_proxy_haproxy\n- worker_gearman\n- worker_celery\n\nHere is a sample grouping generated by `ec2ansible`:\n\n```\nuse1 (us-east-1)\n\u2514\u2500\u2500\u2500 web\n \u2502 web_apache\n \u2514\u2500\u2500\u2500 web_proxy\n \u2502 web_proxy_nginx\n \u2502 web_proxy_haproxy\n\u2514\u2500\u2500\u2500 worker\n \u2502 worker_gearman\n \u2502 worker_celery\n```\n\n## Installation\n`ec2ansible` is available via [pypi](https://pypi.python.org/pypi/ec2ansible) and can be installed with easy_install or [pip](https://pip.pypa.io/en/latest/index.html):\n```bash\npip install ec2ansible\n```\n\n## Usage\n1. Save [ec2ansible-sample.ini](/hehachris/ec2ansible/blob/master/ec2ansible-sample.ini) to `~/.ec2ansible` and modify it if needed\n2. Specify `/usr/local/bin/ec2ansible` as the inventory for Ansible\n\n```bash\nansible web_apache -i /usr/local/bin/ec2ansible -u ec2-user -m ping\n```\nor set in `ansible.cfg`\n```\nhostfile = /usr/local/bin/ec2ansible\n```\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hehachris/ec2ansible", "keywords": "ansible ec2 aws devops", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "ec2ansible", "package_url": "https://pypi.org/project/ec2ansible/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ec2ansible/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hehachris/ec2ansible" }, "release_url": "https://pypi.org/project/ec2ansible/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "AWS EC2 inventory generator for Ansible", "version": "0.1.2" }, "last_serial": 1529240, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2206830f51a56474005eac7c847cc3b7", "sha256": "800e04827d63e12f15ac90d1ab5c8b1e99103eadc8d26d9ea7a4aab129c5d1f5" }, "downloads": -1, "filename": "ec2ansible-0.1.tar.gz", "has_sig": false, "md5_digest": "2206830f51a56474005eac7c847cc3b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4078, "upload_time": "2015-05-01T04:09:08", "url": "https://files.pythonhosted.org/packages/17/1a/7b6605db1488d14fe144649c362ff294c8c426337022dd53b4a9112f1f28/ec2ansible-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ad643fcaa5d79ea5efb330049eb48760", "sha256": "e20e68cdcf5021bc5073e33f6753f0be6a24da13ac3da402c694ed07728da2a0" }, "downloads": -1, "filename": "ec2ansible-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ad643fcaa5d79ea5efb330049eb48760", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4089, "upload_time": "2015-05-01T05:34:43", "url": "https://files.pythonhosted.org/packages/df/ee/6aaa25c08ce44ed9eb00f8c9fb5d358547c99d72db18adc43e422e6c138d/ec2ansible-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2470a3d00014da991265d8e7dc490893", "sha256": "8a487759a79c61ac3315e08e0dcc87eda3895d2e7ac6723fe3d1900f8ea5b15f" }, "downloads": -1, "filename": "ec2ansible-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2470a3d00014da991265d8e7dc490893", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5272, "upload_time": "2015-05-01T10:05:52", "url": "https://files.pythonhosted.org/packages/30/f1/e879510c5ea03f7bb84c9a5ade98889c33452db69488a0ef3d9fd4dfd5fa/ec2ansible-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2470a3d00014da991265d8e7dc490893", "sha256": "8a487759a79c61ac3315e08e0dcc87eda3895d2e7ac6723fe3d1900f8ea5b15f" }, "downloads": -1, "filename": "ec2ansible-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2470a3d00014da991265d8e7dc490893", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5272, "upload_time": "2015-05-01T10:05:52", "url": "https://files.pythonhosted.org/packages/30/f1/e879510c5ea03f7bb84c9a5ade98889c33452db69488a0ef3d9fd4dfd5fa/ec2ansible-0.1.2.tar.gz" } ] }