Compute.googleapis.com not enabled error while using gcp_compute plugin

I am trying to use gcp_compute plugin to execute playbook but I am updating the list of project id’s here at run time dynamically. But while running (ansible-inventory --list -i $ANSIBLE_DIRECTORY/envs/$ENVIRONMENT/$ANSIBLE_PLATFORM/inventory.gcp.yml) getting following error “compute.googleapis.com not enabled”. But I want to skip the particular project from the list if that api is not enabled rather then error. How I can achieve?

inventory.gcp.yaml:

plugin: gcp_compute
projects:

  • test-a
  • test-b

auth_kind: application
hostnames:

  • name
    filters:
  • labels.environment_name = “development”