diff --git a/docs/docsite/extra-docs.yml b/docs/docsite/extra-docs.yml new file mode 100644 index 0000000..9570e80 --- /dev/null +++ b/docs/docsite/extra-docs.yml @@ -0,0 +1,5 @@ +--- +sections: + - title: Authentication + toctree: + - authentication diff --git a/docs/docsite/links.yml b/docs/docsite/links.yml new file mode 100644 index 0000000..c7ae323 --- /dev/null +++ b/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/docs/docsite/rst/authentification.rst b/docs/docsite/rst/authentification.rst new file mode 100644 index 0000000..366170f --- /dev/null +++ b/docs/docsite/rst/authentification.rst @@ -0,0 +1,26 @@ +Authentication +============== + +To `authenticate the API call against the Hetzner Cloud API `_ 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