├── .gitignore ├── roles ├── gcloud │ ├── vars │ │ └── main.yml │ ├── tasks │ │ ├── package │ │ │ ├── main.yml │ │ │ ├── debian.yml │ │ │ └── redhat.yml │ │ ├── main.yml │ │ └── archive │ │ │ ├── command_completion.yml │ │ │ ├── main.yml │ │ │ └── archive_install.yml │ ├── meta │ │ └── main.yml │ ├── LICENSE │ └── defaults │ │ └── main.yml ├── gcp_http_lb │ ├── tests │ │ ├── inventory │ │ └── test.yml │ ├── vars │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ ├── README.md │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml └── gcsfuse │ ├── vars │ └── main.yml │ ├── defaults │ └── main.yml │ ├── handlers │ └── main.yml │ ├── tasks │ ├── main.yml │ └── debian.yml │ └── README.md ├── requirements.txt ├── tests └── integration │ └── targets │ ├── gcp_iam_role │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_sql_user │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_tpu_node │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_bigquery_table │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_disk │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_image │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_route │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_router │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_kms_crypto_key │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_kms_key_ring │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_logging_metric │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_mlengine_model │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_pubsub_topic │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_redis_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_sql_database │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_sql_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_sql_ssl_cert │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_storage_bucket │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_storage_object │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml │ ├── gcp_bigquery_dataset │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_bigtable_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_cloudbuild_trigger │ ├── meta │ │ └── main.yml │ ├── aliases │ └── defaults │ │ └── main.yml │ ├── gcp_cloudscheduler_job │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_cloudtasks_queue │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_address │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_autoscaler │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_firewall │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml │ ├── gcp_compute_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_network │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_node_group │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_disk │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_reservation │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_snapshot │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_ssl_policy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_subnetwork │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_pool │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_url_map │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_vpn_tunnel │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_container_cluster │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_container_node_pool │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_dns_managed_zone │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_filestore_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_iam_service_account │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_mlengine_version │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_pubsub_subscription │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_spanner_database │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_spanner_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_appengine_firewall_rule │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_backend_bucket │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_backend_service │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_forwarding_rule │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_global_address │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_health_check │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_instance_group │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_node_template │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_url_map │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_resource_policy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_ssl_certificate │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_instance │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_ssl_proxy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_tcp_proxy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_dns_resource_record_set │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_iam_service_account_key │ ├── meta │ │ └── main.yml │ ├── aliases │ └── defaults │ │ └── main.yml │ ├── gcp_resourcemanager_project │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_runtimeconfig_config │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_runtimeconfig_variable │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_serviceusage_service │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_sourcerepo_repository │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_cloudfunctions_cloud_function │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_external_vpn_gateway │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_http_health_check │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_https_health_check │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_instance_template │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_autoscaler │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_health_check │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_http_proxy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_https_proxy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_target_vpn_gateway │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_storage_bucket_access_control │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_storage_default_object_acl │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ ├── main.yml │ │ └── autogen.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_global_forwarding_rule │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_instance_group_manager │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_interconnect_attachment │ ├── meta │ │ └── main.yml │ ├── aliases │ └── defaults │ │ └── main.yml │ ├── gcp_compute_managed_ssl_certificate │ ├── meta │ │ └── main.yml │ ├── aliases │ └── defaults │ │ └── main.yml │ ├── gcp_compute_network_endpoint_group │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_backend_service │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_target_http_proxy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ ├── gcp_compute_region_target_https_proxy │ ├── meta │ │ └── main.yml │ ├── aliases │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml │ └── gcp_compute_region_instance_group_manager │ ├── meta │ └── main.yml │ ├── aliases │ ├── tasks │ └── main.yml │ └── defaults │ └── main.yml ├── molecule ├── gcloud │ ├── files │ │ └── override.conf │ ├── verify.yml │ ├── package_playbook.yml │ ├── archive_playbook.yml │ ├── molecule.yml │ ├── tests │ │ └── test_default.py │ ├── converge.yml │ └── Dockerfile.j2 └── gcsfuse │ ├── files │ └── override.conf │ ├── verify.yml │ ├── molecule.yml │ ├── tests │ └── test_default.py │ ├── converge.yml │ └── Dockerfile.j2 ├── changelogs └── fragments │ └── 0001_disk.yml ├── .gitmodules ├── .ansible-lint ├── .yamllint ├── .github └── workflows │ ├── pythonpublish.yml │ ├── automationhub.yml │ ├── integration.yml │ ├── gcsfuse.yml │ └── gcloud.yml ├── plugins ├── README.md ├── doc_fragments │ └── gcp.py └── filter │ └── gcp_kms_filters.py └── galaxy.yml /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /roles/gcloud/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | google-auth 3 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_role/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_user/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_tpu_node/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_table/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_disk/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_image/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_route/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_router/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_crypto_key/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_key_ring/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_logging_metric/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_model/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_topic/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_redis_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_database/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_ssl_cert/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_object/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_dataset/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigtable_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudbuild_trigger/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudscheduler_job/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudtasks_queue/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_address/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_autoscaler/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_firewall/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_group/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_disk/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_reservation/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_snapshot/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_policy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_subnetwork/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_pool/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_url_map/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_vpn_tunnel/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_cluster/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_node_pool/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_managed_zone/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_filestore_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_version/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_subscription/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_database/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /molecule/gcloud/files/override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStartPre= 3 | -------------------------------------------------------------------------------- /molecule/gcsfuse/files/override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStartPre= 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_appengine_firewall_rule/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_bucket/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_service/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_forwarding_rule/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_address/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_health_check/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_template/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_url_map/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_resource_policy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_certificate/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_ssl_proxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_tcp_proxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_resource_record_set/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account_key/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_resourcemanager_project/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_config/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_variable/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_serviceusage_service/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sourcerepo_repository/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudfunctions_cloud_function/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_external_vpn_gateway/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_http_health_check/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_https_health_check/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_template/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_autoscaler/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_health_check/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_http_proxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_https_proxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_vpn_gateway/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket_access_control/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_default_object_acl/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roles/gcsfuse/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for google.cloud.gcsfuse 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_forwarding_rule/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group_manager/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_interconnect_attachment/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_managed_ssl_certificate/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network_endpoint_group/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_backend_service/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_http_proxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_https_proxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_role/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_user/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_tpu_node/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_table/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_address/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_disk/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_image/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_instance_group_manager/meta/main.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_route/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_router/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_url_map/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_crypto_key/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_key_ring/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_logging_metric/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_model/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_topic/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_redis_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_database/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_ssl_cert/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_object/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /roles/gcsfuse/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for google.cloud.gcsfuse 3 | -------------------------------------------------------------------------------- /roles/gcsfuse/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for google.cloud.gcsfuse 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_dataset/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigtable_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudbuild_trigger/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudscheduler_job/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudtasks_queue/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_autoscaler/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_firewall/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_health_check/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_group/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_disk/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_reservation/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_snapshot/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_policy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_subnetwork/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_pool/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_vpn_tunnel/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_cluster/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_node_pool/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_managed_zone/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_filestore_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_version/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_subscription/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_config/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_serviceusage_service/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_database/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_appengine_firewall_rule/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_bucket/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_service/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_forwarding_rule/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_address/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_http_health_check/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_template/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_template/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_autoscaler/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_url_map/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_resource_policy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_certificate/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_http_proxy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_instance/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_ssl_proxy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_tcp_proxy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_resource_record_set/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account_key/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_resourcemanager_project/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_variable/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sourcerepo_repository/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudfunctions_cloud_function/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_disk/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_external_vpn_gateway/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_forwarding_rule/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_https_health_check/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group_manager/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network_endpoint_group/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_backend_service/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_health_check/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_https_proxy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_vpn_gateway/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_role/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_key_ring/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_topic/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_database/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_ssl_cert/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_user/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket_access_control/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_default_object_acl/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_tpu_node/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_dataset/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_table/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigtable_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudtasks_queue/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_address/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_image/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_interconnect_attachment/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_managed_ssl_certificate/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_http_proxy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_https_proxy/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_route/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_router/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_snapshot/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_url_map/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_cluster/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_managed_zone/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_crypto_key/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_logging_metric/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_model/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_version/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_redis_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_database/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudscheduler_job/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_autoscaler/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_bucket/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_address/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_health_check/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_group/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_template/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_disk/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_instance_group_manager/aliases: -------------------------------------------------------------------------------- 1 | cloud/gcp 2 | unsupported 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_url_map/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_reservation/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_policy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_subnetwork/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_pool/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_node_pool/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_filestore_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_role/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_subscription/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_config/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_variable/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_serviceusage_service/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sourcerepo_repository/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_user/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_tpu_node/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_appengine_firewall_rule/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_table/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_service/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_disk/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_http_health_check/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_https_health_check/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_image/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_template/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_autoscaler/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_health_check/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_resource_policy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_route/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_router/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_resource_record_set/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_crypto_key/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_key_ring/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_logging_metric/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_model/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_topic/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_redis_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_resourcemanager_project/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_database/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_ssl_cert/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_default_object_acl/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_object/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /changelogs/fragments/0001_disk.yml: -------------------------------------------------------------------------------- 1 | bugfixes: 2 | - Disk has been fixed to send the sourceSnapshot parameter. 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_dataset/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigtable_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudscheduler_job/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudtasks_queue/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_address/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_autoscaler/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_firewall/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network_endpoint_group/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_group/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_backend_service/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_disk/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_reservation/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_snapshot/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_policy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_subnetwork/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_pool/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_url_map/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_vpn_tunnel/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_cluster/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_container_node_pool/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_managed_zone/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_filestore_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_version/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_subscription/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_database/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_spanner_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket_access_control/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | remote_user: root 4 | roles: 5 | - gcp_http_lb 6 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_appengine_firewall_rule/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_bucket/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_backend_service/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_forwarding_rule/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_address/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_health_check/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_template/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: autogen.yml 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_url_map/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_resource_policy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_ssl_certificate/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_ssl_proxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_tcp_proxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_resource_record_set/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_resourcemanager_project/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_config/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_variable/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_serviceusage_service/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sourcerepo_repository/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudfunctions_cloud_function/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_external_vpn_gateway/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_http_health_check/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_https_health_check/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_template/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_autoscaler/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_health_check/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_http_proxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_https_proxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_vpn_gateway/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket_access_control/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_default_object_acl/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_forwarding_rule/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network_endpoint_group/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_backend_service/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_http_proxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_target_https_proxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudbuild_trigger/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file 3 | resource_name: '{{resource_prefix}}' 4 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_firewall/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: update.yml 3 | - include_tasks: autogen.yml 4 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_region_instance_group_manager/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | resource_name: "{{ resource_prefix }}" 3 | -------------------------------------------------------------------------------- /roles/gcsfuse/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for google.cloud.gcsfuse 3 | 4 | - include_tasks: "{{ ansible_os_family|lower }}.yml" 5 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_iam_service_account_key/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file 3 | resource_name: '{{resource_prefix}}' 4 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_interconnect_attachment/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file 3 | resource_name: '{{resource_prefix}}' 4 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_managed_ssl_certificate/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file 3 | resource_name: '{{resource_prefix}}' 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "roles/google-cloud-ops-agents-ansible"] 2 | path = roles/google-cloud-ops-agents-ansible 3 | url = git@github.com:GoogleCloudPlatform/google-cloud-ops-agents-ansible.git 4 | -------------------------------------------------------------------------------- /roles/gcloud/tasks/package/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for gcloud 3 | 4 | - name: gcloud | Start package installation for specific distro 5 | include_tasks: "{{ ansible_os_family|lower }}.yml" 6 | -------------------------------------------------------------------------------- /.ansible-lint: -------------------------------------------------------------------------------- 1 | --- 2 | parseable: true 3 | skip_list: 4 | - ANSIBLE0010 5 | use_default_rules: true 6 | verbosity: 1 7 | exclude_paths: 8 | - ./roles/gcp_http_lb/ 9 | - ./tests/ 10 | - ./plugins 11 | -------------------------------------------------------------------------------- /molecule/gcloud/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /molecule/gcsfuse/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /molecule/gcloud/package_playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: all 4 | pre_tasks: 5 | - name: Install gpg for apt_key 6 | apt: 7 | name: gnupg 8 | update_cache: true 9 | when: ansible_os_family|lower == "debian" 10 | roles: 11 | - role: google.cloud.gcloud 12 | gcloud_additional_components: 13 | - cloud-build-local 14 | -------------------------------------------------------------------------------- /molecule/gcloud/archive_playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: all 4 | pre_tasks: 5 | - name: Install gpg for apt_key 6 | apt: 7 | name: gnupg 8 | update_cache: true 9 | when: ansible_os_family|lower == "debian" 10 | roles: 11 | - role: google.cloud.gcloud 12 | gcloud_install_type: archive 13 | gcloud_command_completion: true 14 | gcloud_additional_components: 15 | - cloud-build-local 16 | -------------------------------------------------------------------------------- /roles/gcloud/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | role_name: gcloud 4 | author: Eric Anderson 5 | description: Ansible role to install google-cloud-sdk 6 | company: Avi Networks 7 | license: MIT 8 | min_ansible_version: 2.4 9 | platforms: 10 | - name: Ubuntu 11 | versions: 12 | - precise 13 | - trusty 14 | - xenial 15 | - bionic 16 | galaxy_tags: 17 | - gcloud 18 | - google 19 | - cloud 20 | - sdk 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /molecule/gcloud/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | lint: | 7 | set -e 8 | yamllint . 9 | ansible-lint 10 | platforms: 11 | - name: instance 12 | image: ${MOLECULE_DISTRO:-ubuntu:xenial} 13 | privileged: true 14 | command: ${MOLECULE_COMMAND:-"sleep infinity"} 15 | volumes: 16 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 17 | provisioner: 18 | name: ansible 19 | playbooks: 20 | converge: ${MOLECULE_PLAYBOOK:-converge.yml} 21 | -------------------------------------------------------------------------------- /molecule/gcsfuse/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | lint: | 7 | set -e 8 | yamllint . 9 | ansible-lint 10 | platforms: 11 | - name: instance 12 | image: ${MOLECULE_DISTRO:-ubuntu:xenial} 13 | privileged: true 14 | command: ${MOLECULE_COMMAND:-"sleep infinity"} 15 | volumes: 16 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 17 | provisioner: 18 | name: ansible 19 | playbooks: 20 | converge: ${MOLECULE_PLAYBOOK:-converge.yml} 21 | -------------------------------------------------------------------------------- /roles/gcloud/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: gcloud | Load Distro and OS specific variables 4 | include_vars: "{{ lookup('first_found', params) }}" 5 | vars: 6 | params: 7 | files: 8 | - "os/{{ ansible_distribution|lower }}.yml" 9 | - "os/{{ ansible_os_family|lower }}.yml" 10 | - main.yml 11 | paths: 12 | - 'vars' 13 | 14 | - name: gcloud | Install the google-cloud-sdk from {{ gcloud_install_type }} 15 | include_tasks: "{{ gcloud_install_type }}/main.yml" 16 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for gcp-http-lb 3 | vars: 4 | # The backend this LB will be supporting. This will typically be a Instance Group: 5 | # example: projects/sample-project/zones/us-central1-c/instanceGroups/sample-instance-group 6 | gcp_http_lb_backend: your-backend 7 | # The name of your GCP project 8 | gcp_project: your-project 9 | # The kind of authentication you will use (serviceaccount is recommended) 10 | auth_kind: serviceaccount 11 | # The path to your service account file (if using the serviceaccount auth kind) 12 | service_account_file: path-to-service-account-file 13 | -------------------------------------------------------------------------------- /molecule/gcloud/tests/test_default.py: -------------------------------------------------------------------------------- 1 | from __future__ import (absolute_import, division, print_function) 2 | import os 3 | import testinfra.utils.ansible_runner 4 | 5 | __metaclass__ = type 6 | 7 | testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( 8 | os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') 9 | 10 | 11 | def test_service(host): 12 | service = host.service('docker') 13 | 14 | assert service.is_running 15 | assert service.is_enabled 16 | 17 | 18 | def test_hosts_file(host): 19 | f = host.file('/etc/hosts') 20 | 21 | assert f.exists 22 | assert f.user == 'root' 23 | assert f.group == 'root' 24 | -------------------------------------------------------------------------------- /molecule/gcsfuse/tests/test_default.py: -------------------------------------------------------------------------------- 1 | from __future__ import (absolute_import, division, print_function) 2 | import os 3 | import testinfra.utils.ansible_runner 4 | 5 | __metaclass__ = type 6 | 7 | testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( 8 | os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') 9 | 10 | 11 | def test_service(host): 12 | service = host.service('docker') 13 | 14 | assert service.is_running 15 | assert service.is_enabled 16 | 17 | 18 | def test_hosts_file(host): 19 | f = host.file('/etc/hosts') 20 | 21 | assert f.exists 22 | assert f.user == 'root' 23 | assert f.group == 'root' 24 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for gcp-http-lb 3 | gcp_http_lb_state: present 4 | gcp_http_lb_cdn: true 5 | gcp_http_lb_name_prefix: 'gcp' 6 | 7 | # Name schemes for resources being created 8 | gcp_http_lb_globaladdress: "{{gcp_lb_name_prefix}}-globaladdress" 9 | gcp_http_lb_instancegroup: "{{gcp_lb_name_prefix}}-instancegroup" 10 | gcp_http_lb_healthcheck: "{{gcp_lb_name_prefix}}-healthcheck" 11 | gcp_http_lb_backendservice: "{{gcp_lb_name_prefix}}-backendservice" 12 | gcp_http_lb_urlmap: "{{gcp_lb_name_prefix}}-urlmap" 13 | gcp_http_lb_httpproxy: "{{gcp_lb_name_prefix}}-httpproxy" 14 | gcp_http_lb_forwardingrule: "{{gcp_lb_name_prefix}}-forwardingrule" 15 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | # Based on ansible-lint config 3 | extends: default 4 | 5 | rules: 6 | braces: 7 | max-spaces-inside: 1 8 | level: error 9 | brackets: 10 | max-spaces-inside: 1 11 | level: error 12 | colons: 13 | max-spaces-after: -1 14 | level: error 15 | commas: 16 | max-spaces-after: -1 17 | level: error 18 | comments: disable 19 | comments-indentation: disable 20 | document-start: disable 21 | empty-lines: 22 | max: 3 23 | level: error 24 | hyphens: 25 | level: error 26 | indentation: disable 27 | key-duplicates: enable 28 | line-length: disable 29 | new-line-at-end-of-file: disable 30 | new-lines: 31 | type: unix 32 | trailing-spaces: disable 33 | truthy: disable 34 | -------------------------------------------------------------------------------- /.github/workflows/pythonpublish.yml: -------------------------------------------------------------------------------- 1 | name: Upload release to Galaxy 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: Set up Python 13 | uses: actions/setup-python@v1 14 | with: 15 | python-version: '3.x' 16 | - name: Install dependencies 17 | run: | 18 | python -m pip install --upgrade pip 19 | pip install ansible 20 | - name: Build and publish 21 | env: 22 | ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }} 23 | run: | 24 | ansible-galaxy collection build . 25 | ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY 26 | -------------------------------------------------------------------------------- /roles/gcsfuse/tasks/debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: gcsfuse | Ensure gpg is installed 3 | apt: name=gnupg 4 | register: task_result 5 | until: task_result is success 6 | retries: 10 7 | delay: 2 8 | 9 | - name: gcsfuse | Add an apt signing key 10 | apt_key: 11 | url: https://packages.cloud.google.com/apt/doc/apt-key.gpg 12 | state: present 13 | 14 | - name: gcsfuse | Add the apt repository 15 | apt_repository: 16 | repo: deb http://packages.cloud.google.com/apt gcsfuse-{{ ansible_distribution_release }} main 17 | state: present 18 | filename: gcsfuse 19 | 20 | - name: gcsfuse | Install gcsfuse 21 | apt: name=gcsfuse update_cache=yes 22 | register: task_result 23 | until: task_result is success 24 | retries: 10 25 | delay: 2 26 | -------------------------------------------------------------------------------- /molecule/gcloud/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: all 4 | pre_tasks: 5 | - name: Update package cache 6 | package: update_cache=yes 7 | changed_when: false 8 | register: task_result 9 | until: task_result is success 10 | retries: 10 11 | delay: 2 12 | - name: create containerd folder 13 | file: 14 | path: /etc/systemd/system/containerd.service.d 15 | state: directory 16 | when: ansible_service_mgr == "systemd" 17 | - name: override file for containerd 18 | copy: 19 | src: files/override.conf 20 | dest: /etc/systemd/system/containerd.service.d/override.conf 21 | when: ansible_service_mgr == "systemd" 22 | roles: 23 | - role: google.cloud.gcloud 24 | -------------------------------------------------------------------------------- /molecule/gcsfuse/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: all 4 | pre_tasks: 5 | - name: Using apt update the packages 6 | apt: 7 | update_cache: yes 8 | when: ansible_os_family == "Debian" 9 | - name: Using apt update the packages 10 | yum: 11 | update_cache: yes 12 | when: ansible_os_family == "RedHat" 13 | - name: create containerd folder 14 | file: 15 | path: /etc/systemd/system/containerd.service.d 16 | state: directory 17 | when: ansible_service_mgr == "systemd" 18 | - name: override file for containerd 19 | copy: 20 | src: files/override.conf 21 | dest: /etc/systemd/system/containerd.service.d/override.conf 22 | when: ansible_service_mgr == "systemd" 23 | roles: 24 | - role: google.cloud.gcsfuse 25 | -------------------------------------------------------------------------------- /.github/workflows/automationhub.yml: -------------------------------------------------------------------------------- 1 | name: Upload release to Automation Hub 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: Set up Python 13 | uses: actions/setup-python@v1 14 | with: 15 | python-version: '3.x' 16 | - name: Install dependencies 17 | run: | 18 | python -m pip install --upgrade pip 19 | pip install ansible 20 | - name: Build and publish 21 | env: 22 | ANSIBLE_AUTOMATION_HUB_API_KEY: ${{ secrets.ANSIBLE_AUTOMATION_HUB_API_KEY }} 23 | run: | 24 | ansible-galaxy collection build . 25 | ansible-galaxy collection publish *.tar.gz --api-key=$ANSIBLE_GALAXY_API_KEY -s=https://cloud.redhat.com/api/automation-hub/ 26 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/README.md: -------------------------------------------------------------------------------- 1 | gcp_http_lb 2 | ========= 3 | 4 | This role helps you set up a Google Cloud Load Balancer. 5 | 6 | Requirements 7 | ------------ 8 | 9 | - requests Python library 10 | - googleauth Python library 11 | 12 | Role Variables 13 | -------------- 14 | 15 | ``` 16 | gcp_http_lb_backend: the selflink for the backend that this load balancer will be supporting 17 | gcp_project: the name of your gcp project 18 | service_account_file: the path to your service account JSON file 19 | ``` 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | - hosts: local 25 | vars: 26 | gcp_http_lb_backend: projects/project/zones/us-central1-c/instanceGroups/my-instance-group 27 | roles: 28 | - role: gcp_http_lb 29 | 30 | License 31 | ------- 32 | 33 | GPLv3 34 | 35 | Author Information 36 | ------------------ 37 | 38 | Google Inc. 39 | -------------------------------------------------------------------------------- /roles/gcsfuse/README.md: -------------------------------------------------------------------------------- 1 | # gcsfuse 2 | 3 | This role configures the gcsfuse repository, and installs gcsfuse on your host. 4 | gcsfuse is a user-space file system for working with 5 | [Google Cloud Storage](https://cloud.google.com/storage/). 6 | 7 | **Important:** You should run gcsfuse as the user who will be using the file 8 | system, not as the root user. Do not use sudo either. 9 | 10 | After installed you can use it to mount by command: 11 | `gcsfuse bucket-name /mount/point` 12 | 13 | ## Example Playbook 14 | 15 | Including an example of how to use your role (for instance, with variables 16 | passed in as parameters) is always nice for users too: 17 | 18 | ```yaml 19 | - hosts: servers 20 | tasks: 21 | - include_role: 22 | name: google.cloud.gcsfuse 23 | ``` 24 | 25 | ## License 26 | 27 | GPLv3 28 | 29 | ## Author Information 30 | 31 | [ericsysmin](https://ericsysmin.com) 32 | -------------------------------------------------------------------------------- /roles/gcloud/tasks/package/debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks that install gcloud on debian 3 | - name: gcloud | Debian | Add an Apt signing key, uses whichever key is at the URL 4 | apt_key: 5 | url: "{{ gcloud_apt_key }}" 6 | state: present 7 | 8 | - name: gcloud | Debian | Add the gcloud repository 9 | apt_repository: 10 | repo: "deb {{ gcloud_apt_url }} {{ gcloud_apt_repo }} main" 11 | state: present 12 | filename: google-cloud-sdk 13 | 14 | - name: gcloud | Debian | Install the google-cloud-sdk package 15 | apt: name=google-cloud-sdk update_cache=yes 16 | register: task_result 17 | until: task_result is success 18 | retries: 10 19 | delay: 2 20 | 21 | - name: gcloud | Debian | Install the google-cloud-sdk additional components 22 | apt: name=google-cloud-sdk-{{ item }} update_cache=yes 23 | register: task_result 24 | until: task_result is success 25 | retries: 10 26 | delay: 2 27 | loop: "{{ gcloud_additional_components }}" 28 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # Collections Plugins Directory 2 | 3 | This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that 4 | is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that 5 | would contain module utils and modules respectively. 6 | 7 | Here is an example directory of the majority of plugins currently supported by Ansible; 8 | 9 | ``` 10 | └── plugins 11 | ├── action 12 | ├── become 13 | ├── cache 14 | ├── callback 15 | ├── cliconf 16 | ├── connection 17 | ├── filter 18 | ├── httpapi 19 | ├── inventory 20 | ├── lookup 21 | ├── module_utils 22 | ├── modules 23 | ├── netconf 24 | ├── shell 25 | ├── strategy 26 | ├── terminal 27 | ├── test 28 | └── vars 29 | ``` 30 | 31 | A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible/devel/plugins/plugins.html). -------------------------------------------------------------------------------- /roles/gcloud/tasks/archive/command_completion.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # task file to configure bash completion for gcloud 3 | - name: gcloud | Archive | Debian | Ensure bash completion is installed 4 | apt: name=bash-completion 5 | register: task_result 6 | until: task_result is success 7 | retries: 10 8 | delay: 2 9 | when: ansible_os_family == "Debian" 10 | 11 | - name: gcloud | Archive | RedHat | Ensure bash completion is installed 12 | yum: 13 | name: 14 | - bash-completion 15 | register: task_result 16 | until: task_result is success 17 | retries: 10 18 | delay: 2 19 | when: ansible_os_family == "RedHat" 20 | 21 | - name: gcloud | Archive | Ensure bash_completion.d directory exists 22 | file: 23 | path: /etc/bash_completion.d 24 | owner: root 25 | group: root 26 | state: directory 27 | 28 | - name: gcloud | Archive | Link binaries to /usr/bin (like package install) 29 | file: 30 | src: "{{ gcloud_library_path }}/completion.bash.inc" 31 | dest: /etc/bash_completion.d/gcloud 32 | state: link 33 | -------------------------------------------------------------------------------- /roles/gcloud/tasks/package/redhat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: gcloud | RHEL | Add an Apt signing key, uses whichever key is at the URL 3 | yum_repository: 4 | name: google-cloud-sdk 5 | description: Google Cloud SDK 6 | file: google-cloud-sdk 7 | baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64 8 | enabled: yes 9 | gpgcheck: yes 10 | repo_gpgcheck: yes 11 | gpgkey: 12 | - https://packages.cloud.google.com/yum/doc/yum-key.gpg 13 | - https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg 14 | 15 | - name: gcloud | RHEL | Install the google-cloud-sdk package 16 | yum: name=google-cloud-sdk update_cache=yes 17 | register: task_result 18 | until: task_result is success 19 | retries: 10 20 | delay: 2 21 | 22 | - name: gcloud | Debian | Install the google-cloud-sdk additional components 23 | yum: name=google-cloud-sdk-{{ item }} update_cache=yes 24 | register: task_result 25 | until: task_result is success 26 | retries: 10 27 | delay: 2 28 | loop: "{{ gcloud_additional_components }}" 29 | -------------------------------------------------------------------------------- /roles/gcloud/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Eric Anderson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /roles/gcloud/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for gcloud 3 | gcloud_install_type: package 4 | 5 | # default values for gcloud apt installation 6 | gcloud_apt_key: https://packages.cloud.google.com/apt/doc/apt-key.gpg 7 | gcloud_apt_url: http://packages.cloud.google.com/apt 8 | gcloud_apt_repo: cloud-sdk-{{ ansible_distribution_release }} 9 | 10 | # default values for gcloud yum installation 11 | gcloud_yum_baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64 12 | gcloud_yum_key: https://packages.cloud.google.com/yum/doc/yum-key.gpg 13 | 14 | # default values for gcloud archive installation 15 | gcloud_version: 268.0.0 16 | gcloud_archive_name: google-cloud-sdk-{{ gcloud_version }}-linux-{{ ansible_architecture }}.tar.gz 17 | gcloud_archive_url: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/{{ gcloud_archive_name }} 18 | gcloud_archive_path: /usr/lib 19 | gcloud_library_path: "{{ gcloud_archive_path }}/google-cloud-sdk" 20 | 21 | # values if you want to use the gcloud install script 22 | gcloud_install_script: false 23 | gcloud_usage_reporting: false 24 | gcloud_profile_path: false 25 | gcloud_command_completion: false 26 | gcloud_update_path: false 27 | gcloud_override_components: [] 28 | gcloud_additional_components: [] 29 | -------------------------------------------------------------------------------- /.github/workflows/integration.yml: -------------------------------------------------------------------------------- 1 | name: Ansible Integration Test Runner 2 | 3 | on: 4 | schedule: 5 | # * is a special character in YAML so you have to quote this string 6 | - cron: '0 1 * * *' 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v1 15 | - name: Set up Python 3.7 16 | uses: actions/setup-python@v1 17 | with: 18 | python-version: 3.7 19 | - name: Install ansible and collection dependencies 20 | run: | 21 | python -m pip install --upgrade pip 22 | pip install ansible 23 | pip install -r requirements.txt 24 | - name: Build and install collection 25 | run: | 26 | ansible-galaxy collection build . 27 | ansible-galaxy collection install *.gz 28 | - name: Add service account file 29 | env: 30 | SERVICE_ACCOUNT_FILE: ${{ secrets.SERVICE_ACCOUNT_FILE }} 31 | run: | 32 | echo "$SERVICE_ACCOUNT_FILE" > /tmp/service_account.json 33 | - name: Add test template 34 | env: 35 | TEST_SETTINGS_TEMPLATE: ${{ secrets.TEST_SETTINGS_TEMPLATE }} 36 | run: | 37 | pushd ~/.ansible/collections/ansible_collections/google/cloud 38 | echo "$TEST_SETTINGS_TEMPLATE" > tests/integration/cloud-config-gcp.ini 39 | - name: Run the tests 40 | run: | 41 | pushd ~/.ansible/collections/ansible_collections/google/cloud 42 | ansible-test integration -v --allow-unsupported --continue-on-error $(find tests/integration/targets -name "gcp*" -type d -printf "%P ") 43 | -------------------------------------------------------------------------------- /.github/workflows/gcsfuse.yml: -------------------------------------------------------------------------------- 1 | name: "google.cloud.gcsfuse" 2 | on: 3 | push: 4 | paths: 5 | - roles/gcsfuse/** 6 | - .github/workflows/gcsfuse.yml 7 | pull_request: 8 | paths: 9 | - roles/gcsfuse/** 10 | - .github/workflows/gcsfuse.yml 11 | jobs: 12 | gcsfuse: 13 | runs-on: ubuntu-18.04 14 | env: 15 | PY_COLORS: 1 16 | ANSIBLE_FORCE_COLOR: 1 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | molecule_distro: 21 | - distro: ubuntu:16.04 22 | command: /sbin/init 23 | - distro: ubuntu:18.04 24 | command: /lib/systemd/systemd 25 | - distro: debian:9 26 | command: /lib/systemd/systemd 27 | collection_role: 28 | - gcsfuse 29 | steps: 30 | - name: Check out code 31 | uses: actions/checkout@v1 32 | with: 33 | path: ansible_collections/google/cloud 34 | 35 | - name: Set up Python 3.8 36 | uses: actions/setup-python@v1 37 | with: 38 | python-version: 3.8 39 | 40 | - name: Install dependencies 41 | run: | 42 | sudo apt install docker 43 | python -m pip install --upgrade pip 44 | pip install molecule yamllint ansible-lint docker 45 | 46 | - name: Run role test 47 | run: >- 48 | molecule --version && 49 | ansible --version && 50 | MOLECULE_COMMAND=${{ matrix.molecule_distro.command }} 51 | MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }} 52 | molecule --debug test -s ${{ matrix.collection_role }} 53 | -------------------------------------------------------------------------------- /roles/gcloud/tasks/archive/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks to install gcloud via archive 3 | - name: gcloud | Archive | Look for existing Google Cloud SDK installation 4 | stat: 5 | path: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION" 6 | register: gcloud_status 7 | 8 | - debug: var=gcloud_status 9 | 10 | - name: gcloud | Archive | Set installed version if installation exists 11 | block: 12 | - name: gcloud | Archive | Importing contents of {{ gcloud_archive_path }}/google-cloud-sdk/VERSION 13 | slurp: 14 | src: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION" 15 | register: gcloud_installed_version_data 16 | - name: gcloud | Archive | Setting the gcloud_installed_version variable/fact 17 | set_fact: 18 | gcloud_installed_version: "{{ (gcloud_installed_version_data.content|b64decode|trim) }}" 19 | - debug: 20 | msg: "google-cloud-sdk: {{ gcloud_installed_version }} is installed" 21 | - debug: 22 | msg: >- 23 | Skipping installation of google-cloud-sdk version {{ gcloud_version }} when 24 | {{ gcloud_installed_version }} is already installed. 25 | when: gcloud_version == gcloud_installed_version 26 | when: gcloud_status.stat.exists 27 | 28 | - name: gcloud | Archive | Start installation 29 | include_tasks: archive_install.yml 30 | when: gcloud_installed_version is undefined or 31 | gcloud_version is version(gcloud_installed_version, '>') 32 | 33 | - name: gcloud | Debian | Install the google-cloud-sdk additional components # noqa 301 34 | command: gcloud components install {{ item }} 35 | register: gcloud_install_comp_status 36 | changed_when: "'All components are up to date.' not in gcloud_install_comp_status.stderr_lines" 37 | loop: "{{ gcloud_additional_components }}" 38 | -------------------------------------------------------------------------------- /roles/gcloud/tasks/archive/archive_install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: gcloud | Archive | Ensure temp path exists 3 | file: path={{ gcloud_archive_path }} state=directory 4 | 5 | - name: gcloud | Archive | Extract Cloud SDK archive 6 | unarchive: 7 | src: "{{ gcloud_archive_url }}" 8 | dest: "{{ gcloud_archive_path }}" 9 | remote_src: yes 10 | creates: "{{ gcloud_library_path }}" 11 | 12 | - name: gcloud | Archive | Link binaries to /usr/bin (like package install) 13 | file: 14 | src: "{{ gcloud_library_path }}/bin/{{ item }}" 15 | dest: "/usr/bin/{{ item }}" 16 | state: link 17 | loop: 18 | - bq 19 | - docker-credential-gcloud 20 | - gcloud 21 | - git-credential-gcloud.sh 22 | - gsutil 23 | when: not gcloud_install_script 24 | 25 | - name: gcloud | Archive | Add command completion 26 | include_tasks: command_completion.yml 27 | when: gcloud_command_completion 28 | 29 | - name: gcloud | Archive | Install into Path 30 | command: >- 31 | {{ gcloud_archive_path }}/install.sh --quiet 32 | --usage-reporting {{ gcloud_usage_reporting | lower }} 33 | {% if gcloud_profile_path %} 34 | --rc-path {{ gcloud_profile_path }} 35 | {% endif %} 36 | --command-completion {{ gcloud_command_completion | lower }} 37 | --path-update {{ gcloud_update_path | lower }} 38 | {% if gcloud_override_components | length > 0 %}--override-components 39 | {% for component in gcloud_override_components %}{{ component }} 40 | {% if loop.index < gcloud_override_components | length %} 41 | {% endif %} 42 | {% endfor %} 43 | {% endif %} 44 | {% if gcloud_additional_components | length > 0 %}--additional-components 45 | {% for component in gcloud_additional_components %}{{ component }} 46 | {% if loop.index < gcloud_additional_components | length %} 47 | {% endif %} 48 | {% endfor %} 49 | {% endif %} 50 | when: gcloud_install_script 51 | -------------------------------------------------------------------------------- /.github/workflows/gcloud.yml: -------------------------------------------------------------------------------- 1 | name: "google.cloud.gcloud" 2 | on: 3 | push: 4 | paths: 5 | - 'roles/gcloud/**' 6 | - '.github/workflows/gcloud.yml' 7 | - 'molecule/gcloud/**' 8 | pull_request: 9 | paths: 10 | - 'roles/gcloud/**' 11 | - '.github/workflows/gcloud.yml' 12 | - 'molecule/gcloud/**' 13 | jobs: 14 | molecule: 15 | runs-on: ubuntu-18.04 16 | env: 17 | PY_COLORS: 1 18 | ANSIBLE_FORCE_COLOR: 1 19 | strategy: 20 | fail-fast: true 21 | matrix: 22 | molecule_playbook: 23 | - archive_playbook.yml 24 | - package_playbook.yml 25 | molecule_distro: 26 | - distro: centos:7 27 | command: /usr/sbin/init 28 | - distro: centos:8 29 | command: /usr/sbin/init 30 | - distro: ubuntu:16.04 31 | command: /sbin/init 32 | - distro: ubuntu:18.04 33 | command: /lib/systemd/systemd 34 | - distro: debian:9 35 | command: /lib/systemd/systemd 36 | collection_role: 37 | - gcloud 38 | steps: 39 | - name: Check out code 40 | uses: actions/checkout@v1 41 | with: 42 | path: ansible_collections/google/cloud 43 | 44 | - name: Set up Python 3.8 45 | uses: actions/setup-python@v1 46 | with: 47 | python-version: 3.8 48 | 49 | - name: Install dependencies 50 | run: | 51 | sudo apt install docker 52 | python -m pip install --upgrade pip 53 | pip install molecule yamllint ansible-lint docker 54 | 55 | - name: Run role test 56 | run: >- 57 | molecule --version && 58 | ansible --version && 59 | MOLECULE_COMMAND=${{ matrix.molecule_distro.command }} 60 | MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }} 61 | MOLECULE_PLAYBOOK=${{ matrix.molecule_playbook }} 62 | molecule --debug test -s ${{ matrix.collection_role }} 63 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: googlecloudplatform 3 | description: Create a HTTP Load Balancer on GCP 4 | company: Google 5 | 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | 10 | # Some suggested licenses: 11 | # - BSD (default) 12 | # - MIT 13 | # - GPLv2 14 | # - GPLv3 15 | # - Apache 16 | # - CC-BY 17 | license: GPLv3 18 | 19 | min_ansible_version: 2.7 20 | # If this a Container Enabled role, provide the minimum Ansible Container version. 21 | # min_ansible_container_version: 22 | 23 | # Optionally specify the branch Galaxy will use when accessing the GitHub 24 | # repo for this role. During role install, if no tags are available, 25 | # Galaxy will use this branch. During import Galaxy will access files on 26 | # this branch. If Travis integration is configured, only notifications for this 27 | # branch will be accepted. Otherwise, in all cases, the repo's default branch 28 | # (usually master) will be used. 29 | #github_branch: 30 | 31 | # 32 | # Provide a list of supported platforms, and for each platform a list of versions. 33 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 34 | # To view available platforms and versions (or releases), visit: 35 | # https://galaxy.ansible.com/api/v1/platforms/ 36 | # 37 | # platforms: 38 | # - name: Fedora 39 | # versions: 40 | # - all 41 | # - 25 42 | # - name: SomePlatform 43 | # versions: 44 | # - all 45 | # - 1.0 46 | # - 7 47 | # - 99.99 48 | 49 | galaxy_tags: [] 50 | # List tags for your role here, one per line. A tag is a keyword that describes 51 | # and categorizes the role. Users find roles by searching for tags. Be sure to 52 | # remove the '[]' above, if you add tags to this list. 53 | # 54 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 55 | # Maximum 20 tags per role. 56 | 57 | dependencies: [] 58 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 59 | # if you add dependencies to this list. 60 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_key_ring/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | # Pre-test setup 15 | - name: delete a key ring 16 | gcp_kms_key_ring: 17 | name: "{{ resource_name }}" 18 | location: us-central1 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: absent 23 | #---------------------------------------------------------- 24 | - name: create a key ring 25 | gcp_kms_key_ring: 26 | name: "{{ resource_name }}" 27 | location: us-central1 28 | project: "{{ gcp_project }}" 29 | auth_kind: "{{ gcp_cred_kind }}" 30 | service_account_file: "{{ gcp_cred_file }}" 31 | state: present 32 | register: result 33 | - name: assert changed is true 34 | assert: 35 | that: 36 | - result.changed == true 37 | - name: verify that key_ring was created 38 | gcp_kms_key_ring_info: 39 | location: us-central1 40 | project: "{{ gcp_project }}" 41 | auth_kind: "{{ gcp_cred_kind }}" 42 | service_account_file: "{{ gcp_cred_file }}" 43 | scopes: 44 | - https://www.googleapis.com/auth/cloudkms 45 | register: results 46 | - name: verify that command succeeded 47 | assert: 48 | that: 49 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 50 | # ---------------------------------------------------------------------------- 51 | - name: create a key ring that already exists 52 | gcp_kms_key_ring: 53 | name: "{{ resource_name }}" 54 | location: us-central1 55 | project: "{{ gcp_project }}" 56 | auth_kind: "{{ gcp_cred_kind }}" 57 | service_account_file: "{{ gcp_cred_file }}" 58 | state: present 59 | register: result 60 | - name: assert changed is false 61 | assert: 62 | that: 63 | - result.changed == false 64 | -------------------------------------------------------------------------------- /plugins/doc_fragments/gcp.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright: (c) 2018, Google Inc. 4 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 5 | 6 | from __future__ import (absolute_import, division, print_function) 7 | 8 | __metaclass__ = type 9 | 10 | 11 | class ModuleDocFragment(object): 12 | # GCP doc fragment. 13 | DOCUMENTATION = r''' 14 | options: 15 | project: 16 | description: 17 | - The Google Cloud Platform project to use. 18 | type: str 19 | auth_kind: 20 | description: 21 | - The type of credential used. 22 | type: str 23 | required: true 24 | choices: [ application, machineaccount, serviceaccount ] 25 | service_account_contents: 26 | description: 27 | - The contents of a Service Account JSON file, either in a dictionary or as a JSON string that represents it. 28 | type: jsonarg 29 | service_account_file: 30 | description: 31 | - The path of a Service Account JSON file if serviceaccount is selected as type. 32 | type: path 33 | service_account_email: 34 | description: 35 | - An optional service account email address if machineaccount is selected 36 | and the user does not wish to use the default email. 37 | type: str 38 | scopes: 39 | description: 40 | - Array of scopes to be used. 41 | type: list 42 | env_type: 43 | description: 44 | - Specifies which Ansible environment you're running this module within. 45 | - This should not be set unless you know what you're doing. 46 | - This only alters the User Agent string for any API requests. 47 | type: str 48 | notes: 49 | - for authentication, you can set service_account_file using the 50 | c(gcp_service_account_file) env variable. 51 | - for authentication, you can set service_account_contents using the 52 | c(GCP_SERVICE_ACCOUNT_CONTENTS) env variable. 53 | - For authentication, you can set service_account_email using the 54 | C(GCP_SERVICE_ACCOUNT_EMAIL) env variable. 55 | - For authentication, you can set auth_kind using the C(GCP_AUTH_KIND) env 56 | variable. 57 | - For authentication, you can set scopes using the C(GCP_SCOPES) env variable. 58 | - Environment variables values will only be used if the playbook values are 59 | not set. 60 | - The I(service_account_email) and I(service_account_file) options are 61 | mutually exclusive. 62 | ''' 63 | -------------------------------------------------------------------------------- /galaxy.yml: -------------------------------------------------------------------------------- 1 | ### REQUIRED 2 | 3 | # The namespace of the collection. This can be a company/brand/organization or product namespace under which all 4 | # content lives. May only contain alphanumeric characters and underscores. Additionally namespaces cannot start with 5 | # underscores or numbers and cannot contain consecutive underscores 6 | namespace: google 7 | 8 | # The name of the collection. Has the same character restrictions as 'namespace' 9 | name: cloud 10 | 11 | # The version of the collection. Must be compatible with semantic versioning 12 | version: 1.0.2 13 | 14 | # The path to the Markdown (.md) readme file. This path is relative to the root of the collection 15 | readme: README.md 16 | 17 | # A list of the collection's content authors. Can be just the name or in the format 'Full Name (url) 18 | # @nicks:irc/im.site#channel' 19 | authors: 20 | - Google 21 | 22 | 23 | ### OPTIONAL but strongly recommended 24 | 25 | # A short summary description of the collection 26 | description: The Google Cloud Platform collection. 27 | 28 | # Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only 29 | # accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' 30 | license: 31 | - GPL-2.0-or-later 32 | 33 | # The path to the license file for the collection. This path is relative to the root of the collection. This key is 34 | # mutually exclusive with 'license' 35 | #license_file: '' 36 | 37 | # A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character 38 | # requirements as 'namespace' and 'name' 39 | tags: 40 | - cloud 41 | - gcsfuse 42 | - stackdriver 43 | - logging 44 | - monitoring 45 | 46 | # Collections that this collection requires to be installed for it to be usable. The key of the dict is the 47 | # collection label 'namespace.name'. The value is a version range 48 | # L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version 49 | # range specifiers can be set and are separated by ',' 50 | #dependencies: {} 51 | 52 | # The URL of the originating SCM repository 53 | repository: http://github.com/ansible/ansible_collections_google 54 | 55 | # The URL to any online docs 56 | #documentation: http://docs.example.com 57 | 58 | # The URL to the homepage of the collection/project 59 | homepage: http://cloud.google.com 60 | 61 | # The URL to the collection issue tracker 62 | #issues: http://example.com/issue/tracker 63 | -------------------------------------------------------------------------------- /roles/gcp_http_lb/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: create a global address for the load balancer. 3 | gcp_compute_global_address: 4 | name: "{{ gcp_http_lb_globaladdress }}" 5 | project: "{{ gcp_project }}" 6 | auth_kind: "{{ gcp_cred_kind }}" 7 | service_account_file: "{{ gcp_cred_file }}" 8 | state: "{{ gcp_http_lb_state }}" 9 | register: globaladdress 10 | - name: create a http health check to verify lb working 11 | gcp_compute_http_health_check: 12 | name: "{{ gcp_http_lb_healthcheck }}" 13 | healthy_threshold: 10 14 | port: 80 15 | timeout_sec: 2 16 | unhealthy_threshold: 5 17 | project: "{{ gcp_project }}" 18 | auth_kind: "{{ gcp_cred_kind }}" 19 | service_account_file: "{{ gcp_cred_file }}" 20 | state: "{{ gcp_http_lb_state }}" 21 | register: healthcheck 22 | - name: create a backend service 23 | gcp_compute_backend_service: 24 | name: "{{ gcp_http_lb_backendservice }}" 25 | backends: 26 | - group: "{{ gcp_http_lb_backend.selfLink }}" 27 | health_checks: 28 | - "{{ healthcheck.selfLink }}" 29 | enable_cdn: "{{ gcp_http_lb_cdn }}" 30 | project: "{{ gcp_project }}" 31 | auth_kind: "{{ gcp_cred_kind }}" 32 | service_account_file: "{{ gcp_cred_file }}" 33 | state: "{{ gcp_http_lb_state }}" 34 | register: backendservice 35 | - name: create a url map 36 | gcp_compute_url_map: 37 | name: "{{ gcp_http_lb_urlmap }}" 38 | default_service: "{{ backendservice }}" 39 | project: "{{ gcp_project }}" 40 | auth_kind: "{{ gcp_cred_kind }}" 41 | service_account_file: "{{ gcp_cred_file }}" 42 | state: "{{ gcp_http_lb_state }}" 43 | register: urlmap 44 | - name: create a target http proxy 45 | gcp_compute_target_http_proxy: 46 | name: "{{ gcp_http_lb_httpproxy }}" 47 | url_map: "{{ urlmap }}" 48 | project: "{{ gcp_project }}" 49 | auth_kind: "{{ gcp_cred_kind }}" 50 | service_account_file: "{{ gcp_cred_file }}" 51 | state: "{{ gcp_http_lb_state }}" 52 | register: httpproxy 53 | - name: create a global forwarding rule 54 | gcp_compute_global_forwarding_rule: 55 | name: "{{ gcp_http_lb_forwardingrule }}" 56 | ip_address: "{{ globaladdress.address }}" 57 | load_balancing_scheme: "EXTERNAL" 58 | ip_protocol: TCP 59 | port_range: 80-80 60 | target: "{{ httpproxy.selfLink }}" 61 | project: "{{ gcp_project }}" 62 | auth_kind: "{{ gcp_cred_kind }}" 63 | service_account_file: "{{ gcp_cred_file }}" 64 | state: "{{ gcp_http_lb_state }}" 65 | register: result 66 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_object/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Pre-test setup 3 | - name: create a temp file for uploading 4 | tempfile: 5 | state: file 6 | register: upload_temp 7 | - name: create a temp file for downloading 8 | tempfile: 9 | state: file 10 | register: download_temp 11 | - name: put content in the tempfile 12 | copy: 13 | content: "Ansible GCS test file" 14 | dest: "{{ upload_temp.path }}" 15 | - name: create a bucket 16 | google.cloud.gcp_storage_bucket: 17 | name: "{{ resource_name }}" 18 | project: "{{ gcp_project }}" 19 | auth_kind: "{{ gcp_cred_kind }}" 20 | service_account_file: "{{ gcp_cred_file }}" 21 | state: present 22 | register: bucket 23 | #---------------------------------------------------------- 24 | - name: upload the object to gcs 25 | google.cloud.gcp_storage_object: 26 | action: 'upload' 27 | bucket: "{{ bucket.name }}" 28 | src: "{{ upload_temp.path }}" 29 | dest: "ansible/{{ resource_name }}" 30 | project: "{{ gcp_project }}" 31 | auth_kind: "{{ gcp_cred_kind }}" 32 | service_account_file: "{{ gcp_cred_file }}" 33 | register: result 34 | - name: assert changed is true 35 | assert: 36 | that: 37 | - result.changed == true 38 | # ---------------------------------------------------------------------------- 39 | - name: download the object to disk 40 | google.cloud.gcp_storage_object: 41 | action: 'download' 42 | bucket: "{{ bucket.name }}" 43 | src: "ansible/{{ resource_name }}" 44 | dest: "{{ download_temp.path }}" 45 | project: "{{ gcp_project }}" 46 | auth_kind: "{{ gcp_cred_kind }}" 47 | service_account_file: "{{ gcp_cred_file }}" 48 | register: result 49 | - name: assert changed is true 50 | assert: 51 | that: 52 | - result.changed == true 53 | # ---------------------------------------------------------------------------- 54 | - name: delete the object 55 | google.cloud.gcp_storage_object: 56 | action: 'delete' 57 | bucket: "{{ bucket.name }}" 58 | src: "ansible/{{ resource_name }}" 59 | project: "{{ gcp_project }}" 60 | auth_kind: "{{ gcp_cred_kind }}" 61 | service_account_file: "{{ gcp_cred_file }}" 62 | register: result 63 | - name: assert changed is true 64 | assert: 65 | that: 66 | - result.changed == true 67 | # ---------------------------------------------------------------------------- 68 | - name: delete the bucket 69 | google.cloud.gcp_storage_bucket: 70 | name: "{{ resource_name }}" 71 | project: "{{ gcp_project }}" 72 | auth_kind: "{{ gcp_cred_kind }}" 73 | service_account_file: "{{ gcp_cred_file }}" 74 | state: absent 75 | register: bucket 76 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a bucket 17 | google.cloud.gcp_storage_bucket: 18 | name: ansible-storage-module 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: absent 23 | #---------------------------------------------------------- 24 | - name: create a bucket 25 | google.cloud.gcp_storage_bucket: 26 | name: ansible-storage-module 27 | project: "{{ gcp_project }}" 28 | auth_kind: "{{ gcp_cred_kind }}" 29 | service_account_file: "{{ gcp_cred_file }}" 30 | state: present 31 | register: result 32 | - name: assert changed is true 33 | assert: 34 | that: 35 | - result.changed == true 36 | # ---------------------------------------------------------------------------- 37 | - name: create a bucket that already exists 38 | google.cloud.gcp_storage_bucket: 39 | name: ansible-storage-module 40 | project: "{{ gcp_project }}" 41 | auth_kind: "{{ gcp_cred_kind }}" 42 | service_account_file: "{{ gcp_cred_file }}" 43 | state: present 44 | register: result 45 | - name: assert changed is false 46 | assert: 47 | that: 48 | - result.changed == false 49 | #---------------------------------------------------------- 50 | - name: delete a bucket 51 | google.cloud.gcp_storage_bucket: 52 | name: ansible-storage-module 53 | project: "{{ gcp_project }}" 54 | auth_kind: "{{ gcp_cred_kind }}" 55 | service_account_file: "{{ gcp_cred_file }}" 56 | state: absent 57 | register: result 58 | - name: assert changed is true 59 | assert: 60 | that: 61 | - result.changed == true 62 | # ---------------------------------------------------------------------------- 63 | - name: delete a bucket that does not exist 64 | google.cloud.gcp_storage_bucket: 65 | name: ansible-storage-module 66 | project: "{{ gcp_project }}" 67 | auth_kind: "{{ gcp_cred_kind }}" 68 | service_account_file: "{{ gcp_cred_file }}" 69 | state: absent 70 | register: result 71 | - name: assert changed is false 72 | assert: 73 | that: 74 | - result.changed == false 75 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_kms_crypto_key/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | --- 15 | # Pre-test setup 16 | - name: create a key ring 17 | gcp_kms_key_ring: 18 | name: key-key-ring 19 | location: us-central1 20 | project: "{{ gcp_project }}" 21 | auth_kind: "{{ gcp_cred_kind }}" 22 | service_account_file: "{{ gcp_cred_file }}" 23 | state: present 24 | register: keyring 25 | - name: delete a crypto key 26 | gcp_kms_crypto_key: 27 | name: "{{ resource_name }}" 28 | key_ring: projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: absent 33 | #---------------------------------------------------------- 34 | - name: create a crypto key 35 | gcp_kms_crypto_key: 36 | name: "{{ resource_name }}" 37 | key_ring: projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring 38 | project: "{{ gcp_project }}" 39 | auth_kind: "{{ gcp_cred_kind }}" 40 | service_account_file: "{{ gcp_cred_file }}" 41 | state: present 42 | register: result 43 | - name: assert changed is true 44 | assert: 45 | that: 46 | - result.changed == true 47 | - name: verify that crypto_key was created 48 | gcp_kms_crypto_key_info: 49 | key_ring: "projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring" 50 | project: "{{ gcp_project }}" 51 | auth_kind: "{{ gcp_cred_kind }}" 52 | service_account_file: "{{ gcp_cred_file }}" 53 | scopes: 54 | - https://www.googleapis.com/auth/cloudkms 55 | register: results 56 | - name: verify that command succeeded 57 | assert: 58 | that: 59 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 60 | # ---------------------------------------------------------------------------- 61 | - name: create a crypto key that already exists 62 | gcp_kms_crypto_key: 63 | name: "{{ resource_name }}" 64 | key_ring: projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring 65 | project: "{{ gcp_project }}" 66 | auth_kind: "{{ gcp_cred_kind }}" 67 | service_account_file: "{{ gcp_cred_file }}" 68 | state: present 69 | register: result 70 | - name: assert changed is false 71 | assert: 72 | that: 73 | - result.changed == false 74 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sql_ssl_cert/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: create a instance 17 | google.cloud.gcp_sql_instance: 18 | name: "{{resource_name}}-2" 19 | settings: 20 | ip_configuration: 21 | authorized_networks: 22 | - name: google dns server 23 | value: 8.8.8.8/32 24 | tier: db-n1-standard-1 25 | region: us-central1 26 | project: "{{ gcp_project }}" 27 | auth_kind: "{{ gcp_cred_kind }}" 28 | service_account_file: "{{ gcp_cred_file }}" 29 | state: present 30 | register: instance 31 | - name: delete a SSL cert 32 | google.cloud.gcp_sql_ssl_cert: 33 | common_name: "{{resource_name}}" 34 | instance: "{{instance['name'}}" 35 | project: "{{ gcp_project }}" 36 | auth_kind: "{{ gcp_cred_kind }}" 37 | service_account_file: "{{ gcp_cred_file }}" 38 | state: absent 39 | #---------------------------------------------------------- 40 | - name: create a SSL cert 41 | google.cloud.gcp_sql_ssl_cert: 42 | common_name: "{{resource_name}}" 43 | instance: "{{instance['name'}}" 44 | project: "{{ gcp_project }}" 45 | auth_kind: "{{ gcp_cred_kind }}" 46 | service_account_file: "{{ gcp_cred_file }}" 47 | state: present 48 | register: result 49 | - name: assert changed is false 50 | assert: 51 | that: 52 | # SslCert is not altered, just verified. 53 | - result.changed == false 54 | - name: verify that ssl_cert was created 55 | google.cloud.gcp_sql_ssl_cert_info: 56 | filters: 57 | - name = 58 | instance: "{{instance['name'}}" 59 | project: "{{ gcp_project }}" 60 | auth_kind: "{{ gcp_cred_kind }}" 61 | service_account_file: "{{ gcp_cred_file }}" 62 | scopes: 63 | - https://www.googleapis.com/auth/sqlservice.admin 64 | register: results 65 | - name: verify that command succeeded 66 | assert: 67 | that: 68 | - results['resources'] | length == 1 69 | #--------------------------------------------------------- 70 | # Post-test teardown 71 | # If errors happen, don't crash the playbook! 72 | - name: delete a instance 73 | google.cloud.gcp_sql_instance: 74 | name: "{{resource_name}}-2" 75 | settings: 76 | ip_configuration: 77 | authorized_networks: 78 | - name: google dns server 79 | value: 8.8.8.8/32 80 | tier: db-n1-standard-1 81 | region: us-central1 82 | project: "{{ gcp_project }}" 83 | auth_kind: "{{ gcp_cred_kind }}" 84 | service_account_file: "{{ gcp_cred_file }}" 85 | state: absent 86 | register: instance 87 | ignore_errors: true 88 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_pubsub_topic/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a topic 17 | google.cloud.gcp_pubsub_topic: 18 | name: test-topic1 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: absent 23 | #---------------------------------------------------------- 24 | - name: create a topic 25 | google.cloud.gcp_pubsub_topic: 26 | name: test-topic1 27 | project: "{{ gcp_project }}" 28 | auth_kind: "{{ gcp_cred_kind }}" 29 | service_account_file: "{{ gcp_cred_file }}" 30 | state: present 31 | register: result 32 | - name: assert changed is true 33 | assert: 34 | that: 35 | - result.changed == true 36 | - name: verify that topic was created 37 | google.cloud.gcp_pubsub_topic_info: 38 | project: "{{ gcp_project }}" 39 | auth_kind: "{{ gcp_cred_kind }}" 40 | service_account_file: "{{ gcp_cred_file }}" 41 | scopes: 42 | - https://www.googleapis.com/auth/pubsub 43 | register: results 44 | - name: verify that command succeeded 45 | assert: 46 | that: 47 | - "'test-topic1' in \"{{ results['resources'] | map(attribute='name') | list }}\"" 48 | # ---------------------------------------------------------------------------- 49 | - name: create a topic that already exists 50 | google.cloud.gcp_pubsub_topic: 51 | name: test-topic1 52 | project: "{{ gcp_project }}" 53 | auth_kind: "{{ gcp_cred_kind }}" 54 | service_account_file: "{{ gcp_cred_file }}" 55 | state: present 56 | register: result 57 | - name: assert changed is false 58 | assert: 59 | that: 60 | - result.changed == false 61 | #---------------------------------------------------------- 62 | - name: delete a topic 63 | google.cloud.gcp_pubsub_topic: 64 | name: test-topic1 65 | project: "{{ gcp_project }}" 66 | auth_kind: "{{ gcp_cred_kind }}" 67 | service_account_file: "{{ gcp_cred_file }}" 68 | state: absent 69 | register: result 70 | - name: assert changed is true 71 | assert: 72 | that: 73 | - result.changed == true 74 | - name: verify that topic was deleted 75 | google.cloud.gcp_pubsub_topic_info: 76 | project: "{{ gcp_project }}" 77 | auth_kind: "{{ gcp_cred_kind }}" 78 | service_account_file: "{{ gcp_cred_file }}" 79 | scopes: 80 | - https://www.googleapis.com/auth/pubsub 81 | register: results 82 | - name: verify that command succeeded 83 | assert: 84 | that: 85 | - "'test-topic1' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" 86 | # ---------------------------------------------------------------------------- 87 | - name: delete a topic that does not exist 88 | google.cloud.gcp_pubsub_topic: 89 | name: test-topic1 90 | project: "{{ gcp_project }}" 91 | auth_kind: "{{ gcp_cred_kind }}" 92 | service_account_file: "{{ gcp_cred_file }}" 93 | state: absent 94 | register: result 95 | - name: assert changed is false 96 | assert: 97 | that: 98 | - result.changed == false 99 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_serviceusage_service/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a service 17 | google.cloud.gcp_serviceusage_service: 18 | name: spanner.googleapis.com 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: absent 23 | #---------------------------------------------------------- 24 | - name: create a service 25 | google.cloud.gcp_serviceusage_service: 26 | name: spanner.googleapis.com 27 | project: "{{ gcp_project }}" 28 | auth_kind: "{{ gcp_cred_kind }}" 29 | service_account_file: "{{ gcp_cred_file }}" 30 | state: present 31 | register: result 32 | - name: assert changed is true 33 | assert: 34 | that: 35 | - result.changed == true 36 | - name: verify that service was created 37 | google.cloud.gcp_serviceusage_service_info: 38 | project: "{{ gcp_project }}" 39 | auth_kind: "{{ gcp_cred_kind }}" 40 | service_account_file: "{{ gcp_cred_file }}" 41 | scopes: 42 | - https://www.googleapis.com/auth/cloud-platform 43 | register: results 44 | - name: verify that command succeeded 45 | assert: 46 | that: 47 | - "'{{ (results['resources'] | selectattr('name', 'search', 'spanner.googleapis.com') | list | first).state }}' == 'ENABLED'" 48 | # ---------------------------------------------------------------------------- 49 | - name: create a service that already exists 50 | google.cloud.gcp_serviceusage_service: 51 | name: spanner.googleapis.com 52 | project: "{{ gcp_project }}" 53 | auth_kind: "{{ gcp_cred_kind }}" 54 | service_account_file: "{{ gcp_cred_file }}" 55 | state: present 56 | register: result 57 | - name: assert changed is false 58 | assert: 59 | that: 60 | - result.changed == false 61 | #---------------------------------------------------------- 62 | - name: delete a service 63 | google.cloud.gcp_serviceusage_service: 64 | name: spanner.googleapis.com 65 | project: "{{ gcp_project }}" 66 | auth_kind: "{{ gcp_cred_kind }}" 67 | service_account_file: "{{ gcp_cred_file }}" 68 | state: absent 69 | register: result 70 | - name: assert changed is true 71 | assert: 72 | that: 73 | - result.changed == true 74 | - name: verify that service was deleted 75 | google.cloud.gcp_serviceusage_service_info: 76 | project: "{{ gcp_project }}" 77 | auth_kind: "{{ gcp_cred_kind }}" 78 | service_account_file: "{{ gcp_cred_file }}" 79 | scopes: 80 | - https://www.googleapis.com/auth/cloud-platform 81 | register: results 82 | - name: verify that command succeeded 83 | assert: 84 | that: 85 | - "'{{ (results['resources'] | selectattr('name', 'search', 'spanner.googleapis.com') | list | first).state }}' == 'DISABLED'" 86 | # ---------------------------------------------------------------------------- 87 | - name: delete a service that does not exist 88 | google.cloud.gcp_serviceusage_service: 89 | name: spanner.googleapis.com 90 | project: "{{ gcp_project }}" 91 | auth_kind: "{{ gcp_cred_kind }}" 92 | service_account_file: "{{ gcp_cred_file }}" 93 | state: absent 94 | register: result 95 | - name: assert changed is false 96 | assert: 97 | that: 98 | - result.changed == false 99 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_sourcerepo_repository/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a repository 17 | google.cloud.gcp_sourcerepo_repository: 18 | name: "{{ resource_name }}" 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: absent 23 | #---------------------------------------------------------- 24 | - name: create a repository 25 | google.cloud.gcp_sourcerepo_repository: 26 | name: "{{ resource_name }}" 27 | project: "{{ gcp_project }}" 28 | auth_kind: "{{ gcp_cred_kind }}" 29 | service_account_file: "{{ gcp_cred_file }}" 30 | state: present 31 | register: result 32 | - name: assert changed is true 33 | assert: 34 | that: 35 | - result.changed == true 36 | - name: verify that repository was created 37 | google.cloud.gcp_sourcerepo_repository_info: 38 | project: "{{ gcp_project }}" 39 | auth_kind: "{{ gcp_cred_kind }}" 40 | service_account_file: "{{ gcp_cred_file }}" 41 | scopes: 42 | - https://www.googleapis.com/auth/cloud-platform 43 | register: results 44 | - name: verify that command succeeded 45 | assert: 46 | that: 47 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 48 | # ---------------------------------------------------------------------------- 49 | - name: create a repository that already exists 50 | google.cloud.gcp_sourcerepo_repository: 51 | name: "{{ resource_name }}" 52 | project: "{{ gcp_project }}" 53 | auth_kind: "{{ gcp_cred_kind }}" 54 | service_account_file: "{{ gcp_cred_file }}" 55 | state: present 56 | register: result 57 | - name: assert changed is false 58 | assert: 59 | that: 60 | - result.changed == false 61 | #---------------------------------------------------------- 62 | - name: delete a repository 63 | google.cloud.gcp_sourcerepo_repository: 64 | name: "{{ resource_name }}" 65 | project: "{{ gcp_project }}" 66 | auth_kind: "{{ gcp_cred_kind }}" 67 | service_account_file: "{{ gcp_cred_file }}" 68 | state: absent 69 | register: result 70 | - name: assert changed is true 71 | assert: 72 | that: 73 | - result.changed == true 74 | - name: verify that repository was deleted 75 | google.cloud.gcp_sourcerepo_repository_info: 76 | project: "{{ gcp_project }}" 77 | auth_kind: "{{ gcp_cred_kind }}" 78 | service_account_file: "{{ gcp_cred_file }}" 79 | scopes: 80 | - https://www.googleapis.com/auth/cloud-platform 81 | register: results 82 | - name: verify that command succeeded 83 | assert: 84 | that: 85 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 86 | # ---------------------------------------------------------------------------- 87 | - name: delete a repository that does not exist 88 | google.cloud.gcp_sourcerepo_repository: 89 | name: "{{ resource_name }}" 90 | project: "{{ gcp_project }}" 91 | auth_kind: "{{ gcp_cred_kind }}" 92 | service_account_file: "{{ gcp_cred_file }}" 93 | state: absent 94 | register: result 95 | - name: assert changed is false 96 | assert: 97 | that: 98 | - result.changed == false 99 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_default_object_acl/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: create a bucket 17 | google.cloud.gcp_storage_bucket: 18 | name: "{{ resource_name }}" 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: present 23 | register: bucket 24 | - name: delete a default object acl 25 | google.cloud.gcp_storage_default_object_acl: 26 | bucket: "{{ bucket }}" 27 | entity: OWNER:user-alexstephen@google.com 28 | project: "{{ gcp_project }}" 29 | auth_kind: "{{ gcp_cred_kind }}" 30 | service_account_file: "{{ gcp_cred_file }}" 31 | state: absent 32 | #---------------------------------------------------------- 33 | - name: create a default object acl 34 | google.cloud.gcp_storage_default_object_acl: 35 | bucket: "{{ bucket }}" 36 | entity: OWNER:user-alexstephen@google.com 37 | project: "{{ gcp_project }}" 38 | auth_kind: "{{ gcp_cred_kind }}" 39 | service_account_file: "{{ gcp_cred_file }}" 40 | state: present 41 | register: result 42 | - name: assert changed is true 43 | assert: 44 | that: 45 | - result.changed == true 46 | # ---------------------------------------------------------------------------- 47 | - name: create a default object acl that already exists 48 | google.cloud.gcp_storage_default_object_acl: 49 | bucket: "{{ bucket }}" 50 | entity: OWNER:user-alexstephen@google.com 51 | project: "{{ gcp_project }}" 52 | auth_kind: "{{ gcp_cred_kind }}" 53 | service_account_file: "{{ gcp_cred_file }}" 54 | state: present 55 | register: result 56 | - name: assert changed is false 57 | assert: 58 | that: 59 | - result.changed == false 60 | #---------------------------------------------------------- 61 | - name: delete a default object acl 62 | google.cloud.gcp_storage_default_object_acl: 63 | bucket: "{{ bucket }}" 64 | entity: OWNER:user-alexstephen@google.com 65 | project: "{{ gcp_project }}" 66 | auth_kind: "{{ gcp_cred_kind }}" 67 | service_account_file: "{{ gcp_cred_file }}" 68 | state: absent 69 | register: result 70 | - name: assert changed is true 71 | assert: 72 | that: 73 | - result.changed == true 74 | # ---------------------------------------------------------------------------- 75 | - name: delete a default object acl that does not exist 76 | google.cloud.gcp_storage_default_object_acl: 77 | bucket: "{{ bucket }}" 78 | entity: OWNER:user-alexstephen@google.com 79 | project: "{{ gcp_project }}" 80 | auth_kind: "{{ gcp_cred_kind }}" 81 | service_account_file: "{{ gcp_cred_file }}" 82 | state: absent 83 | register: result 84 | - name: assert changed is false 85 | assert: 86 | that: 87 | - result.changed == false 88 | #--------------------------------------------------------- 89 | # Post-test teardown 90 | # If errors happen, don't crash the playbook! 91 | - name: delete a bucket 92 | google.cloud.gcp_storage_bucket: 93 | name: "{{ resource_name }}" 94 | project: "{{ gcp_project }}" 95 | auth_kind: "{{ gcp_cred_kind }}" 96 | service_account_file: "{{ gcp_cred_file }}" 97 | state: absent 98 | register: bucket 99 | ignore_errors: true 100 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_global_address/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a global address 17 | google.cloud.gcp_compute_global_address: 18 | name: "{{ resource_name }}" 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: absent 23 | #---------------------------------------------------------- 24 | - name: create a global address 25 | google.cloud.gcp_compute_global_address: 26 | name: "{{ resource_name }}" 27 | project: "{{ gcp_project }}" 28 | auth_kind: "{{ gcp_cred_kind }}" 29 | service_account_file: "{{ gcp_cred_file }}" 30 | state: present 31 | register: result 32 | - name: assert changed is true 33 | assert: 34 | that: 35 | - result.changed == true 36 | - name: verify that global_address was created 37 | google.cloud.gcp_compute_global_address_info: 38 | filters: 39 | - name = {{ resource_name }} 40 | project: "{{ gcp_project }}" 41 | auth_kind: "{{ gcp_cred_kind }}" 42 | service_account_file: "{{ gcp_cred_file }}" 43 | scopes: 44 | - https://www.googleapis.com/auth/compute 45 | register: results 46 | - name: verify that command succeeded 47 | assert: 48 | that: 49 | - results['resources'] | length == 1 50 | # ---------------------------------------------------------------------------- 51 | - name: create a global address that already exists 52 | google.cloud.gcp_compute_global_address: 53 | name: "{{ resource_name }}" 54 | project: "{{ gcp_project }}" 55 | auth_kind: "{{ gcp_cred_kind }}" 56 | service_account_file: "{{ gcp_cred_file }}" 57 | state: present 58 | register: result 59 | - name: assert changed is false 60 | assert: 61 | that: 62 | - result.changed == false 63 | #---------------------------------------------------------- 64 | - name: delete a global address 65 | google.cloud.gcp_compute_global_address: 66 | name: "{{ resource_name }}" 67 | project: "{{ gcp_project }}" 68 | auth_kind: "{{ gcp_cred_kind }}" 69 | service_account_file: "{{ gcp_cred_file }}" 70 | state: absent 71 | register: result 72 | - name: assert changed is true 73 | assert: 74 | that: 75 | - result.changed == true 76 | - name: verify that global_address was deleted 77 | google.cloud.gcp_compute_global_address_info: 78 | filters: 79 | - name = {{ resource_name }} 80 | project: "{{ gcp_project }}" 81 | auth_kind: "{{ gcp_cred_kind }}" 82 | service_account_file: "{{ gcp_cred_file }}" 83 | scopes: 84 | - https://www.googleapis.com/auth/compute 85 | register: results 86 | - name: verify that command succeeded 87 | assert: 88 | that: 89 | - results['resources'] | length == 0 90 | # ---------------------------------------------------------------------------- 91 | - name: delete a global address that does not exist 92 | google.cloud.gcp_compute_global_address: 93 | name: "{{ resource_name }}" 94 | project: "{{ gcp_project }}" 95 | auth_kind: "{{ gcp_cred_kind }}" 96 | service_account_file: "{{ gcp_cred_file }}" 97 | state: absent 98 | register: result 99 | - name: assert changed is false 100 | assert: 101 | that: 102 | - result.changed == false 103 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_address/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a address 17 | google.cloud.gcp_compute_address: 18 | name: test-address1 19 | region: us-west1 20 | project: "{{ gcp_project }}" 21 | auth_kind: "{{ gcp_cred_kind }}" 22 | service_account_file: "{{ gcp_cred_file }}" 23 | state: absent 24 | #---------------------------------------------------------- 25 | - name: create a address 26 | google.cloud.gcp_compute_address: 27 | name: test-address1 28 | region: us-west1 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: present 33 | register: result 34 | - name: assert changed is true 35 | assert: 36 | that: 37 | - result.changed == true 38 | - name: verify that address was created 39 | google.cloud.gcp_compute_address_info: 40 | filters: 41 | - name = test-address1 42 | region: us-west1 43 | project: "{{ gcp_project }}" 44 | auth_kind: "{{ gcp_cred_kind }}" 45 | service_account_file: "{{ gcp_cred_file }}" 46 | scopes: 47 | - https://www.googleapis.com/auth/compute 48 | register: results 49 | - name: verify that command succeeded 50 | assert: 51 | that: 52 | - results['resources'] | length == 1 53 | # ---------------------------------------------------------------------------- 54 | - name: create a address that already exists 55 | google.cloud.gcp_compute_address: 56 | name: test-address1 57 | region: us-west1 58 | project: "{{ gcp_project }}" 59 | auth_kind: "{{ gcp_cred_kind }}" 60 | service_account_file: "{{ gcp_cred_file }}" 61 | state: present 62 | register: result 63 | - name: assert changed is false 64 | assert: 65 | that: 66 | - result.changed == false 67 | #---------------------------------------------------------- 68 | - name: delete a address 69 | google.cloud.gcp_compute_address: 70 | name: test-address1 71 | region: us-west1 72 | project: "{{ gcp_project }}" 73 | auth_kind: "{{ gcp_cred_kind }}" 74 | service_account_file: "{{ gcp_cred_file }}" 75 | state: absent 76 | register: result 77 | - name: assert changed is true 78 | assert: 79 | that: 80 | - result.changed == true 81 | - name: verify that address was deleted 82 | google.cloud.gcp_compute_address_info: 83 | filters: 84 | - name = test-address1 85 | region: us-west1 86 | project: "{{ gcp_project }}" 87 | auth_kind: "{{ gcp_cred_kind }}" 88 | service_account_file: "{{ gcp_cred_file }}" 89 | scopes: 90 | - https://www.googleapis.com/auth/compute 91 | register: results 92 | - name: verify that command succeeded 93 | assert: 94 | that: 95 | - results['resources'] | length == 0 96 | # ---------------------------------------------------------------------------- 97 | - name: delete a address that does not exist 98 | google.cloud.gcp_compute_address: 99 | name: test-address1 100 | region: us-west1 101 | project: "{{ gcp_project }}" 102 | auth_kind: "{{ gcp_cred_kind }}" 103 | service_account_file: "{{ gcp_cred_file }}" 104 | state: absent 105 | register: result 106 | - name: assert changed is false 107 | assert: 108 | that: 109 | - result.changed == false 110 | -------------------------------------------------------------------------------- /plugins/filter/gcp_kms_filters.py: -------------------------------------------------------------------------------- 1 | # (c) 2019, Eric Anderson 2 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 3 | 4 | # Usage: 5 | # vars: 6 | # encrypted_myvar: "{{ var | b64encode | gcp_kms_encrypt(auth_kind='serviceaccount', 7 | # service_account_file='gcp_service_account_file', projects='default', 8 | # key_ring='key_ring', crypto_key='crypto_key') }}" 9 | # decrypted_myvar: "{{ encrypted_myvar | gcp_kms_decrypt(auth_kind='serviceaccount', 10 | # service_account_file=gcp_service_account_file, projects='default', 11 | # key_ring='key_ring', crypto_key='crypto_key') }}" 12 | 13 | from __future__ import (absolute_import, division, print_function) 14 | __metaclass__ = type 15 | 16 | from ansible.errors import AnsibleError 17 | from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import GcpSession 18 | 19 | 20 | class GcpMockModule(object): 21 | def __init__(self, params): 22 | self.params = params 23 | 24 | def fail_json(self, *args, **kwargs): 25 | raise AnsibleError(kwargs['msg']) 26 | 27 | 28 | class GcpKmsFilter(): 29 | def run(self, method, **kwargs): 30 | params = { 31 | 'ciphertext': kwargs.get('ciphertext', None), 32 | 'plaintext': kwargs.get('plaintext', None), 33 | 'additional_authenticated_data': kwargs.get('additional_authenticated_data', None), 34 | 'key_ring': kwargs.get('key_ring', None), 35 | 'crypto_key': kwargs.get('crypto_key', None), 36 | 'projects': kwargs.get('projects', None), 37 | 'scopes': kwargs.get('scopes', None), 38 | 'locations': kwargs.get('locations', 'global'), 39 | 'auth_kind': kwargs.get('auth_kind', None), 40 | 'service_account_file': kwargs.get('service_account_file', None), 41 | 'service_account_email': kwargs.get('service_account_email', None), 42 | } 43 | if not params['scopes']: 44 | params['scopes'] = ['https://www.googleapis.com/auth/cloudkms'] 45 | fake_module = GcpMockModule(params) 46 | if method == "encrypt": 47 | return self.kms_encrypt(fake_module) 48 | elif method == "decrypt": 49 | return self.kms_decrypt(fake_module) 50 | 51 | def kms_decrypt(self, module): 52 | payload = {"ciphertext": module.params['ciphertext']} 53 | 54 | if module.params['additional_authenticated_data']: 55 | payload['additionalAuthenticatedData'] = module.params['additional_authenticated_data'] 56 | 57 | auth = GcpSession(module, 'cloudkms') 58 | url = "https://cloudkms.googleapis.com/v1/projects/{projects}/locations/{locations}/" \ 59 | "keyRings/{key_ring}/cryptoKeys/{crypto_key}:decrypt".format(**module.params) 60 | response = auth.post(url, body=payload) 61 | return response.json()['plaintext'] 62 | 63 | def kms_encrypt(self, module): 64 | payload = {"plaintext": module.params['plaintext']} 65 | 66 | if module.params['additional_authenticated_data']: 67 | payload['additionalAuthenticatedData'] = module.params['additional_authenticated_data'] 68 | 69 | auth = GcpSession(module, 'cloudkms') 70 | url = "https://cloudkms.googleapis.com/v1/projects/{projects}/locations/{locations}/" \ 71 | "keyRings/{key_ring}/cryptoKeys/{crypto_key}:encrypt".format(**module.params) 72 | response = auth.post(url, body=payload) 73 | return response.json()['ciphertext'] 74 | 75 | 76 | def gcp_kms_encrypt(plaintext, **kwargs): 77 | return GcpKmsFilter().run('encrypt', plaintext=plaintext, **kwargs) 78 | 79 | 80 | def gcp_kms_decrypt(ciphertext, **kwargs): 81 | return GcpKmsFilter().run('decrypt', ciphertext=ciphertext, **kwargs) 82 | 83 | 84 | class FilterModule(object): 85 | 86 | def filters(self): 87 | return { 88 | 'gcp_kms_encrypt': gcp_kms_encrypt, 89 | 'gcp_kms_decrypt': gcp_kms_decrypt 90 | } 91 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_storage_bucket_access_control/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: create a bucket 17 | google.cloud.gcp_storage_bucket: 18 | name: "{{ resource_name }}" 19 | project: "{{ gcp_project }}" 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | state: present 23 | register: bucket 24 | - name: delete a bucket access control 25 | google.cloud.gcp_storage_bucket_access_control: 26 | bucket: "{{ bucket }}" 27 | entity: user-alexstephen@google.com 28 | role: WRITER 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: absent 33 | #---------------------------------------------------------- 34 | - name: create a bucket access control 35 | google.cloud.gcp_storage_bucket_access_control: 36 | bucket: "{{ bucket }}" 37 | entity: user-alexstephen@google.com 38 | role: WRITER 39 | project: "{{ gcp_project }}" 40 | auth_kind: "{{ gcp_cred_kind }}" 41 | service_account_file: "{{ gcp_cred_file }}" 42 | state: present 43 | register: result 44 | - name: assert changed is true 45 | assert: 46 | that: 47 | - result.changed == true 48 | # ---------------------------------------------------------------------------- 49 | - name: create a bucket access control that already exists 50 | google.cloud.gcp_storage_bucket_access_control: 51 | bucket: "{{ bucket }}" 52 | entity: user-alexstephen@google.com 53 | role: WRITER 54 | project: "{{ gcp_project }}" 55 | auth_kind: "{{ gcp_cred_kind }}" 56 | service_account_file: "{{ gcp_cred_file }}" 57 | state: present 58 | register: result 59 | - name: assert changed is false 60 | assert: 61 | that: 62 | - result.changed == false 63 | #---------------------------------------------------------- 64 | - name: delete a bucket access control 65 | google.cloud.gcp_storage_bucket_access_control: 66 | bucket: "{{ bucket }}" 67 | entity: user-alexstephen@google.com 68 | role: WRITER 69 | project: "{{ gcp_project }}" 70 | auth_kind: "{{ gcp_cred_kind }}" 71 | service_account_file: "{{ gcp_cred_file }}" 72 | state: absent 73 | register: result 74 | - name: assert changed is true 75 | assert: 76 | that: 77 | - result.changed == true 78 | # ---------------------------------------------------------------------------- 79 | - name: delete a bucket access control that does not exist 80 | google.cloud.gcp_storage_bucket_access_control: 81 | bucket: "{{ bucket }}" 82 | entity: user-alexstephen@google.com 83 | role: WRITER 84 | project: "{{ gcp_project }}" 85 | auth_kind: "{{ gcp_cred_kind }}" 86 | service_account_file: "{{ gcp_cred_file }}" 87 | state: absent 88 | register: result 89 | - name: assert changed is false 90 | assert: 91 | that: 92 | - result.changed == false 93 | #--------------------------------------------------------- 94 | # Post-test teardown 95 | # If errors happen, don't crash the playbook! 96 | - name: delete a bucket 97 | google.cloud.gcp_storage_bucket: 98 | name: "{{ resource_name }}" 99 | project: "{{ gcp_project }}" 100 | auth_kind: "{{ gcp_cred_kind }}" 101 | service_account_file: "{{ gcp_cred_file }}" 102 | state: absent 103 | register: bucket 104 | ignore_errors: true 105 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_appengine_firewall_rule/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a firewall rule 17 | google.cloud.gcp_appengine_firewall_rule: 18 | priority: 1000 19 | source_range: 10.0.0.0 20 | action: ALLOW 21 | project: "{{ gcp_project }}" 22 | auth_kind: "{{ gcp_cred_kind }}" 23 | service_account_file: "{{ gcp_cred_file }}" 24 | state: absent 25 | #---------------------------------------------------------- 26 | - name: create a firewall rule 27 | google.cloud.gcp_appengine_firewall_rule: 28 | priority: 1000 29 | source_range: 10.0.0.0 30 | action: ALLOW 31 | project: "{{ gcp_project }}" 32 | auth_kind: "{{ gcp_cred_kind }}" 33 | service_account_file: "{{ gcp_cred_file }}" 34 | state: present 35 | register: result 36 | - name: assert changed is true 37 | assert: 38 | that: 39 | - result.changed == true 40 | - name: verify that firewall_rule was created 41 | google.cloud.gcp_appengine_firewall_rule_info: 42 | project: "{{ gcp_project }}" 43 | auth_kind: "{{ gcp_cred_kind }}" 44 | service_account_file: "{{ gcp_cred_file }}" 45 | scopes: 46 | - https://www.googleapis.com/auth/cloud-platform 47 | register: results 48 | - name: verify that command succeeded 49 | assert: 50 | that: 51 | - results['resources'] | length >= 1 52 | # ---------------------------------------------------------------------------- 53 | - name: create a firewall rule that already exists 54 | google.cloud.gcp_appengine_firewall_rule: 55 | priority: 1000 56 | source_range: 10.0.0.0 57 | action: ALLOW 58 | project: "{{ gcp_project }}" 59 | auth_kind: "{{ gcp_cred_kind }}" 60 | service_account_file: "{{ gcp_cred_file }}" 61 | state: present 62 | register: result 63 | - name: assert changed is false 64 | assert: 65 | that: 66 | - result.changed == false 67 | #---------------------------------------------------------- 68 | - name: delete a firewall rule 69 | google.cloud.gcp_appengine_firewall_rule: 70 | priority: 1000 71 | source_range: 10.0.0.0 72 | action: ALLOW 73 | project: "{{ gcp_project }}" 74 | auth_kind: "{{ gcp_cred_kind }}" 75 | service_account_file: "{{ gcp_cred_file }}" 76 | state: absent 77 | register: result 78 | - name: assert changed is true 79 | assert: 80 | that: 81 | - result.changed == true 82 | - name: verify that firewall_rule was deleted 83 | google.cloud.gcp_appengine_firewall_rule_info: 84 | project: "{{ gcp_project }}" 85 | auth_kind: "{{ gcp_cred_kind }}" 86 | service_account_file: "{{ gcp_cred_file }}" 87 | scopes: 88 | - https://www.googleapis.com/auth/cloud-platform 89 | register: results 90 | - name: verify that command succeeded 91 | assert: 92 | that: 93 | - results['resources'] | length == 0 94 | # ---------------------------------------------------------------------------- 95 | - name: delete a firewall rule that does not exist 96 | google.cloud.gcp_appengine_firewall_rule: 97 | priority: 1000 98 | source_range: 10.0.0.0 99 | action: ALLOW 100 | project: "{{ gcp_project }}" 101 | auth_kind: "{{ gcp_cred_kind }}" 102 | service_account_file: "{{ gcp_cred_file }}" 103 | state: absent 104 | register: result 105 | - name: assert changed is false 106 | assert: 107 | that: 108 | - result.changed == false 109 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_network/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a network 17 | google.cloud.gcp_compute_network: 18 | name: "{{ resource_name }}" 19 | auto_create_subnetworks: 'true' 20 | project: "{{ gcp_project }}" 21 | auth_kind: "{{ gcp_cred_kind }}" 22 | service_account_file: "{{ gcp_cred_file }}" 23 | state: absent 24 | #---------------------------------------------------------- 25 | - name: create a network 26 | google.cloud.gcp_compute_network: 27 | name: "{{ resource_name }}" 28 | auto_create_subnetworks: 'true' 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: present 33 | register: result 34 | - name: assert changed is true 35 | assert: 36 | that: 37 | - result.changed == true 38 | - name: verify that network was created 39 | google.cloud.gcp_compute_network_info: 40 | filters: 41 | - name = {{ resource_name }} 42 | project: "{{ gcp_project }}" 43 | auth_kind: "{{ gcp_cred_kind }}" 44 | service_account_file: "{{ gcp_cred_file }}" 45 | scopes: 46 | - https://www.googleapis.com/auth/compute 47 | register: results 48 | - name: verify that command succeeded 49 | assert: 50 | that: 51 | - results['resources'] | length == 1 52 | # ---------------------------------------------------------------------------- 53 | - name: create a network that already exists 54 | google.cloud.gcp_compute_network: 55 | name: "{{ resource_name }}" 56 | auto_create_subnetworks: 'true' 57 | project: "{{ gcp_project }}" 58 | auth_kind: "{{ gcp_cred_kind }}" 59 | service_account_file: "{{ gcp_cred_file }}" 60 | state: present 61 | register: result 62 | - name: assert changed is false 63 | assert: 64 | that: 65 | - result.changed == false 66 | #---------------------------------------------------------- 67 | - name: delete a network 68 | google.cloud.gcp_compute_network: 69 | name: "{{ resource_name }}" 70 | auto_create_subnetworks: 'true' 71 | project: "{{ gcp_project }}" 72 | auth_kind: "{{ gcp_cred_kind }}" 73 | service_account_file: "{{ gcp_cred_file }}" 74 | state: absent 75 | register: result 76 | - name: assert changed is true 77 | assert: 78 | that: 79 | - result.changed == true 80 | - name: verify that network was deleted 81 | google.cloud.gcp_compute_network_info: 82 | filters: 83 | - name = {{ resource_name }} 84 | project: "{{ gcp_project }}" 85 | auth_kind: "{{ gcp_cred_kind }}" 86 | service_account_file: "{{ gcp_cred_file }}" 87 | scopes: 88 | - https://www.googleapis.com/auth/compute 89 | register: results 90 | - name: verify that command succeeded 91 | assert: 92 | that: 93 | - results['resources'] | length == 0 94 | # ---------------------------------------------------------------------------- 95 | - name: delete a network that does not exist 96 | google.cloud.gcp_compute_network: 97 | name: "{{ resource_name }}" 98 | auto_create_subnetworks: 'true' 99 | project: "{{ gcp_project }}" 100 | auth_kind: "{{ gcp_cred_kind }}" 101 | service_account_file: "{{ gcp_cred_file }}" 102 | state: absent 103 | register: result 104 | - name: assert changed is false 105 | assert: 106 | that: 107 | - result.changed == false 108 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_runtimeconfig_config/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a config 17 | google.cloud.gcp_runtimeconfig_config: 18 | name: "{{ resource_name }}" 19 | description: My config 20 | project: "{{ gcp_project }}" 21 | auth_kind: "{{ gcp_cred_kind }}" 22 | service_account_file: "{{ gcp_cred_file }}" 23 | state: absent 24 | #---------------------------------------------------------- 25 | - name: create a config 26 | google.cloud.gcp_runtimeconfig_config: 27 | name: "{{ resource_name }}" 28 | description: My config 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: present 33 | register: result 34 | - name: assert changed is true 35 | assert: 36 | that: 37 | - result.changed == true 38 | - name: verify that config was created 39 | google.cloud.gcp_runtimeconfig_config_info: 40 | project: "{{ gcp_project }}" 41 | auth_kind: "{{ gcp_cred_kind }}" 42 | service_account_file: "{{ gcp_cred_file }}" 43 | scopes: 44 | - https://www.googleapis.com/auth/cloudruntimeconfig 45 | register: results 46 | - name: verify that command succeeded 47 | assert: 48 | that: 49 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 50 | # ---------------------------------------------------------------------------- 51 | - name: create a config that already exists 52 | google.cloud.gcp_runtimeconfig_config: 53 | name: "{{ resource_name }}" 54 | description: My config 55 | project: "{{ gcp_project }}" 56 | auth_kind: "{{ gcp_cred_kind }}" 57 | service_account_file: "{{ gcp_cred_file }}" 58 | state: present 59 | register: result 60 | - name: assert changed is false 61 | assert: 62 | that: 63 | - result.changed == false 64 | #---------------------------------------------------------- 65 | - name: delete a config 66 | google.cloud.gcp_runtimeconfig_config: 67 | name: "{{ resource_name }}" 68 | description: My config 69 | project: "{{ gcp_project }}" 70 | auth_kind: "{{ gcp_cred_kind }}" 71 | service_account_file: "{{ gcp_cred_file }}" 72 | state: absent 73 | register: result 74 | - name: assert changed is true 75 | assert: 76 | that: 77 | - result.changed == true 78 | - name: verify that config was deleted 79 | google.cloud.gcp_runtimeconfig_config_info: 80 | project: "{{ gcp_project }}" 81 | auth_kind: "{{ gcp_cred_kind }}" 82 | service_account_file: "{{ gcp_cred_file }}" 83 | scopes: 84 | - https://www.googleapis.com/auth/cloudruntimeconfig 85 | register: results 86 | - name: verify that command succeeded 87 | assert: 88 | that: 89 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 90 | # ---------------------------------------------------------------------------- 91 | - name: delete a config that does not exist 92 | google.cloud.gcp_runtimeconfig_config: 93 | name: "{{ resource_name }}" 94 | description: My config 95 | project: "{{ gcp_project }}" 96 | auth_kind: "{{ gcp_cred_kind }}" 97 | service_account_file: "{{ gcp_cred_file }}" 98 | state: absent 99 | register: result 100 | - name: assert changed is false 101 | assert: 102 | that: 103 | - result.changed == false 104 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_target_pool/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a target pool 17 | google.cloud.gcp_compute_target_pool: 18 | name: "{{ resource_name }}" 19 | region: us-west1 20 | project: "{{ gcp_project }}" 21 | auth_kind: "{{ gcp_cred_kind }}" 22 | service_account_file: "{{ gcp_cred_file }}" 23 | state: absent 24 | #---------------------------------------------------------- 25 | - name: create a target pool 26 | google.cloud.gcp_compute_target_pool: 27 | name: "{{ resource_name }}" 28 | region: us-west1 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: present 33 | register: result 34 | - name: assert changed is true 35 | assert: 36 | that: 37 | - result.changed == true 38 | - name: verify that target_pool was created 39 | google.cloud.gcp_compute_target_pool_info: 40 | filters: 41 | - name = {{ resource_name }} 42 | region: us-west1 43 | project: "{{ gcp_project }}" 44 | auth_kind: "{{ gcp_cred_kind }}" 45 | service_account_file: "{{ gcp_cred_file }}" 46 | scopes: 47 | - https://www.googleapis.com/auth/compute 48 | register: results 49 | - name: verify that command succeeded 50 | assert: 51 | that: 52 | - results['resources'] | length == 1 53 | # ---------------------------------------------------------------------------- 54 | - name: create a target pool that already exists 55 | google.cloud.gcp_compute_target_pool: 56 | name: "{{ resource_name }}" 57 | region: us-west1 58 | project: "{{ gcp_project }}" 59 | auth_kind: "{{ gcp_cred_kind }}" 60 | service_account_file: "{{ gcp_cred_file }}" 61 | state: present 62 | register: result 63 | - name: assert changed is false 64 | assert: 65 | that: 66 | - result.changed == false 67 | #---------------------------------------------------------- 68 | - name: delete a target pool 69 | google.cloud.gcp_compute_target_pool: 70 | name: "{{ resource_name }}" 71 | region: us-west1 72 | project: "{{ gcp_project }}" 73 | auth_kind: "{{ gcp_cred_kind }}" 74 | service_account_file: "{{ gcp_cred_file }}" 75 | state: absent 76 | register: result 77 | - name: assert changed is true 78 | assert: 79 | that: 80 | - result.changed == true 81 | - name: verify that target_pool was deleted 82 | google.cloud.gcp_compute_target_pool_info: 83 | filters: 84 | - name = {{ resource_name }} 85 | region: us-west1 86 | project: "{{ gcp_project }}" 87 | auth_kind: "{{ gcp_cred_kind }}" 88 | service_account_file: "{{ gcp_cred_file }}" 89 | scopes: 90 | - https://www.googleapis.com/auth/compute 91 | register: results 92 | - name: verify that command succeeded 93 | assert: 94 | that: 95 | - results['resources'] | length == 0 96 | # ---------------------------------------------------------------------------- 97 | - name: delete a target pool that does not exist 98 | google.cloud.gcp_compute_target_pool: 99 | name: "{{ resource_name }}" 100 | region: us-west1 101 | project: "{{ gcp_project }}" 102 | auth_kind: "{{ gcp_cred_kind }}" 103 | service_account_file: "{{ gcp_cred_file }}" 104 | state: absent 105 | register: result 106 | - name: assert changed is false 107 | assert: 108 | that: 109 | - result.changed == false 110 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_cloudtasks_queue/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a queue 17 | google.cloud.gcp_cloudtasks_queue: 18 | name: "{{ resource_name }}" 19 | location: us-central1 20 | project: "{{ gcp_project }}" 21 | auth_kind: "{{ gcp_cred_kind }}" 22 | service_account_file: "{{ gcp_cred_file }}" 23 | state: absent 24 | #---------------------------------------------------------- 25 | - name: create a queue 26 | google.cloud.gcp_cloudtasks_queue: 27 | name: "{{ resource_name }}" 28 | location: us-central1 29 | project: "{{ gcp_project }}" 30 | auth_kind: "{{ gcp_cred_kind }}" 31 | service_account_file: "{{ gcp_cred_file }}" 32 | state: present 33 | register: result 34 | - name: assert changed is true 35 | assert: 36 | that: 37 | - result.changed == true 38 | - name: verify that queue was created 39 | google.cloud.gcp_cloudtasks_queue_info: 40 | location: us-central1 41 | project: "{{ gcp_project }}" 42 | auth_kind: "{{ gcp_cred_kind }}" 43 | service_account_file: "{{ gcp_cred_file }}" 44 | scopes: 45 | - https://www.googleapis.com/auth/cloud-platform 46 | register: results 47 | - name: verify that command succeeded 48 | assert: 49 | that: 50 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 51 | # ---------------------------------------------------------------------------- 52 | - name: create a queue that already exists 53 | google.cloud.gcp_cloudtasks_queue: 54 | name: "{{ resource_name }}" 55 | location: us-central1 56 | project: "{{ gcp_project }}" 57 | auth_kind: "{{ gcp_cred_kind }}" 58 | service_account_file: "{{ gcp_cred_file }}" 59 | state: present 60 | register: result 61 | - name: assert changed is false 62 | assert: 63 | that: 64 | - result.changed == false 65 | #---------------------------------------------------------- 66 | - name: delete a queue 67 | google.cloud.gcp_cloudtasks_queue: 68 | name: "{{ resource_name }}" 69 | location: us-central1 70 | project: "{{ gcp_project }}" 71 | auth_kind: "{{ gcp_cred_kind }}" 72 | service_account_file: "{{ gcp_cred_file }}" 73 | state: absent 74 | register: result 75 | - name: assert changed is true 76 | assert: 77 | that: 78 | - result.changed == true 79 | - name: verify that queue was deleted 80 | google.cloud.gcp_cloudtasks_queue_info: 81 | location: us-central1 82 | project: "{{ gcp_project }}" 83 | auth_kind: "{{ gcp_cred_kind }}" 84 | service_account_file: "{{ gcp_cred_file }}" 85 | scopes: 86 | - https://www.googleapis.com/auth/cloud-platform 87 | register: results 88 | - name: verify that command succeeded 89 | assert: 90 | that: 91 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 92 | # ---------------------------------------------------------------------------- 93 | - name: delete a queue that does not exist 94 | google.cloud.gcp_cloudtasks_queue: 95 | name: "{{ resource_name }}" 96 | location: us-central1 97 | project: "{{ gcp_project }}" 98 | auth_kind: "{{ gcp_cred_kind }}" 99 | service_account_file: "{{ gcp_cred_file }}" 100 | state: absent 101 | register: result 102 | - name: assert changed is false 103 | assert: 104 | that: 105 | - result.changed == false 106 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_dns_managed_zone/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a managed zone 17 | google.cloud.gcp_dns_managed_zone: 18 | name: "{{ resource_name }}" 19 | dns_name: test.somewild2.example.com. 20 | description: test zone 21 | project: "{{ gcp_project }}" 22 | auth_kind: "{{ gcp_cred_kind }}" 23 | service_account_file: "{{ gcp_cred_file }}" 24 | state: absent 25 | #---------------------------------------------------------- 26 | - name: create a managed zone 27 | google.cloud.gcp_dns_managed_zone: 28 | name: "{{ resource_name }}" 29 | dns_name: test.somewild2.example.com. 30 | description: test zone 31 | project: "{{ gcp_project }}" 32 | auth_kind: "{{ gcp_cred_kind }}" 33 | service_account_file: "{{ gcp_cred_file }}" 34 | state: present 35 | register: result 36 | - name: assert changed is true 37 | assert: 38 | that: 39 | - result.changed == true 40 | - name: verify that managed_zone was created 41 | google.cloud.gcp_dns_managed_zone_info: 42 | dns_name: test.somewild2.example.com. 43 | project: "{{ gcp_project }}" 44 | auth_kind: "{{ gcp_cred_kind }}" 45 | service_account_file: "{{ gcp_cred_file }}" 46 | scopes: 47 | - https://www.googleapis.com/auth/ndev.clouddns.readwrite 48 | register: results 49 | - name: verify that command succeeded 50 | assert: 51 | that: 52 | - results['resources'] | length == 1 53 | # ---------------------------------------------------------------------------- 54 | - name: create a managed zone that already exists 55 | google.cloud.gcp_dns_managed_zone: 56 | name: "{{ resource_name }}" 57 | dns_name: test.somewild2.example.com. 58 | description: test zone 59 | project: "{{ gcp_project }}" 60 | auth_kind: "{{ gcp_cred_kind }}" 61 | service_account_file: "{{ gcp_cred_file }}" 62 | state: present 63 | register: result 64 | - name: assert changed is false 65 | assert: 66 | that: 67 | - result.changed == false 68 | #---------------------------------------------------------- 69 | - name: delete a managed zone 70 | google.cloud.gcp_dns_managed_zone: 71 | name: "{{ resource_name }}" 72 | dns_name: test.somewild2.example.com. 73 | description: test zone 74 | project: "{{ gcp_project }}" 75 | auth_kind: "{{ gcp_cred_kind }}" 76 | service_account_file: "{{ gcp_cred_file }}" 77 | state: absent 78 | register: result 79 | - name: assert changed is true 80 | assert: 81 | that: 82 | - result.changed == true 83 | - name: verify that managed_zone was deleted 84 | google.cloud.gcp_dns_managed_zone_info: 85 | dns_name: test.somewild2.example.com. 86 | project: "{{ gcp_project }}" 87 | auth_kind: "{{ gcp_cred_kind }}" 88 | service_account_file: "{{ gcp_cred_file }}" 89 | scopes: 90 | - https://www.googleapis.com/auth/ndev.clouddns.readwrite 91 | register: results 92 | - name: verify that command succeeded 93 | assert: 94 | that: 95 | - results['resources'] | length == 0 96 | # ---------------------------------------------------------------------------- 97 | - name: delete a managed zone that does not exist 98 | google.cloud.gcp_dns_managed_zone: 99 | name: "{{ resource_name }}" 100 | dns_name: test.somewild2.example.com. 101 | description: test zone 102 | project: "{{ gcp_project }}" 103 | auth_kind: "{{ gcp_cred_kind }}" 104 | service_account_file: "{{ gcp_cred_file }}" 105 | state: absent 106 | register: result 107 | - name: assert changed is false 108 | assert: 109 | that: 110 | - result.changed == false 111 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_bigquery_dataset/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a dataset 17 | google.cloud.gcp_bigquery_dataset: 18 | name: my_example_dataset 19 | dataset_reference: 20 | dataset_id: my_example_dataset 21 | project: "{{ gcp_project }}" 22 | auth_kind: "{{ gcp_cred_kind }}" 23 | service_account_file: "{{ gcp_cred_file }}" 24 | state: absent 25 | #---------------------------------------------------------- 26 | - name: create a dataset 27 | google.cloud.gcp_bigquery_dataset: 28 | name: my_example_dataset 29 | dataset_reference: 30 | dataset_id: my_example_dataset 31 | project: "{{ gcp_project }}" 32 | auth_kind: "{{ gcp_cred_kind }}" 33 | service_account_file: "{{ gcp_cred_file }}" 34 | state: present 35 | register: result 36 | - name: assert changed is true 37 | assert: 38 | that: 39 | - result.changed == true 40 | - name: verify that dataset was created 41 | google.cloud.gcp_bigquery_dataset_info: 42 | project: "{{ gcp_project }}" 43 | auth_kind: "{{ gcp_cred_kind }}" 44 | service_account_file: "{{ gcp_cred_file }}" 45 | scopes: 46 | - https://www.googleapis.com/auth/bigquery 47 | register: results 48 | - name: verify that command succeeded 49 | assert: 50 | that: 51 | - results['resources'] | map(attribute='datasetReference') | map(attribute='datasetId') | select("match", ".*my_example_dataset.*") | list | length == 1 52 | # ---------------------------------------------------------------------------- 53 | - name: create a dataset that already exists 54 | google.cloud.gcp_bigquery_dataset: 55 | name: my_example_dataset 56 | dataset_reference: 57 | dataset_id: my_example_dataset 58 | project: "{{ gcp_project }}" 59 | auth_kind: "{{ gcp_cred_kind }}" 60 | service_account_file: "{{ gcp_cred_file }}" 61 | state: present 62 | register: result 63 | - name: assert changed is false 64 | assert: 65 | that: 66 | - result.changed == false 67 | #---------------------------------------------------------- 68 | - name: delete a dataset 69 | google.cloud.gcp_bigquery_dataset: 70 | name: my_example_dataset 71 | dataset_reference: 72 | dataset_id: my_example_dataset 73 | project: "{{ gcp_project }}" 74 | auth_kind: "{{ gcp_cred_kind }}" 75 | service_account_file: "{{ gcp_cred_file }}" 76 | state: absent 77 | register: result 78 | - name: assert changed is true 79 | assert: 80 | that: 81 | - result.changed == true 82 | - name: verify that dataset was deleted 83 | google.cloud.gcp_bigquery_dataset_info: 84 | project: "{{ gcp_project }}" 85 | auth_kind: "{{ gcp_cred_kind }}" 86 | service_account_file: "{{ gcp_cred_file }}" 87 | scopes: 88 | - https://www.googleapis.com/auth/bigquery 89 | register: results 90 | - name: verify that command succeeded 91 | assert: 92 | that: 93 | - results['resources'] | map(attribute='datasetReference') | map(attribute='datasetId') | select("match", ".*my_example_dataset.*") | list | length == 0 94 | # ---------------------------------------------------------------------------- 95 | - name: delete a dataset that does not exist 96 | google.cloud.gcp_bigquery_dataset: 97 | name: my_example_dataset 98 | dataset_reference: 99 | dataset_id: my_example_dataset 100 | project: "{{ gcp_project }}" 101 | auth_kind: "{{ gcp_cred_kind }}" 102 | service_account_file: "{{ gcp_cred_file }}" 103 | state: absent 104 | register: result 105 | - name: assert changed is false 106 | assert: 107 | that: 108 | - result.changed == false 109 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_compute_node_template/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a node template 17 | google.cloud.gcp_compute_node_template: 18 | name: "{{ resource_name }}" 19 | region: us-central1 20 | node_type: n1-node-96-624 21 | project: "{{ gcp_project }}" 22 | auth_kind: "{{ gcp_cred_kind }}" 23 | service_account_file: "{{ gcp_cred_file }}" 24 | state: absent 25 | #---------------------------------------------------------- 26 | - name: create a node template 27 | google.cloud.gcp_compute_node_template: 28 | name: "{{ resource_name }}" 29 | region: us-central1 30 | node_type: n1-node-96-624 31 | project: "{{ gcp_project }}" 32 | auth_kind: "{{ gcp_cred_kind }}" 33 | service_account_file: "{{ gcp_cred_file }}" 34 | state: present 35 | register: result 36 | - name: assert changed is true 37 | assert: 38 | that: 39 | - result.changed == true 40 | - name: verify that node_template was created 41 | google.cloud.gcp_compute_node_template_info: 42 | filters: 43 | - name = {{ resource_name }} 44 | region: us-central1 45 | project: "{{ gcp_project }}" 46 | auth_kind: "{{ gcp_cred_kind }}" 47 | service_account_file: "{{ gcp_cred_file }}" 48 | scopes: 49 | - https://www.googleapis.com/auth/compute 50 | register: results 51 | - name: verify that command succeeded 52 | assert: 53 | that: 54 | - results['resources'] | length == 1 55 | # ---------------------------------------------------------------------------- 56 | - name: create a node template that already exists 57 | google.cloud.gcp_compute_node_template: 58 | name: "{{ resource_name }}" 59 | region: us-central1 60 | node_type: n1-node-96-624 61 | project: "{{ gcp_project }}" 62 | auth_kind: "{{ gcp_cred_kind }}" 63 | service_account_file: "{{ gcp_cred_file }}" 64 | state: present 65 | register: result 66 | - name: assert changed is false 67 | assert: 68 | that: 69 | - result.changed == false 70 | #---------------------------------------------------------- 71 | - name: delete a node template 72 | google.cloud.gcp_compute_node_template: 73 | name: "{{ resource_name }}" 74 | region: us-central1 75 | node_type: n1-node-96-624 76 | project: "{{ gcp_project }}" 77 | auth_kind: "{{ gcp_cred_kind }}" 78 | service_account_file: "{{ gcp_cred_file }}" 79 | state: absent 80 | register: result 81 | - name: assert changed is true 82 | assert: 83 | that: 84 | - result.changed == true 85 | - name: verify that node_template was deleted 86 | google.cloud.gcp_compute_node_template_info: 87 | filters: 88 | - name = {{ resource_name }} 89 | region: us-central1 90 | project: "{{ gcp_project }}" 91 | auth_kind: "{{ gcp_cred_kind }}" 92 | service_account_file: "{{ gcp_cred_file }}" 93 | scopes: 94 | - https://www.googleapis.com/auth/compute 95 | register: results 96 | - name: verify that command succeeded 97 | assert: 98 | that: 99 | - results['resources'] | length == 0 100 | # ---------------------------------------------------------------------------- 101 | - name: delete a node template that does not exist 102 | google.cloud.gcp_compute_node_template: 103 | name: "{{ resource_name }}" 104 | region: us-central1 105 | node_type: n1-node-96-624 106 | project: "{{ gcp_project }}" 107 | auth_kind: "{{ gcp_cred_kind }}" 108 | service_account_file: "{{ gcp_cred_file }}" 109 | state: absent 110 | register: result 111 | - name: assert changed is false 112 | assert: 113 | that: 114 | - result.changed == false 115 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_resourcemanager_project/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a project 17 | google.cloud.gcp_resourcemanager_project: 18 | name: My Sample Project 19 | id: alextest-{{ 10000000000 | random }} 20 | auth_kind: "{{ gcp_cred_kind }}" 21 | service_account_file: "{{ gcp_cred_file }}" 22 | parent: 23 | type: organization 24 | id: 636173955921 25 | state: absent 26 | #---------------------------------------------------------- 27 | - name: create a project 28 | google.cloud.gcp_resourcemanager_project: 29 | name: My Sample Project 30 | id: alextest-{{ 10000000000 | random }} 31 | auth_kind: "{{ gcp_cred_kind }}" 32 | service_account_file: "{{ gcp_cred_file }}" 33 | parent: 34 | type: organization 35 | id: 636173955921 36 | state: present 37 | register: result 38 | - name: assert changed is true 39 | assert: 40 | that: 41 | - result.changed == true 42 | - name: verify that project was created 43 | google.cloud.gcp_resourcemanager_project_info: 44 | project: "{{ gcp_project }}" 45 | auth_kind: "{{ gcp_cred_kind }}" 46 | service_account_file: "{{ gcp_cred_file }}" 47 | scopes: 48 | - https://www.googleapis.com/auth/cloud-platform 49 | register: results 50 | - name: verify that command succeeded 51 | assert: 52 | that: 53 | - results['resources'] | map(attribute='name') | select("match", ".*My Sample Project.*") | list | length == 1 54 | # ---------------------------------------------------------------------------- 55 | - name: create a project that already exists 56 | google.cloud.gcp_resourcemanager_project: 57 | name: My Sample Project 58 | id: alextest-{{ 10000000000 | random }} 59 | auth_kind: "{{ gcp_cred_kind }}" 60 | service_account_file: "{{ gcp_cred_file }}" 61 | parent: 62 | type: organization 63 | id: 636173955921 64 | state: present 65 | register: result 66 | - name: assert changed is false 67 | assert: 68 | that: 69 | - result.changed == false 70 | #---------------------------------------------------------- 71 | - name: delete a project 72 | google.cloud.gcp_resourcemanager_project: 73 | name: My Sample Project 74 | id: alextest-{{ 10000000000 | random }} 75 | auth_kind: "{{ gcp_cred_kind }}" 76 | service_account_file: "{{ gcp_cred_file }}" 77 | parent: 78 | type: organization 79 | id: 636173955921 80 | state: absent 81 | register: result 82 | - name: assert changed is true 83 | assert: 84 | that: 85 | - result.changed == true 86 | - name: verify that project was deleted 87 | google.cloud.gcp_resourcemanager_project_info: 88 | project: "{{ gcp_project }}" 89 | auth_kind: "{{ gcp_cred_kind }}" 90 | service_account_file: "{{ gcp_cred_file }}" 91 | scopes: 92 | - https://www.googleapis.com/auth/cloud-platform 93 | register: results 94 | - name: verify that command succeeded 95 | assert: 96 | that: 97 | - results['resources'] | map(attribute='name') | select("match", ".*My Sample Project.*") | list | length == 0 98 | # ---------------------------------------------------------------------------- 99 | - name: delete a project that does not exist 100 | google.cloud.gcp_resourcemanager_project: 101 | name: My Sample Project 102 | id: alextest-{{ 10000000000 | random }} 103 | auth_kind: "{{ gcp_cred_kind }}" 104 | service_account_file: "{{ gcp_cred_file }}" 105 | parent: 106 | type: organization 107 | id: 636173955921 108 | state: absent 109 | register: result 110 | - name: assert changed is false 111 | assert: 112 | that: 113 | - result.changed == false 114 | -------------------------------------------------------------------------------- /tests/integration/targets/gcp_mlengine_model/tasks/autogen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ---------------------------------------------------------------------------- 3 | # 4 | # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** 5 | # 6 | # ---------------------------------------------------------------------------- 7 | # 8 | # This file is automatically generated by Magic Modules and manual 9 | # changes will be clobbered when the file is regenerated. 10 | # 11 | # Please read more about how to change this file at 12 | # https://www.github.com/GoogleCloudPlatform/magic-modules 13 | # 14 | # ---------------------------------------------------------------------------- 15 | # Pre-test setup 16 | - name: delete a model 17 | google.cloud.gcp_mlengine_model: 18 | name: "{{ resource_name | replace('-', '_') }}" 19 | description: My model 20 | regions: 21 | - us-central1 22 | project: "{{ gcp_project }}" 23 | auth_kind: "{{ gcp_cred_kind }}" 24 | service_account_file: "{{ gcp_cred_file }}" 25 | state: absent 26 | #---------------------------------------------------------- 27 | - name: create a model 28 | google.cloud.gcp_mlengine_model: 29 | name: "{{ resource_name | replace('-', '_') }}" 30 | description: My model 31 | regions: 32 | - us-central1 33 | project: "{{ gcp_project }}" 34 | auth_kind: "{{ gcp_cred_kind }}" 35 | service_account_file: "{{ gcp_cred_file }}" 36 | state: present 37 | register: result 38 | - name: assert changed is true 39 | assert: 40 | that: 41 | - result.changed == true 42 | - name: verify that model was created 43 | google.cloud.gcp_mlengine_model_info: 44 | project: "{{ gcp_project }}" 45 | auth_kind: "{{ gcp_cred_kind }}" 46 | service_account_file: "{{ gcp_cred_file }}" 47 | scopes: 48 | - https://www.googleapis.com/auth/cloud-platform 49 | register: results 50 | - name: verify that command succeeded 51 | assert: 52 | that: 53 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name | replace('-', '_') }}.*") | list | length == 1 54 | # ---------------------------------------------------------------------------- 55 | - name: create a model that already exists 56 | google.cloud.gcp_mlengine_model: 57 | name: "{{ resource_name | replace('-', '_') }}" 58 | description: My model 59 | regions: 60 | - us-central1 61 | project: "{{ gcp_project }}" 62 | auth_kind: "{{ gcp_cred_kind }}" 63 | service_account_file: "{{ gcp_cred_file }}" 64 | state: present 65 | register: result 66 | - name: assert changed is false 67 | assert: 68 | that: 69 | - result.changed == false 70 | #---------------------------------------------------------- 71 | - name: delete a model 72 | google.cloud.gcp_mlengine_model: 73 | name: "{{ resource_name | replace('-', '_') }}" 74 | description: My model 75 | regions: 76 | - us-central1 77 | project: "{{ gcp_project }}" 78 | auth_kind: "{{ gcp_cred_kind }}" 79 | service_account_file: "{{ gcp_cred_file }}" 80 | state: absent 81 | register: result 82 | - name: assert changed is true 83 | assert: 84 | that: 85 | - result.changed == true 86 | - name: verify that model was deleted 87 | google.cloud.gcp_mlengine_model_info: 88 | project: "{{ gcp_project }}" 89 | auth_kind: "{{ gcp_cred_kind }}" 90 | service_account_file: "{{ gcp_cred_file }}" 91 | scopes: 92 | - https://www.googleapis.com/auth/cloud-platform 93 | register: results 94 | - name: verify that command succeeded 95 | assert: 96 | that: 97 | - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name | replace('-', '_') }}.*") | list | length == 0 98 | # ---------------------------------------------------------------------------- 99 | - name: delete a model that does not exist 100 | google.cloud.gcp_mlengine_model: 101 | name: "{{ resource_name | replace('-', '_') }}" 102 | description: My model 103 | regions: 104 | - us-central1 105 | project: "{{ gcp_project }}" 106 | auth_kind: "{{ gcp_cred_kind }}" 107 | service_account_file: "{{ gcp_cred_file }}" 108 | state: absent 109 | register: result 110 | - name: assert changed is false 111 | assert: 112 | that: 113 | - result.changed == false 114 | -------------------------------------------------------------------------------- /molecule/gcloud/Dockerfile.j2: -------------------------------------------------------------------------------- 1 | # Molecule managed 2 | 3 | {% if item.registry is defined %} 4 | FROM {{ item.registry.url }}/{{ item.image }} 5 | {% else %} 6 | FROM {{ item.image }} 7 | {% endif %} 8 | ENV container=docker 9 | 10 | {# Initial Package Installs and Container Prep #} 11 | {% if item.image.split(':', 1)[0] in ["ubuntu"] %} 12 | RUN apt-get update \ 13 | && apt-get install -y --no-install-recommends \ 14 | locales software-properties-common rsyslog systemd systemd-cron sudo \ 15 | iproute2 16 | RUN sed -i 's/^\($ModLoad imklog\)/#\1/' /etc/rsyslog.conf 17 | {% elif item.image.split(':', 1)[0] in ["debian"] %} 18 | RUN apt-get update \ 19 | && apt-get install -y --no-install-recommends \ 20 | sudo systemd systemd-sysv \ 21 | build-essential wget 22 | {% elif item.image.split(':', 1)[0] in ["centos"] %} 23 | {% if item.image in ["centos:7"] %} 24 | RUN yum makecache fast && yum -y install deltarpm \ 25 | {% elif item.image in ["centos:8"] %} 26 | RUN yum makecache --timer \ 27 | {% endif %} 28 | && yum -y install epel-release \ 29 | && yum -y update \ 30 | && yum -y install sudo which 31 | {% endif %} 32 | 33 | 34 | {# Install of Python2 #} 35 | {% if item.image in ["ubuntu:16.04"] %} 36 | RUN apt-get update \ 37 | && apt-get install -y --no-install-recommends python-setuptools wget \ 38 | && wget https://bootstrap.pypa.io/get-pip.py \ 39 | && python get-pip.py 40 | {% elif item.image in ["debian:9"] %} 41 | RUN apt-get update \ 42 | && apt-get install -y --no-install-recommends libffi-dev libssl-dev \ 43 | python-pip python-dev python-setuptools python-wheel 44 | {% elif item.image in ["centos:7"] %} 45 | RUN yum -y install python-pip 46 | {% endif %} 47 | 48 | {# Install of Python3 #} 49 | {% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "debian:10"] %} 50 | RUN apt-get update \ 51 | && apt-get install -y --no-install-recommends \ 52 | apt-utils python3-setuptools python3-pip 53 | {% endif %} 54 | {% if item.image in ["centos:8"] %} 55 | RUN yum -y install hostname python3 python3-pip 56 | {% endif %} 57 | 58 | {# Steps for cleanup #} 59 | {% if item.image.split(':', 1)[0] in ["ubuntu", "debian"] %} 60 | RUN rm -Rf /var/lib/apt/lists/* \ 61 | && rm -Rf /usr/share/doc && rm -Rf /usr/share/man \ 62 | && apt-get clean 63 | {% elif item.image.split(':', 1)[0] in ["centos"] %} 64 | RUN yum clean all 65 | {% endif %} 66 | 67 | {# Steps for clenaup of systemd #} 68 | {% if item.image in ["centos:7", "centos:8", "debian:9"] %} 69 | RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ 70 | systemd-tmpfiles-setup.service ] || rm -f $i; done); \ 71 | rm -f /lib/systemd/system/multi-user.target.wants/*;\ 72 | rm -f /etc/systemd/system/*.wants/*;\ 73 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ 74 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ 75 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ 76 | rm -f /lib/systemd/system/basic.target.wants/*;\ 77 | rm -f /lib/systemd/system/anaconda.target.wants/*; \ 78 | mkdir -p /run/systemd/system 79 | {% endif %} 80 | {% if item.image in ["ubuntu:18.04", "ubuntu:20.04"] %} 81 | # Remove unnecessary getty and udev targets that result in high CPU usage when using 82 | # multiple containers with Molecule (https://github.com/ansible/molecule/issues/1104) 83 | RUN rm -f /lib/systemd/system/systemd*udev* \ 84 | && rm -f /lib/systemd/system/getty.target 85 | {% endif %} 86 | 87 | 88 | {% if item.image in ["centos:7", "centos:8"] %} 89 | # Disable requiretty. 90 | RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers 91 | {% endif %} 92 | 93 | {% if item.image.split(':', 1)[0] not in ["centos", "debian"] %} 94 | # Fix potential UTF-8 errors with ansible-test. 95 | RUN locale-gen en_US.UTF-8 96 | {% endif %} 97 | 98 | # Install Ansible inventory file. 99 | RUN mkdir -p /etc/ansible 100 | RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts 101 | 102 | {% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10"] %} 103 | VOLUME ["/sys/fs/cgroup"] 104 | {% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04"] %} 105 | VOLUME ["/sys/fs/cgroup", "/tmp", "/run"] 106 | {% endif %} 107 | {% if item.image in ["centos:7", "centos:8"] %} 108 | CMD ["/usr/sbin/init"] 109 | {% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "debian:9", "debian:10"] %} 110 | CMD ["/lib/systemd/systemd"] 111 | {% endif %} 112 | -------------------------------------------------------------------------------- /molecule/gcsfuse/Dockerfile.j2: -------------------------------------------------------------------------------- 1 | # Molecule managed 2 | 3 | {% if item.registry is defined %} 4 | FROM {{ item.registry.url }}/{{ item.image }} 5 | {% else %} 6 | FROM {{ item.image }} 7 | {% endif %} 8 | ENV container=docker 9 | 10 | {# Initial Package Installs and Container Prep #} 11 | {% if item.image.split(':', 1)[0] in ["ubuntu"] %} 12 | RUN apt-get update \ 13 | && apt-get install -y --no-install-recommends \ 14 | locales software-properties-common rsyslog systemd systemd-cron sudo \ 15 | iproute2 16 | RUN sed -i 's/^\($ModLoad imklog\)/#\1/' /etc/rsyslog.conf 17 | {% elif item.image.split(':', 1)[0] in ["debian"] %} 18 | RUN apt-get update \ 19 | && apt-get install -y --no-install-recommends \ 20 | sudo systemd systemd-sysv \ 21 | build-essential wget 22 | {% elif item.image.split(':', 1)[0] in ["centos"] %} 23 | {% if item.image in ["centos:7"] %} 24 | RUN yum makecache fast && yum -y install deltarpm \ 25 | {% elif item.image in ["centos:8"] %} 26 | RUN yum makecache --timer \ 27 | {% endif %} 28 | && yum -y install epel-release \ 29 | && yum -y update \ 30 | && yum -y install sudo which 31 | {% endif %} 32 | 33 | 34 | {# Install of Python2 #} 35 | {% if item.image in ["ubuntu:16.04"] %} 36 | RUN apt-get update \ 37 | && apt-get install -y --no-install-recommends python-setuptools wget \ 38 | && wget https://bootstrap.pypa.io/get-pip.py \ 39 | && python get-pip.py 40 | {% elif item.image in ["debian:9"] %} 41 | RUN apt-get update \ 42 | && apt-get install -y --no-install-recommends libffi-dev libssl-dev \ 43 | python-pip python-dev python-setuptools python-wheel 44 | {% elif item.image in ["centos:7"] %} 45 | RUN yum -y install python-pip 46 | {% endif %} 47 | 48 | {# Install of Python3 #} 49 | {% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "debian:10"] %} 50 | RUN apt-get update \ 51 | && apt-get install -y --no-install-recommends \ 52 | apt-utils python3-setuptools python3-pip 53 | {% endif %} 54 | {% if item.image in ["centos:8"] %} 55 | RUN yum -y install hostname python3 python3-pip 56 | {% endif %} 57 | 58 | {# Steps for cleanup #} 59 | {% if item.image.split(':', 1)[0] in ["ubuntu", "debian"] %} 60 | RUN rm -Rf /var/lib/apt/lists/* \ 61 | && rm -Rf /usr/share/doc && rm -Rf /usr/share/man \ 62 | && apt-get clean 63 | {% elif item.image.split(':', 1)[0] in ["centos"] %} 64 | RUN yum clean all 65 | {% endif %} 66 | 67 | {# Steps for clenaup of systemd #} 68 | {% if item.image in ["centos:7", "centos:8", "debian:9"] %} 69 | RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ 70 | systemd-tmpfiles-setup.service ] || rm -f $i; done); \ 71 | rm -f /lib/systemd/system/multi-user.target.wants/*;\ 72 | rm -f /etc/systemd/system/*.wants/*;\ 73 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ 74 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ 75 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ 76 | rm -f /lib/systemd/system/basic.target.wants/*;\ 77 | rm -f /lib/systemd/system/anaconda.target.wants/*; \ 78 | mkdir -p /run/systemd/system 79 | {% endif %} 80 | {% if item.image in ["ubuntu:18.04", "ubuntu:20.04"] %} 81 | # Remove unnecessary getty and udev targets that result in high CPU usage when using 82 | # multiple containers with Molecule (https://github.com/ansible/molecule/issues/1104) 83 | RUN rm -f /lib/systemd/system/systemd*udev* \ 84 | && rm -f /lib/systemd/system/getty.target 85 | {% endif %} 86 | 87 | 88 | {% if item.image in ["centos:7", "centos:8"] %} 89 | # Disable requiretty. 90 | RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers 91 | {% endif %} 92 | 93 | {% if item.image.split(':', 1)[0] not in ["centos", "debian"] %} 94 | # Fix potential UTF-8 errors with ansible-test. 95 | RUN locale-gen en_US.UTF-8 96 | {% endif %} 97 | 98 | # Install Ansible inventory file. 99 | RUN mkdir -p /etc/ansible 100 | RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts 101 | 102 | {% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10"] %} 103 | VOLUME ["/sys/fs/cgroup"] 104 | {% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04"] %} 105 | VOLUME ["/sys/fs/cgroup", "/tmp", "/run"] 106 | {% endif %} 107 | {% if item.image in ["centos:7", "centos:8"] %} 108 | CMD ["/usr/sbin/init"] 109 | {% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "debian:9", "debian:10"] %} 110 | CMD ["/lib/systemd/systemd"] 111 | {% endif %} 112 | --------------------------------------------------------------------------------