The following task fails with the message WARNING: This command is using service account impersonation.
. Even though the command runs with error. I suppose I could add ignore_errors
to the task, but I would like the task to fail, if the command fails. Any ideas how to get the task to not fail when this warning is present while permitting it to fail, if the command fails?
- name: 'Get all user managed GCP service account keys'
ansible.utils.cli_parse:
command: >
gcloud iam service-accounts keys list
--iam-account={{ service_account.name }}
--format=json
--filter="keyType=USER_MANAGED"
--sort-by=~validAfterTime
parser:
name: ansible.utils.json
set_fact: _current_sa_keys