summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlicia Cozine <cozi@visi.com>2018-07-31 10:21:17 -0500
committerGitHub <noreply@github.com>2018-07-31 10:21:17 -0500
commitd067de5206b94723847be88b371a1d5c45a73f17 (patch)
treee9de6fd16939ecdf9f877396616d2ac3d17bb64b /docs
parent17ecc3f093024113b8db878bdb7d4a4c1fa69f4d (diff)
downloadansible-d067de5206b94723847be88b371a1d5c45a73f17.tar.gz
Update Openstack dynamic inventory reference (#41459) (#43455)
* Update Openstack dynamic inventory link * Add note for change of script name * Change name of script to prevent Python module import errors. Fixes #41562 (cherry picked from commit 8d194fa5f7449646bbad248b9a84ef413ba5f373)
Diffstat (limited to 'docs')
-rw-r--r--docs/docsite/rst/user_guide/intro_dynamic_inventory.rst28
1 files changed, 15 insertions, 13 deletions
diff --git a/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst b/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst
index 31a76d91bc..d42682eac8 100644
--- a/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst
+++ b/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst
@@ -246,19 +246,22 @@ explicitly clear the cache, you can run the ec2.py script with the ``--refresh-c
Example: OpenStack External Inventory Script
````````````````````````````````````````````
-If you use an OpenStack based cloud, instead of manually maintaining your own inventory file, you can use the openstack.py dynamic inventory to pull information about your compute instances directly from OpenStack.
+If you use an OpenStack based cloud, instead of manually maintaining your own inventory file, you can use the openstack_inventory.py dynamic inventory to pull information about your compute instances directly from OpenStack.
You can download the latest version of the OpenStack inventory script `here <https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack_inventory.py>`_.
-You can use the inventory script explicitly (by passing the `-i openstack.py` argument to Ansible) or implicitly (by placing the script at `/etc/ansible/hosts`).
+You can use the inventory script explicitly (by passing the `-i openstack_inventory.py` argument to Ansible) or implicitly (by placing the script at `/etc/ansible/hosts`).
Explicit use of inventory script
++++++++++++++++++++++++++++++++
Download the latest version of the OpenStack dynamic inventory script and make it executable::
- wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack.py
- chmod +x openstack.py
+ wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack_inventory.py
+ chmod +x openstack_inventory.py
+
+.. note::
+ Do not name it `openstack.py`. This name will conflict with imports from openstacksdk.
Source an OpenStack RC file::
@@ -276,13 +279,13 @@ You can confirm the file has been successfully sourced by running a simple comma
You can test the OpenStack dynamic inventory script manually to confirm it is working as expected::
- ./openstack.py --list
+ ./openstack_inventory.py --list
-After a few moments you should see some JSON output with information about your compute instances.
+After a few moments you should see some JSON output with information about your compute instances.
-Once you confirm the dynamic inventory script is working as expected, you can tell Ansible to use the `openstack.py` script as an inventory file, as illustrated below::
+Once you confirm the dynamic inventory script is working as expected, you can tell Ansible to use the `openstack_inventory.py` script as an inventory file, as illustrated below::
- ansible -i openstack.py all -m ping
+ ansible -i openstack_inventory.py all -m ping
Implicit use of inventory script
++++++++++++++++++++++++++++++++
@@ -290,8 +293,8 @@ Implicit use of inventory script
Download the latest version of the OpenStack dynamic inventory script, make it executable and copy it to `/etc/ansible/hosts`::
wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack_inventory.py
- chmod +x openstack.py
- sudo cp openstack.py /etc/ansible/hosts
+ chmod +x openstack_inventory.py
+ sudo cp openstack_inventory.py /etc/ansible/hosts
Download the sample configuration file, modify it to suit your needs and copy it to `/etc/ansible/openstack.yml`::
@@ -308,9 +311,9 @@ After a few moments you should see some JSON output with information about your
Refresh the cache
+++++++++++++++++
-Note that the OpenStack dynamic inventory script will cache results to avoid repeated API calls. To explicitly clear the cache, you can run the openstack.py (or hosts) script with the ``--refresh`` parameter::
+Note that the OpenStack dynamic inventory script will cache results to avoid repeated API calls. To explicitly clear the cache, you can run the openstack_inventory.py (or hosts) script with the ``--refresh`` parameter::
- ./openstack.py --refresh --list
+ ./openstack_inventory.py --refresh --list
.. _other_inventory_scripts:
@@ -381,4 +384,3 @@ the dynamic groups as empty in the static inventory file. For example::
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel
-