From 9c5a6d7b5a57911062d705c7998978c3efdf41d6 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 10 Jul 2015 12:59:52 -0400 Subject: [PATCH] fixed all references to old plugins/inventory to point at contrib/inventory --- contrib/inventory/digital_ocean.py | 2 +- contrib/inventory/gce.py | 2 +- contrib/inventory/ovirt.py | 2 +- docsite/rst/guide_gce.rst | 6 +++--- docsite/rst/intro_dynamic_inventory.rst | 14 +++++++------- test/integration/Makefile | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/inventory/digital_ocean.py b/contrib/inventory/digital_ocean.py index 1323a384ba9..4f312e7c246 100755 --- a/contrib/inventory/digital_ocean.py +++ b/contrib/inventory/digital_ocean.py @@ -111,7 +111,7 @@ optional arguments: # (c) 2013, Evan Wies # # Inspired by the EC2 inventory plugin: -# https://github.com/ansible/ansible/blob/devel/plugins/inventory/ec2.py +# https://github.com/ansible/ansible/blob/devel/contrib/inventory/ec2.py # # This file is part of Ansible, # diff --git a/contrib/inventory/gce.py b/contrib/inventory/gce.py index 5fe3db93f8e..59947fb1665 100755 --- a/contrib/inventory/gce.py +++ b/contrib/inventory/gce.py @@ -66,7 +66,7 @@ Examples: $ ansible -i gce.py us-central1-a -m shell -a "/bin/uname -a" Use the GCE inventory script to print out instance specific information - $ plugins/inventory/gce.py --host my_instance + $ contrib/inventory/gce.py --host my_instance Author: Eric Johnson Version: 0.0.1 diff --git a/contrib/inventory/ovirt.py b/contrib/inventory/ovirt.py index 4cb4b09eaef..dc022c5dfd2 100755 --- a/contrib/inventory/ovirt.py +++ b/contrib/inventory/ovirt.py @@ -56,7 +56,7 @@ Examples: $ ansible -i ovirt.py us-central1-a -m shell -a "/bin/uname -a" Use the ovirt inventory script to print out instance specific information - $ plugins/inventory/ovirt.py --host my_instance + $ contrib/inventory/ovirt.py --host my_instance Author: Josha Inglis based on the gce.py by Eric Johnson Version: 0.0.1 diff --git a/docsite/rst/guide_gce.rst b/docsite/rst/guide_gce.rst index fb317265d45..c689632818e 100644 --- a/docsite/rst/guide_gce.rst +++ b/docsite/rst/guide_gce.rst @@ -88,9 +88,9 @@ GCE Dynamic Inventory The best way to interact with your hosts is to use the gce inventory plugin, which dynamically queries GCE and tells Ansible what nodes can be managed. -Note that when using the inventory script ``gce.py``, you also need to populate the ``gce.ini`` file that you can find in the plugins/inventory directory of the ansible checkout. +Note that when using the inventory script ``gce.py``, you also need to populate the ``gce.ini`` file that you can find in the contrib/inventory directory of the ansible checkout. -To use the GCE dynamic inventory script, copy ``gce.py`` from ``plugins/inventory`` into your inventory directory and make it executable. You can specify credentials for ``gce.py`` using the ``GCE_INI_PATH`` environment variable -- the default is to look for gce.ini in the same directory as the inventory script. +To use the GCE dynamic inventory script, copy ``gce.py`` from ``contrib/inventory`` into your inventory directory and make it executable. You can specify credentials for ``gce.py`` using the ``GCE_INI_PATH`` environment variable -- the default is to look for gce.ini in the same directory as the inventory script. Let's see if inventory is working: @@ -111,7 +111,7 @@ Now let's see if we can use the inventory script to talk to Google. "x.x.x.x" ], -As with all dynamic inventory plugins in Ansible, you can configure the inventory path in ansible.cfg. The recommended way to use the inventory is to create an ``inventory`` directory, and place both the ``gce.py`` script and a file containing ``localhost`` in it. This can allow for cloud inventory to be used alongside local inventory (such as a physical datacenter) or machines running in different providers. +As with all dynamic inventory scripts in Ansible, you can configure the inventory path in ansible.cfg. The recommended way to use the inventory is to create an ``inventory`` directory, and place both the ``gce.py`` script and a file containing ``localhost`` in it. This can allow for cloud inventory to be used alongside local inventory (such as a physical datacenter) or machines running in different providers. Executing ``ansible`` or ``ansible-playbook`` and specifying the ``inventory`` directory instead of an individual file will cause ansible to evaluate each file in that directory for inventory. diff --git a/docsite/rst/intro_dynamic_inventory.rst b/docsite/rst/intro_dynamic_inventory.rst index 00023a4ccae..5b634d86cd9 100644 --- a/docsite/rst/intro_dynamic_inventory.rst +++ b/docsite/rst/intro_dynamic_inventory.rst @@ -12,7 +12,7 @@ in a different software system. Ansible provides a basic text-based system as d Frequent examples include pulling inventory from a cloud provider, LDAP, `Cobbler `_, or a piece of expensive enterprisey CMDB software. -Ansible easily supports all of these options via an external inventory system. The plugins directory contains some of these already -- including options for EC2/Eucalyptus, Rackspace Cloud, and OpenStack, examples of some of which will be detailed below. +Ansible easily supports all of these options via an external inventory system. The contrib/inventory directory contains some of these already -- including options for EC2/Eucalyptus, Rackspace Cloud, and OpenStack, examples of some of which will be detailed below. :doc:`tower` also provides a database to store inventory results that is both web and REST Accessible. Tower syncs with all Ansible dynamic inventory sources you might be using, and also includes a graphical inventory editor. By having a database record of all of your hosts, it's easy to correlate past event history and see which ones have had failures on their last playbook runs. @@ -30,7 +30,7 @@ While primarily used to kickoff OS installations and manage DHCP and DNS, Cobble layer that allows it to represent data for multiple configuration management systems (even at the same time), and has been referred to as a 'lightweight CMDB' by some admins. -To tie Ansible's inventory to Cobbler (optional), copy `this script `_ to /etc/ansible and `chmod +x` the file. cobblerd will now need +To tie Ansible's inventory to Cobbler (optional), copy `this script `_ to /etc/ansible and `chmod +x` the file. cobblerd will now need to be running when you are using Ansible and you'll need to use Ansible's ``-i`` command line option (e.g. ``-i /etc/ansible/cobbler.py``). This particular script will communicate with Cobbler using Cobbler's XMLRPC API. @@ -80,14 +80,14 @@ So in other words, you can use those variables in arguments/actions as well. Example: AWS EC2 External Inventory Script `````````````````````````````````````````` -If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach, because hosts may come and go over time, be managed by external applications, or you might even be using AWS autoscaling. For this reason, you can use the `EC2 external inventory `_ script. +If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach, because hosts may come and go over time, be managed by external applications, or you might even be using AWS autoscaling. For this reason, you can use the `EC2 external inventory `_ script. You can use this script in one of two ways. The easiest is to use Ansible's ``-i`` command line option and specify the path to the script after marking it executable:: ansible -i ec2.py -u ubuntu us-east-1d -m ping -The second option is to copy the script to `/etc/ansible/hosts` and `chmod +x` it. You will also need to copy the `ec2.ini `_ file to `/etc/ansible/ec2.ini`. Then you can run ansible as you would normally. +The second option is to copy the script to `/etc/ansible/hosts` and `chmod +x` it. You will also need to copy the `ec2.ini `_ file to `/etc/ansible/ec2.ini`. Then you can run ansible as you would normally. To successfully make an API call to AWS, you will need to configure Boto (the Python interface to AWS). There are a `variety of methods `_ available, but the simplest is just to export two environment variables:: @@ -96,7 +96,7 @@ To successfully make an API call to AWS, you will need to configure Boto (the Py You can test the script by itself to make sure your config is correct:: - cd plugins/inventory + cd contrib/inventory ./ec2.py --list After a few moments, you should see your entire EC2 inventory across all regions in JSON. @@ -185,7 +185,7 @@ Both ``ec2_security_group_ids`` and ``ec2_security_group_names`` are comma-separ To see the complete list of variables available for an instance, run the script by itself:: - cd plugins/inventory + cd contrib/inventory ./ec2.py --host ec2-12-12-12-12.compute-1.amazonaws.com Note that the AWS inventory script will cache results to avoid repeated API calls, and this cache setting is configurable in ec2.ini. To @@ -210,7 +210,7 @@ In addition to Cobbler and EC2, inventory scripts are also available for:: Vagrant (not to be confused with the provisioner in vagrant, which is preferred) Zabbix -Sections on how to use these in more detail will be added over time, but by looking at the "plugins/" directory of the Ansible checkout +Sections on how to use these in more detail will be added over time, but by looking at the "contrib/inventory" directory of the Ansible checkout it should be very obvious how to use them. The process for the AWS inventory script is the same. If you develop an interesting inventory script that might be general purpose, please submit a pull request -- we'd likely be glad diff --git a/test/integration/Makefile b/test/integration/Makefile index 69416b1658c..c197bd41530 100644 --- a/test/integration/Makefile +++ b/test/integration/Makefile @@ -164,7 +164,7 @@ $(CONSUL_RUNNING): consul: ifeq ($(CONSUL_RUNNING), True) ansible-playbook -i $(INVENTORY) consul.yml ; \ - ansible-playbook -i ../../plugins/inventory/consul_io.py consul_inventory.yml + ansible-playbook -i ../../contrib/inventory/consul_io.py consul_inventory.yml else @echo "Consul agent is not running locally. To run a cluster locally see http://github.com/sgargan/consul-vagrant" endif