---
- name: create registry serviceaccount
  oc_serviceaccount:
    state: present
    name: "{{ openshift_hosted_registry_serviceaccount }}"
    namespace: "{{ openshift_hosted_registry_namespace }}"
  changed_when: no

- name: grant the system:registry role to registry serviceaccount
  oc_adm_policy_user:
    state: present
    namespace: "{{ openshift_hosted_registry_namespace }}"
    resource_kind: cluster-role
    resource_name: system:registry
    user: "system:serviceaccount:{{ openshift_hosted_registry_namespace }}:{{ openshift_hosted_registry_serviceaccount }}"

Check and fix registry serviceaccount
Check and fix registry serviceaccount

Signed-off-by: Gladkov Alexey <c3a6b77263aa5673e69e156017f6482a5bd90458@redhat.com>
