Skip to content

Commit

Permalink
Update the DigitalOcean dynamic inventory script from Ansible upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Mar 15, 2018
1 parent 69f1a44 commit 7e650d1
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 124 deletions.
2 changes: 1 addition & 1 deletion dynamic-inventory/digitalocean/README.md
Expand Up @@ -7,7 +7,7 @@ Chapter 7 of [Ansible for DevOps](https://www.ansiblefordevops.com/) contains de
Examples using Ansible's DigitalOcean integration are contained within this directory.

- `provision.yml` contains an example of provisioning a new DigitalOcean droplet, then immediately configuring it with Ansible.
- `digital_ocean.py` is the DigitalOcean dynamic inventory script included with Ansible. Don't use this copy; get a fresh, up-to-date copy from the Ansible project instead.
- `digital_ocean.py` (and `digital_ocean.ini`) is the DigitalOcean dynamic inventory script included with Ansible. Don't use this copy; get the latest version from the Ansible project: [digital_ocean.py](https://github.com/ansible/ansible/blob/devel/contrib/inventory/digital_ocean.py).

Before you can use either of these examples, you will need to set an environment variable with your DigitalOcean API Personal Access Token:

Expand Down
34 changes: 34 additions & 0 deletions dynamic-inventory/digitalocean/digital_ocean.ini
@@ -0,0 +1,34 @@
# Ansible DigitalOcean external inventory script settings
#

[digital_ocean]

# The module needs your DigitalOcean API Token.
# It may also be specified on the command line via --api-token
# or via the environment variables DO_API_TOKEN or DO_API_KEY
#
#api_token = 123456abcdefg


# API calls to DigitalOcean may be slow. For this reason, we cache the results
# of an API call. Set this to the path you want cache files to be written to.
# One file will be written to this directory:
# - ansible-digital_ocean.cache
#
cache_path = /tmp


# The number of seconds a cache file is considered valid. After this many
# seconds, a new API call will be made, and the cache file will be updated.
#
cache_max_age = 300

# Use the private network IP address instead of the public when available.
#
use_private_network = False

# Pass variables to every group, e.g.:
#
# group_variables = { 'ansible_user': 'root' }
#
group_variables = {}

0 comments on commit 7e650d1

Please sign in to comment.