DigitalOcean inventory
An ansible dynamic inventory for DigitalOcean
Status
| Source | Shields |
|---|---|
| Project | |
| Raised |
Installation
pip install digitalocean_inventory
Usage
Export the project environment variables:
export DO_PROJECT=example
export DO_ENV=production
export DO_SSH_DIR=/Users/joel/.ssh/example
Export an access token:
export DO_ACCESS_TOKEN=<token>
The pacakges exposes the executable:
digitalocean-inventory --list
Tags and inventory metadata are compiled into the output:
{
"meta": {
"hostvars": {
"123.123.123.123": {
"ansible_python_interpreter": "/usr/bin/python3",
"ansible_ssh_extra_args": "-o StrictHostKeyChecking=no",
"ansible_ssh_private_key_file": "/Users/joel/.ssh/example/example-production-0"
}
}
},
"all": {
"hosts": [
"123.123.123.123"
],
"vars": {},
"children": {}
},
"production": {
"hosts": [
"123.123.123.123"
]
},
"manager": {
"hosts": [
"123.123.123.123"
]
}
}
The executable has support for host, list and debug flags:
usage: Digital ocean inventory [-h] [--host [HOST]] [--list [LIST]] [--debug [DEBUG]]
[--private-ips [PRIVATE_IPS]]
optional arguments:
--host [HOST]
--list [LIST]
--debug [DEBUG]
--private-ips [PRIVATE_IPS]
To use with the ansible-playbook cli:
inventory.py:
#!/usr/bin/env python
from digitalocean_inventory import fetch
if __name__ == '__main__':
fetch()
ansible-playbook -i inventory.py <playbook>
You can consume the inventory in order to mutate it before outputting:
#!/usr/bin/env python
from digitalocean_inventory import fetch
if __name__ == '__main__':
inventory = fetch(stdout=False)
print(inventory)
Docs
Additional details are available in the Documentation.
Tests
Install dependencies:
pip install .[tests]
Run with pytest
pytest
Versioning
SemVer is used for versioning. For a list of versions available, see the tags on this repository.
Bump2version is used to version and tag changes. For example:
bump2version patch
Releases are made on every major change.
Author
- Joel Lefkowitz - Initial work - Joel Lefkowitz
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
None yet!
Metadata
Release files for digitalocean-inventory 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| digitalocean_inventory-1.1.0.tar.gz | 6.8 kB | Without provenance | Details for digitalocean_inventory-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| digitalocean_inventory-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for digitalocean_inventory-1.1.0-py3-none-any.whl |
Total release size: 14.2 kB
Release files / digitalocean_inventory-1.1.0.tar.gz
| Download URL | digitalocean_inventory-1.1.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df759e99b42db01411fc07188de992973eee21b48c51d1cf04f469c2e69cbbdf
|
|
BLAKE2b-256 checksum How to use checksums |
65f158f6385211e879382b671a37d9a620ea6735a5a2e2e1de1167e29aa1b002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.6
|
Release files / digitalocean_inventory-1.1.0-py3-none-any.whl
| Download URL | digitalocean_inventory-1.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76933c5f47bbd2a0e3b7bdd0d93e79a059ff2102f59103735b3be432f3a445be
|
|
BLAKE2b-256 checksum How to use checksums |
77ba72b34aeb04b5aa30d3da707c94dc4888a39f4f177e1d01ec3a166041313a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.6
|
Security for digitalocean-inventory 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.