Debian Codegraph @

ansible_collections/hetzner/hcloud/docs/docsite/rst/guides.rst

raw
1 .. _ansible_collections.hetzner.hcloud.docsite.authentication:
2
3 Authentication
4 ==============
5
6 To `authenticate the API call against the Hetzner Cloud API <https://docs.hetzner.cloud/reference/cloud#authentication>`_ when
7 using the ``hetzner.hcloud`` collection, you can provide the API token by different means:
8
9 You can pass the API token using an environment variable (recommended):
10
11 .. code-block:: bash
12
13 export HCLOUD_TOKEN='LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj'
14
15 # Verify that your token is working
16 ansible -m hetzner.hcloud.location_info localhost
17
18 Alternatively, you may provide the API token directly as module argument:
19
20 .. code-block:: yaml
21
22 - name: Create server
23 hetzner.hcloud.server:
24 api_token: LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj
25 name: my-server
26 server_type: cpx22
27 image: debian-12
28 state: present
29
30 To reduce the duplication of the above solution, you may configure the
31 ``hetzner.hcloud.*`` modules using the ``hetzner.hcloud.all`` action group, for
32 example if you want to store your API token in a vault:
33
34 .. code-block:: yaml
35
36 - name: Demonstrate the usage of the 'hetzner.hcloud.all' module_defaults group
37 hosts: localhost
38 connection: local
39
40 module_defaults:
41 group/hetzner.hcloud.all:
42 api_token: "{{ _vault_hcloud_api_token }}"
43
44 tasks:
45 - name: Create server
46 hetzner.hcloud.server:
47 name: my-server
48 server_type: cpx22
49 image: debian-12
50 state: present
51
52 Experimental features
53 =====================
54
55 Experimental features are published as part of our regular releases (e.g. a product
56 public beta). During an experimental phase, breaking changes on those features may occur
57 within minor releases.
58
59 The stability of experimental features is not related to the stability of its upstream API.
60
61 Experimental features have different levels of maturity (e.g. experimental, alpha, beta)
62 based on the maturity of the upstream API.
63
64 While experimental features will be announced in the release notes, you can also find
65 whether a module, or filter is experimental in its documentation:
66
67 .. code-block:: txt
68
69 Experimental: $PRODUCT is $MATURITY, breaking changes may occur within minor releases. See https://docs.hetzner.cloud/changelog#$SLUG for more details.