kubernetes / kubernetes.core / 3.0.1 / lookup / kustomize Build a set of kubernetes resources using a 'kustomization.yaml' file. | "added in version" 2.2.0 of kubernetes.core" Authors: Aubin Bikouo (@abikouo)kubernetes.core.kustomize (3.0.1) — lookup
Install with ansible-galaxy collection install kubernetes.core:==3.0.1
collections: - name: kubernetes.core version: 3.0.1
Uses the kustomize or the kubectl tool.
Return the result of C(kustomize build) or C(kubectl kustomize).
- name: Run lookup using kustomize set_fact: resources: "{{ lookup('kubernetes.core.kustomize', binary_path='/path/to/kustomize') }}"
- name: Run lookup using kubectl kustomize set_fact: resources: "{{ lookup('kubernetes.core.kustomize', binary_path='/path/to/kubectl') }}"
- name: Create kubernetes resources for lookup output k8s: definition: "{{ lookup('kubernetes.core.kustomize', dir='/path/to/kustomization') }}"
dir: default: . description: - The directory path containing 'kustomization.yaml', or a git repository URL with a path suffix specifying same with respect to the repository root. - If omitted, '.' is assumed. opt_dirs: description: - An optional list of directories to search for the executable in addition to PATH. binary_path: description: - The path of a kustomize or kubectl binary to use.
_list: description: - YAML string for the object definitions returned from the tool execution. sample: apiVersion: v1 data: key1: val1 kind: ConfigMap metadata: name: my-config-map namespace: default type: str