forked from ansible-collections/hetzner.hcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
hetzner.hcloud.all
action group (ansible-collections#396)
##### SUMMARY This allows to use `module_defaults` against all the modules at once using the new `hetzner.hcloud.all` `action_group`. You can now pass the `api_token` argument using module_defaults: ```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 a volume hetzner.hcloud.volume: name: my-volume location: fsn1 size: 100 state: present register: volume ``` See the documentation and examples for more details. ##### ISSUE TYPE - Feature Pull Request
- Loading branch information
Showing
5 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/add-module-defaults-group-for-all-modules.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- Add the `hetzner.hcloud.all` group to configure all the modules using `module_defaults`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: Demonstrate the usage of the 'hetzner.hcloud.all' module_defaults group | ||
hosts: localhost | ||
connection: local | ||
|
||
module_defaults: | ||
group/hetzner.hcloud.all: | ||
api_token: LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj | ||
|
||
tasks: | ||
- name: Create a volume | ||
hetzner.hcloud.volume: | ||
name: my-volume | ||
location: fsn1 | ||
size: 100 | ||
state: present | ||
register: volume | ||
|
||
- name: Create a server | ||
hetzner.hcloud.server: | ||
name: my-server | ||
server_type: cx11 | ||
image: debian-12 | ||
location: fsn1 | ||
volumes: | ||
- "{{ volume.hcloud_volume.id }}" | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters