GCP+Ansible: how to run a playbook with user account

No. Ansible google.cloud credentials must be service accounts.

Refer to the Ansible GCE Guide. auth_kind only changes how this service account is looked up:

  • serviceaccount Use the account from service_account_file or service_account_contents. This one is possibly the easiest to use.
  • machineaccount Use the service account associated with the GCP instance running Ansible.
  • application Use application default credentials associated with the APIs provided by the scopes parameter.

Automation accounts should not be end user accounts. Removes the temptation to do something interactively as the automation user. API key style creds are strong, unlike garbage human passwords.

Creating an service account is easy. The hard part was validating the roles...