Add k8s module_defaults group and document (#51093)
It makes sense to use module_defaults with k8s modules, and thus have a k8s module_defaults group.
This commit is contained in:
parent
8c703da46a
commit
23b5599244
3 changed files with 27 additions and 3 deletions
3
changelogs/fragments/k8s_module_defaults_group.yml
Normal file
3
changelogs/fragments/k8s_module_defaults_group.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
minor_changes:
|
||||
- A k8s module defaults group has now been added to reduce the amount of parameters required for multiple k8s tasks.
|
||||
This group contains all non-deprecated kubernetes modules - `k8s`, `k8s_facts`, `k8s_scale` and `k8s_service`.
|
|
@ -78,13 +78,26 @@ Setting a default AWS region for specific EC2-related modules::
|
|||
.. _module_defaults_groups:
|
||||
|
||||
Module defaults groups
|
||||
``````````````````````
|
||||
----------------------
|
||||
|
||||
.. versionadded:: 2.7
|
||||
|
||||
Ansible 2.7 adds a preview-status feature to group together modules that share common sets of parameters. This makes
|
||||
it easier to author playbooks making heavy use of API-based modules such as cloud modules. By default Ansible ships
|
||||
with groups for AWS and GCP modules that share parameters.
|
||||
it easier to author playbooks making heavy use of API-based modules such as cloud modules.
|
||||
|
||||
+-------+---------------------------+-----------------+
|
||||
| Group | Purpose | Ansible Version |
|
||||
+=======+===========================+=================+
|
||||
| aws | Amazon Web Services | 2.7 |
|
||||
+-------+---------------------------+-----------------+
|
||||
| azure | Azure | 2.7 |
|
||||
+-------+---------------------------+-----------------+
|
||||
| gcp | Google Cloud Platform | 2.7 |
|
||||
+-------+---------------------------+-----------------+
|
||||
| k8s | Kubernetes | 2.8 |
|
||||
+-------+---------------------------+-----------------+
|
||||
|
||||
Use the groups with `module_defaults` by prefixing the group name with `group/` - e.g. `group/aws`
|
||||
|
||||
In a playbook, you can set module defaults for whole groups of modules, such as setting a common AWS region.
|
||||
|
||||
|
|
|
@ -594,3 +594,11 @@ groupings:
|
|||
- azure
|
||||
azure_rm_webapp:
|
||||
- azure
|
||||
k8s:
|
||||
- k8s
|
||||
k8s_facts:
|
||||
- k8s
|
||||
k8s_service:
|
||||
- k8s
|
||||
k8s_scale:
|
||||
- k8s
|
||||
|
|
Loading…
Reference in a new issue