From 460a36381fd64e7ee4968e90abb4a9771c047418 Mon Sep 17 00:00:00 2001 From: Andrea Galbusera Date: Tue, 29 Aug 2023 23:40:54 +0200 Subject: [PATCH] Inventory plugin: restore documentation for oauth_token By completely removing any documentation for api_token / oauth_token, commit 609df3eaf506a5db13a960d5fc4bf4f70b5a3e50 suddenly broke support for reading the auth token from environment variables (which magically happens to work based on plugin options documentation). Restore the documentation bits by matching docs fragment. While at it, also match the documented list of supported env variables which can be used as auth token sources. Fixes #315 --- plugins/inventory/digitalocean.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/inventory/digitalocean.py b/plugins/inventory/digitalocean.py index b886fc11..47c09805 100644 --- a/plugins/inventory/digitalocean.py +++ b/plugins/inventory/digitalocean.py @@ -30,6 +30,18 @@ this should always be C(community.digitalocean.digitalocean). required: true choices: ['community.digitalocean.digitalocean'] + oauth_token: + description: + - DigitalOcean OAuth token. + - Template expressions can be used in this field. + required: true + type: str + aliases: [ api_token ] + env: + - name: DO_API_TOKEN + - name: DO_API_KEY + - name: DO_OAUTH_TOKEN + - name: OAUTH_TOKEN attributes: description: >- Droplet attributes to add as host vars to each inventory host.