Add to k8s_raw docs re: vault-encrypted files (#47328)

* Add to k8s_raw docs re: vault-encrypted files

I didn't read the examples far enough and maybe would not have tried all the examples so I ended up creating https://github.com/ansible/ansible/issues/47259 and learned that definition key with lookup works well and we agreed the docs should say something. :)

+label: docsite_pr

* Add note about ansible vault-encrypted files to src: param

* Remove trailing whitespace

* Make changes from feedback

* Make feedback changes
pull/47723/head
Jasmine Hegman 6 years ago committed by Will Thames
parent d5d18a995a
commit 303fa6b478

@ -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') }}"

@ -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.
'''

Loading…
Cancel
Save