Skip to content

Commit

Permalink
Add last-login annotation (#1061)
Browse files Browse the repository at this point in the history
* Add last-login annotation

* Update last-login

* Remove lookup and use now() function
  • Loading branch information
marcosmamorim authored Apr 6, 2023
1 parent 7e7ad22 commit d5ed51f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions playbooks/service-provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,23 @@
metadata:
labels:
demo.redhat.com/cfme: "true"
annotations:
demo.redhat.com/last-login: "{{ now(true, '%FT%TZ') }}"
name: "{{ cloudforms_username }}"
register: r_user_created

- name: Update last-login annotation {{ cloudforms_username }}
when: r_user.resources | length > 0
k8s:
apiVersion: user.openshift.io/v1
kind: User
kubeconfig: "{{ kubeconfig }}"
name: "{{ cloudforms_username }}"
definition:
metadata:
annotations:
demo.redhat.com/last-login: "{{ now(true, '%FT%TZ') }}"

- name: Wait for namespace {{ user_namespace }} creation
k8s_info:
kubeconfig: "{{ kubeconfig }}"
Expand Down

0 comments on commit d5ed51f

Please sign in to comment.