summaryrefslogtreecommitdiffstats
path: root/ansible_collections/hetzner/hcloud/docs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-18 05:52:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-18 05:52:22 +0000
commit38b7c80217c4e72b1d8988eb1e60bb6e77334114 (patch)
tree356e9fd3762877d07cde52d21e77070aeff7e789 /ansible_collections/hetzner/hcloud/docs
parentAdding upstream version 7.7.0+dfsg. (diff)
downloadansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.tar.xz
ansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.zip
Adding upstream version 9.4.0+dfsg.upstream/9.4.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/hetzner/hcloud/docs')
-rw-r--r--ansible_collections/hetzner/hcloud/docs/docsite/extra-docs.yml5
-rw-r--r--ansible_collections/hetzner/hcloud/docs/docsite/links.yml10
-rw-r--r--ansible_collections/hetzner/hcloud/docs/docsite/rst/guides.rst50
3 files changed, 65 insertions, 0 deletions
diff --git a/ansible_collections/hetzner/hcloud/docs/docsite/extra-docs.yml b/ansible_collections/hetzner/hcloud/docs/docsite/extra-docs.yml
new file mode 100644
index 000000000..fa9b5bd68
--- /dev/null
+++ b/ansible_collections/hetzner/hcloud/docs/docsite/extra-docs.yml
@@ -0,0 +1,5 @@
+---
+sections:
+ - title: Guides
+ toctree:
+ - guides
diff --git a/ansible_collections/hetzner/hcloud/docs/docsite/links.yml b/ansible_collections/hetzner/hcloud/docs/docsite/links.yml
new file mode 100644
index 000000000..c7ae323c2
--- /dev/null
+++ b/ansible_collections/hetzner/hcloud/docs/docsite/links.yml
@@ -0,0 +1,10 @@
+---
+edit_on_github:
+ repository: ansible-collections/hetzner.hcloud
+ branch: main
+
+extra_links:
+ - description: Hetzner Cloud API Reference
+ url: https://docs.hetzner.cloud
+ - description: Hetzner Cloud API Changelog
+ url: https://docs.hetzner.cloud/changelog
diff --git a/ansible_collections/hetzner/hcloud/docs/docsite/rst/guides.rst b/ansible_collections/hetzner/hcloud/docs/docsite/rst/guides.rst
new file mode 100644
index 000000000..14e6b2f05
--- /dev/null
+++ b/ansible_collections/hetzner/hcloud/docs/docsite/rst/guides.rst
@@ -0,0 +1,50 @@
+.. _ansible_collections.hetzner.hcloud.docsite.authentication:
+
+Authentication
+==============
+
+To `authenticate the API call against the Hetzner Cloud API <https://docs.hetzner.cloud/#authentication>`_ when
+using the ``hetzner.hcloud`` collection, you can provide the API token by different means:
+
+You can pass the API token using an environment variable (recommended):
+
+.. code-block:: bash
+
+ export HCLOUD_TOKEN='LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj'
+
+ # Verify that your token is working
+ ansible -m hetzner.hcloud.location_info localhost
+
+Alternatively, you may provide the API token directly as module argument:
+
+.. code-block:: yaml
+
+ - name: Create server
+ hetzner.hcloud.server:
+ api_token: LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj
+ name: my-server
+ server_type: cx11
+ image: debian-12
+ state: present
+
+To reduce the duplication of the above solution, you may configure the
+``hetzner.hcloud.*`` modules using the ``hetzner.hcloud.all`` action group, for
+example if you want to store your API token in a vault:
+
+.. code-block:: yaml
+
+ - name: Demonstrate the usage of the 'hetzner.hcloud.all' module_defaults group
+ hosts: localhost
+ connection: local
+
+ module_defaults:
+ group/hetzner.hcloud.all:
+ api_token: "{{ _vault_hcloud_api_token }}"
+
+ tasks:
+ - name: Create server
+ hetzner.hcloud.server:
+ name: my-server
+ server_type: cx11
+ image: debian-12
+ state: present