diff --git a/lib/ansible/modules/clustering/k8s/k8s.py b/lib/ansible/modules/clustering/k8s/k8s.py index 999d8ba0a1..6c4616a27f 100644 --- a/lib/ansible/modules/clustering/k8s/k8s.py +++ b/lib/ansible/modules/clustering/k8s/k8s.py @@ -28,7 +28,7 @@ author: description: - Use the OpenShift Python client to perform CRUD operations on K8s objects. - Pass the object definition from a source file or inline. See examples for reading - files and using Jinja templates. + files and using Jinja templates or vault-encrypted files. - Access to the full range of K8s APIs. - Use the M(k8s_facts) module to obtain a list of items about an object of type C(kind) - Authenticate using either a config file, certificates, password or token. @@ -116,7 +116,9 @@ EXAMPLES = ''' state: present src: /testing/deployment.yml -- name: Read definition file from the Ansible controller file system +- name: >- + Read definition file from the Ansible controller file system. + If the definition file has been encrypted with Ansible Vault it will automatically be decrypted. k8s: state: present definition: "{{ lookup('file', '/testing/deployment.yml') }}" diff --git a/lib/ansible/utils/module_docs_fragments/k8s_resource_options.py b/lib/ansible/utils/module_docs_fragments/k8s_resource_options.py index 833e6dd18f..25adb32db5 100644 --- a/lib/ansible/utils/module_docs_fragments/k8s_resource_options.py +++ b/lib/ansible/utils/module_docs_fragments/k8s_resource_options.py @@ -35,7 +35,7 @@ options: - "Provide a path to a file containing a valid YAML definition of an object or objects to be created or updated. Mutually exclusive with I(resource_definition). NOTE: I(kind), I(api_version), I(name), and I(namespace) will be overwritten by corresponding values found in the configuration read in from the I(src) file." - - Reads from the local file system. To read from the Ansible controller's file system, use the file lookup + - Reads from the local file system. To read from the Ansible controller's file system, including vaulted files, use the file lookup plugin or template lookup plugin, combined with the from_yaml filter, and pass the result to I(resource_definition). See Examples below. '''