community.digitalocean.digital_ocean_kubernetes_info module – Returns information about an existing DigitalOcean Kubernetes cluster
Note
This module is part of the community.digitalocean collection (version 1.24.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.digitalocean
.
To use it in a playbook, specify: community.digitalocean.digital_ocean_kubernetes_info
.
New in community.digitalocean 1.3.0
Synopsis
Returns information about an existing DigitalOcean Kubernetes cluster.
Parameters
Parameter |
Comments |
---|---|
A human-readable name for a Kubernetes cluster. |
|
DigitalOcean OAuth token; can be specified in |
|
Controls whether or not to return the Choices:
|
Examples
- name: Get information about an existing DigitalOcean Kubernetes cluster
community.digitalocean.digital_ocean_kubernetes_info:
oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
name: hacktoberfest
return_kubeconfig: true
register: my_cluster
- ansible.builtin.debug:
msg: "Cluster name is {{ my_cluster.data.name }}, ID is {{ my_cluster.data.id }}"
- ansible.builtin.debug:
msg: "Cluster kubeconfig is {{ my_cluster.data.kubeconfig }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A DigitalOcean Kubernetes cluster (and optional Returned: changed Sample: |