Create an event when pvc is not set to alert the user

This commit is contained in:
Christian M. Adams
2021-03-31 15:21:42 -04:00
parent 6bc149bae2
commit 80c8d87f71
8 changed files with 117 additions and 30 deletions

View File

@@ -0,0 +1,16 @@
---
- name: Set apiVersion and kind variables
set_fact:
api_version: '{{ hostvars["localhost"]["inventory_file"].split("/")[4:6] | join("/") }}'
kind: '{{ hostvars["localhost"]["inventory_file"].split("/")[6] }}'
- name: Determine the timestamp
set_fact:
now: '{{ lookup("pipe", "date +%FT%TZ") }}'
- name: Emit ocp event with error
community.kubernetes.k8s:
kind: Event
namespace: "{{ meta.namespace }}"
template: "event.yml.j2"