do-ansible-inventory

Visit site

do-ansible-inventory is a tool to generate Ansible inventories of DigitalOcean Droplets

do-ansible-inventory is a tool that generates an Ansible inventory file with your DigitalOcean Droplets. It is an alternative to dynamic inventories as you can run do-ansible-inventory once and receive a static inventory file that you can use anywhere, copy, or modify.

Usage

To use do-ansible-inventory, run:

do-ansible-inventory

By default, without setting any options, do-ansible-inventory will attempt to look up the currently configured doctl access token and generate an ansible inventory with:

  • All of your Droplets as Ansible hosts
  • Each DigitalOcean region as an Ansible group containing any Droplets in that region
  • Each Droplet tag as a group containing any Droplets with that tag
  • Each project as a group containing any Droplets within that project

If you do not have doctl installed or would like to explicitly specify the access token, run do-ansible-inventory --access-token ACCESS_TOKEN or use the DIGITALOCEAN_ACCESS_TOKEN environment variable.

The resulting inventory will be printed to the console. You can save it to a file instead by passing --out inventory or redirecting the output like so: do-ansible-inventory > inventory.

Installation and Other Instructions

Please see the project’s GitHub page for detailed instructions on how to install and use it.

Was this helpful?
 
Leave a comment


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Publish your Tool on Community

Have you created an Integration, API Wrapper, Service, or other Tool that helps developers build on DigitalOcean? Help users find it by listing it in Community Tools.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.