|
@@ -0,0 +1,28 @@
|
|
|
|
+---
|
|
|
|
+# Applies infra labels to key projects.
|
|
|
|
+#
|
|
|
|
+# Required variables:
|
|
|
|
+#
|
|
|
|
+# namespace_labels a dictionary of namespace names to label, each one
|
|
|
|
+# containing a dictionary of label key-value pairs
|
|
|
|
+#
|
|
|
|
+# Optional variables:
|
|
|
|
+#
|
|
|
|
+# kubeadmin_config the administrator kubeconfig file (tmp/kubeconfig-ocp4)
|
|
|
|
+#
|
|
|
|
+- name: Iterate over all the namespaces in the namespace_labels variable
|
|
|
|
+ kubernetes.core.k8s:
|
|
|
|
+ kubeconfig: "{{ kubeadmin_config }}"
|
|
|
|
+ validate_certs: no
|
|
|
|
+ api_version: v1
|
|
|
|
+ kind: namespace
|
|
|
|
+ name: "{{ namespace }}"
|
|
|
|
+ template: templates/namespace-patch.yml
|
|
|
|
+ loop: "{{ namespace_labels.keys() }}"
|
|
|
|
+ loop_control:
|
|
|
|
+ loop_var: namespace
|
|
|
|
+ label: "{{ namespace }}"
|
|
|
|
+ when:
|
|
|
|
+ - namespace_labels is defined
|
|
|
|
+ - namespace_labels.keys() | length > 0
|
|
|
|
+...
|