mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-03 23:51:48 +00:00
##### SUMMARY Add a global documentation for the collection. See the https://github.com/ansible-collections/collection_template and https://github.com/ansible-collections/amazon.aws/tree/main/docs/docsite for examples. ##### ISSUE TYPE - Docs Pull Request
26 lines
851 B
ReStructuredText
26 lines
851 B
ReStructuredText
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
|