Merge branch 'master' into master

This commit is contained in:
Samir F 2025-07-29 11:05:57 -04:00 committed by GitHub
commit 03480489ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
255 changed files with 3886 additions and 661 deletions

View file

@ -1,10 +1,5 @@
---
profile: production
parseable: true
skip_list:
- ANSIBLE0010
use_default_rules: true
verbosity: 1
exclude_paths:
# Ignore submodule https://github.com/GoogleCloudPlatform/google-cloud-ops-agents-ansible
- roles/google_cloud_ops_agents/

View file

@ -27,6 +27,7 @@ jobs:
ansible_version:
- stable-2.16
- stable-2.17
- stable-2.18
steps:
- name: check out code
uses: actions/checkout@v4

View file

@ -1,71 +1,119 @@
---
# Should be kept up to date with https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
# Integration tests are run separately from the ansible-integration-tests.yml workflow.
name: Run tests for the cloud.google collection
on: [pull_request]
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches:
- main
- stable-*
pull_request:
# Run CI once per day (at 06:00 UTC)
# This ensures that even if there haven't been commits that we are still
# testing against latest version of ansible-test for each ansible-core
# version
schedule:
- cron: '0 6 * * *'
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.number || github.sha
}}
cancel-in-progress: true
jobs:
sanity-and-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ansible_collections/google/cloud
###
# Sanity tests (REQUIRED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
# Our version strategy is to test against the current and previous version
# of ansible-core and each major version of Python supported by both.
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
ansible_version:
ansible:
# It's important that Sanity is tested against all stable-X.Y branches
# Testing against `devel` may fail as new tests are added.
# An alternative to `devel` is the `milestone` branch with
# gets synchronized with `devel` every few weeks and therefore
# tends to be a more stable target. Be aware that it is not updated
# around creation of a new stable branch, this might cause a problem
# that two different versions of ansible-test use the same sanity test
# ignore.txt file.
# Add new versions announced in
# https://github.com/ansible-collections/news-for-maintainers in a timely manner,
# consider dropping testing against EOL versions and versions you don't support.
- stable-2.16
- stable-2.17
python_version:
- '3.10'
- '3.11'
- '3.12'
steps:
- name: check out code
uses: actions/checkout@v4
with:
path: ansible_collections/google/cloud
submodules: 'true'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install ansible-base (${{ matrix.ansible_version }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
- name: Run ansible-test sanity
# validate-modules cannot be turned on until #498 is resolved.
run: ansible-test sanity -v --color --skip validate-modules
- name: Install ansible-lint
run: pip install ansible-lint==24.7.0
- name: Run ansible-lint
run: ansible-lint --exclude roles/google_cloud_ops_agents/
unit:
- stable-2.18
- devel
# - milestone
runs-on: ubuntu-latest
defaults:
run:
working-directory: ansible_collections/google/cloud
steps:
# Run sanity tests inside a Docker container.
# The docker container has all the pinned dependencies that are
# required and all Python versions Ansible supports.
- name: Perform sanity testing
# See the documentation for the following GitHub action on
# https://github.com/ansible-community/ansible-test-gh-action/blob/main/README.md
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: sanity
# OPTIONAL If your sanity tests require code
# from other collections, install them like this
# test-deps: >-
# ansible.netcommon
# ansible.utils
# OPTIONAL If set to true, will test only against changed files,
# which should improve CI performance. See limitations on
# https://github.com/ansible-community/ansible-test-gh-action#pull-request-change-detection
pull-request-change-detection: false
###
# Unit tests (OPTIONAL)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html
units:
runs-on: ubuntu-latest
name: Units (Ⓐ${{ matrix.ansible }})
strategy:
# As soon as the first unit test fails, cancel the others to free up the CI queue
fail-fast: true
matrix:
ansible_version:
ansible:
# Add new versions announced in
# https://github.com/ansible-collections/news-for-maintainers in a timely manner,
# consider dropping testing against EOL versions and versions you don't support.
- stable-2.16
- stable-2.17
python_version:
- '3.10'
- '3.11'
- '3.12'
- stable-2.18
- devel
# - milestone
steps:
- name: check out code
uses: actions/checkout@v4
- name: >-
Perform unit testing against
Ansible version ${{ matrix.ansible }}
# See the documentation for the following GitHub action on
# https://github.com/ansible-community/ansible-test-gh-action/blob/main/README.md
uses: ansible-community/ansible-test-gh-action@release/v1
with:
path: ansible_collections/google/cloud
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install test dependencies
run: pip install -r requirements-test.txt
- name: Install ansible-base (${{ matrix.ansible_version }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
- name: Run unit tests
run: ansible-test units -v --color --python "${{ matrix.python_version }}"
ansible-core-version: ${{ matrix.ansible }}
testing-type: units
# OPTIONAL If your unit tests require code
# from other collections, install them like this
test-deps: >-
ansible.netcommon
ansible.utils
# OPTIONAL If set to true, will test only against changed files,
# which should improve CI performance. See limitations on
# https://github.com/ansible-community/ansible-test-gh-action#pull-request-change-detection
pull-request-change-detection: false

View file

@ -31,10 +31,10 @@ jobs:
with:
path: ansible_collections/google/cloud
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |

View file

@ -26,10 +26,10 @@ jobs:
with:
path: ansible_collections/google/cloud
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "roles/google_cloud_ops_agents"]
path = roles/google_cloud_ops_agents
url = https://github.com/GoogleCloudPlatform/google-cloud-ops-agents-ansible.git

View file

@ -15,7 +15,8 @@ rules:
commas:
max-spaces-after: -1
level: error
comments: disable
comments:
min-spaces-from-content: 1
comments-indentation: disable
document-start: disable
empty-lines:
@ -29,5 +30,8 @@ rules:
new-line-at-end-of-file: disable
new-lines:
type: unix
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
trailing-spaces: disable
truthy: disable

View file

@ -4,6 +4,70 @@ Google.Cloud Release Notes
.. contents:: Topics
v1.6.0
======
Minor Changes
-------------
- gcp_compute - added GVNIC support to compute instance (https://github.com/ansible-collections/google.cloud/pull/688).
- gcp_compute - added ``discard_local_ssd`` flag to compute instance (https://github.com/ansible-collections/google.cloud/pull/686).
- gcp_compute - added hostname support to dynamic inventory (https://github.com/ansible-collections/google.cloud/pull/689).
- gcp_secret_manager - added support for regional secret manager (https://github.com/ansible-collections/google.cloud/pull/685).
Bugfixes
--------
- gcp_secret_manager - cleaned up error responses (https://github.com/ansible-collections/google.cloud/pull/690).
- gcp_serviceusage_service - updated documentation (https://github.com/ansible-collections/google.cloud/pull/691).
v1.5.3
======
Bugfixes
--------
- updated README to match required format (https://github.com/ansible-collections/google.cloud/pull/682).
v1.5.2
======
Bugfixes
--------
- gcp_compute - fixed get_project_disks to process all responses (https://github.com/ansible-collections/google.cloud/pull/677).
v1.5.1
======
Bugfixes
--------
- run integration test with Ansible 2.16 to match `requires_ansible` version
v1.5.0
======
Major Changes
-------------
- google_cloud_ops_agents - role submodule removed because it prevents the collection from passing sanity and lint tests
Minor Changes
-------------
- gcp_pubsub_subscription - allows to create GCS subscription
Bugfixes
--------
- ansible - 2.17 is now the minimum version supported
- ansible - 3.11 is now the minimum Python version
- ansible-test - fixed sanity tests
- ansible-test - integration tests are now run against 2.17 and 2.18
- gcp_bigquery_table - properly handle BigQuery table clustering fields
- gcp_pubsub_subscription - fixed improper subscription uprade PATCH request
v1.4.1
======

194
README.md
View file

@ -1,25 +1,18 @@
# Google Cloud Platform Ansible Collection
This collection provides a series of Ansible modules and plugins for interacting with the [Google Cloud Platform](https://cloud.google.com)
This collection works with Ansible 2.16+
This collection provides a series of Ansible modules and plugins for
interacting with the [Google Cloud Platform](https://cloud.google.com)
# Communication
## Description
* Join the Ansible forum:
* [Get Help](https://forum.ansible.com/c/help/6): get help or help others. Please use appropriate tags, for example `cloud`.
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
The google.cloud collection provides a way to automate provisioning,
configuration, and management of Google Cloud resources using Ansible
playbooks. This collection includes modules for managing various
Google Cloud services such as Compute Engine instances, Cloud Storage
buckets, Cloud SQL instances, and more.
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
### Resources Supported
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
# Installation
```bash
ansible-galaxy collection install google.cloud
```
# Resources Supported
* App Engine FirewallRule (gcp_appengine_firewall_rule, gcp_appengine_firewall_rule_info)
* BigQuery Dataset (gcp_bigquery_dataset, gcp_bigquery_dataset_info)
* BigQuery Table (gcp_bigquery_table, gcp_bigquery_table_info)
@ -107,3 +100,172 @@ ansible-galaxy collection install google.cloud
* Cloud Storage DefaultObjectACL (gcp_storage_default_object_acl, gcp_storage_default_object_acl_info)
* Cloud TPU Node (gcp_tpu_node, gcp_tpu_node_info)
* Secret Manager (gcp_secret_manager)
## Requirements
### Ansible version compatibility
This collection is tested to work with Ansible 2.16+.
### Python version compatibility
This collection is tested with to work Python 3.10+
## Installation
Before using this collection, you need to install it with the Ansible Galaxy
command-line tool:
```
ansible-galaxy collection install google.cloud
```
You can also include it in a requirements.yml file and install it with
ansible-galaxy collection install -r requirements.yml, using the format:
```yaml
collections:
- name: google.cloud
```
Note that if you install any collections from Ansible Galaxy, they will not be
upgraded automatically when you upgrade the Ansible package.
To upgrade the collection to the latest available version, run the following
command:
```
ansible-galaxy collection install google.cloud --upgrade
```
You can also install a specific version of the collection, for example, if you
need to downgrade when something is broken in the latest version (please
report an issue in this repository). Use the following syntax to install
version 1.5.1:
```
ansible-galaxy collection install google.cloud:==1.5.1
```
See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.
If you are using the google.cloud collection locally you will likely need
to install the [gcloud command line tool](https://cloud.google.com/sdk/docs/install#rpm)
in order to perform authentication The easiest way to
authenticate to GCP is using [application default credentials](https://cloud.google.com/sdk/docs/authorizing#adc).
Once you have installed `gcloud` and performed basic initialization
(via `gcloud init`) run:
```shell
gcloud auth application-default login
```
For more authentication options see the Use Cases section below.
## Use Cases
The google.cloud collection supports multiple methods to authenticate to Google
Cloud:
* Application Default Credentials (`auth_kind: "application"`)
* Service Account Key (`auth_kind: "serviceaccount"`)
* OAuth Credentials (`auth_kind: "accesstoken"`)
To use Application default credentials configured using `gcloud`:
```yaml
- name: Create a Google Cloud Storage bucket
google.cloud.gcp_storage_bucket:
name: "{{ bucket_name }}"
project: "{{ gcp_project }}"
auth_kind: "application"
state: present
- name: Delete a Google Cloud Storage bucket
google.cloud.gcp_storage_bucket:
name: "{{ bucket_name }}"
project: "{{ gcp_project }}"
auth_kind: "application"
state: absent
```
For unattended operation it is common to use service account keys. To use
these, set `auth_kind` to `serviceaccount` and `service_account_file` to
the path to the file containing your service account key.
```yaml
- name: Create a Google Cloud Storage bucket
google.cloud.gcp_storage_bucket:
name: "{{ bucket_name }}"
project: "{{ gcp_project }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: present
- name: Delete a Google Cloud Storage bucket
google.cloud.gcp_storage_bucket:
name: "{{ bucket_name }}"
project: "{{ gcp_project }}"
auth_kind: "serviceaccount"
service_account_file: "{{ gcp_cred_file }}"
state: absent
```
In place of `service_account_file` you may instead use
`service_account_contents` which contains the service account key
directly.
Read the [best practices for managing service account keys](https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys)
to learn how to keep your service account key and your GCP resources safe.
Common options can also be set using environment variables, simplifying
automated operations. The available variables are:
```shell
export GCP_PROJECT=<project id>
export GCP_AUTH_KIND=<application|serviceaccount|accesstoken>
export GCP_SERVICE_ACCOUNT_FILE=</path/to/service/account/key.json>
export GCP_SERVICE_ACCOUNT_CONTENTS=<alternative that stores the service account key in the env var>
export GCP_SCOPES=<requested scopes such as https://www.googleapis.com/auth/compute>
export GCP_REGION=<default region such as us-central1>
export GCP_ZONE=<default zone such as us-central1-a>
```
## Testing
The google.cloud collection is tested with the two most recent releases of
Ansible with the versions of Python supported by those releases. The
current version matrix can be seen in the
[GitHub action configuration](https://github.com/ansible-collections/google.cloud/blob/master/.github/workflows/ansible-integration-tests.yml).
To learn how to run the tests locally, read
[CONTRIBUTING.md](https://github.com/ansible-collections/google.cloud/blob/master/CONTRIBUTING.md).
## Support
There are several avenues of commuication available for google.cloud users:
* Join the Ansible forum:
* [Get Help](https://forum.ansible.com/c/help/6): get help or help others. Please use appropriate tags, for example `cloud`.
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
## Release Notes
See [CHANGELOG.md](https://github.com/ansible-collections/google.cloud/blob/master/CHANGELOG.rst).
## Related Information
Documentation for Google Cloud Platform can be found at [cloud.google.com](https://cloud.google.com/docs/).
Documentation for google.cloud resources can be found on the [Ansible Galaxy site](https://galaxy.ansible.com/ui/repo/published/google/cloud/docs/).
## License Information
GNU General Public License v3.0 or later.
See [LICENSE](https://github.com/ansible-collections/google.cloud/blob/master/LICENSE)
to view the full text.

View file

@ -100,3 +100,63 @@ releases:
fragments:
- release-1-4-1.yml
release_date: '2024-08-22'
1.5.0:
changes:
bugfixes:
- ansible - 2.17 is now the minimum version supported
- ansible - 3.11 is now the minimum Python version
- ansible-test - fixed sanity tests
- ansible-test - integration tests are now run against 2.17 and 2.18
- gcp_bigquery_table - properly handle BigQuery table clustering fields
- gcp_pubsub_subscription - fixed improper subscription uprade PATCH request
major_changes:
- google_cloud_ops_agents - role submodule removed because it prevents the collection
from passing sanity and lint tests
minor_changes:
- gcp_pubsub_subscription - allows to create GCS subscription
fragments:
- fix-bigquery-table-create-clustering.yml
- gcp_pubsub_subscription_bugfix.yaml
- gcp_pubsub_subscription_gcs_feature.yaml
- remove-google_cloud_ops_agents-role.yml
- upgrade_anisble.yml
release_date: '2025-01-14'
1.5.1:
changes:
bugfixes:
- run integration test with Ansible 2.16 to match `requires_ansible` version
fragments:
- 667-include-2-16-in-ci.yml
release_date: '2025-01-30'
1.5.2:
changes:
bugfixes:
- gcp_compute - fixed get_project_disks to process all responses (https://github.com/ansible-collections/google.cloud/pull/677).
fragments:
- 677-get-project-disks.yaml
release_date: '2025-04-18'
1.5.3:
changes:
bugfixes:
- updated README to match required format (https://github.com/ansible-collections/google.cloud/pull/682).
fragments:
- 682-update-readme.yaml
release_date: '2025-04-30'
1.6.0:
changes:
bugfixes:
- gcp_secret_manager - cleaned up error responses (https://github.com/ansible-collections/google.cloud/pull/690).
- gcp_serviceusage_service - updated documentation (https://github.com/ansible-collections/google.cloud/pull/691).
minor_changes:
- gcp_compute - added GVNIC support to compute instance (https://github.com/ansible-collections/google.cloud/pull/688).
- gcp_compute - added ``discard_local_ssd`` flag to compute instance (https://github.com/ansible-collections/google.cloud/pull/686).
- gcp_compute - added hostname support to dynamic inventory (https://github.com/ansible-collections/google.cloud/pull/689).
- gcp_secret_manager - added support for regional secret manager (https://github.com/ansible-collections/google.cloud/pull/685).
fragments:
- 685-support-for-regional-secret-manager.yaml
- 686-add-discard_local_ssd-flag-to-compute-instance.yaml
- 688-add-gvnic-support.yaml
- 689-hostname-support-for-dynamic-inventory.yaml
- 690-clear-up-error-responses-from-gcp_secret_manager-lookup.yaml
- 691-updated-documentation-for-gcp_serviceusage_service.yaml
release_date: '2025-06-20'

View file

@ -1,2 +0,0 @@
bugfixes:
- gcp_bigquery_table - properly handle BigQuery table clustering fields

View file

@ -1,2 +0,0 @@
bugfixes:
- gcp_pubsub_subscription - improper subscription uprade PATCH request

View file

@ -1,2 +0,0 @@
features:
- gcp_pubsub_subscription - allows to create GCS subscription

8
codecov.yml Normal file
View file

@ -0,0 +1,8 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true

View file

@ -10,7 +10,7 @@ namespace: google
name: cloud
# The version of the collection. Must be compatible with semantic versioning
version: 1.4.1
version: 1.6.0
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md

View file

@ -46,7 +46,7 @@ RUN yum -y install python-pip
{% endif %}
{# Install of Python3 #}
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "debian:10"] %}
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:10", "debian:11", "debian:12"] %}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils python3-setuptools python3-pip
@ -99,13 +99,13 @@ RUN locale-gen en_US.UTF-8
RUN mkdir -p /etc/ansible
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10"] %}
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10", "debian:11", "debian:12"] %}
VOLUME ["/sys/fs/cgroup"]
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04"] %}
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04"] %}
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
{% endif %}
{% if item.image in ["centos:7", "centos:8"] %}
CMD ["/usr/sbin/init"]
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "debian:9", "debian:10"] %}
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:9", "debian:10", "debian:11", "debian:12"] %}
CMD ["/lib/systemd/systemd"]
{% endif %}

View file

@ -9,13 +9,13 @@ lint: |
ansible-lint
platforms:
- name: instance
image: ubuntu:20.04
image: ubuntu:24.04
privileged: true
ansible.builtin.command: /lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: instance
image: debian:10
image: debian:12
privileged: true
ansible.builtin.command: /lib/systemd/systemd
volumes:

View file

@ -46,7 +46,7 @@ RUN yum -y install python-pip
{% endif %}
{# Install of Python3 #}
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "debian:10"] %}
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:10", "debian:11", "debian:12"] %}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils python3-setuptools python3-pip
@ -99,13 +99,13 @@ RUN locale-gen en_US.UTF-8
RUN mkdir -p /etc/ansible
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10"] %}
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10", "debian:11", "debian:12"] %}
VOLUME ["/sys/fs/cgroup"]
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04"] %}
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04"] %}
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
{% endif %}
{% if item.image in ["centos:7", "centos:8"] %}
CMD ["/usr/sbin/init"]
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "debian:9", "debian:10"] %}
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:9", "debian:10", "debian:11", "debian:12"] %}
CMD ["/lib/systemd/systemd"]
{% endif %}

View file

@ -9,13 +9,13 @@ lint: |
ansible-lint
platforms:
- name: instance
image: ubuntu:20.04
image: ubuntu:24.04
privileged: true
ansible.builtin.command: /lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: instance
image: debian:10
image: debian:12
privileged: true
ansible.builtin.command: /lib/systemd/systemd
volumes:

View file

@ -7,7 +7,6 @@ __metaclass__ = type
DOCUMENTATION = """
name: gcp_compute
plugin_type: inventory
short_description: Google Cloud Compute Engine inventory source
requirements:
- requests >= 2.18.4
@ -24,17 +23,20 @@ DOCUMENTATION = """
required: True
choices: ['google.cloud.gcp_compute', 'gcp_compute']
zones:
description: A list of regions in which to describe GCE instances.
description: A list of zones in which to describe GCE instances.
If none provided, it defaults to all zones available to a given project.
type: list
elements: string
folders:
description: A folder that contains many projects
type: list
required: False
elements: string
projects:
description: A list of projects in which to describe GCE instances.
type: list
required: False
elements: string
filters:
description: >
A list of filter value pairs. Available filters are listed here
@ -42,12 +44,14 @@ DOCUMENTATION = """
Each additional filter in the list will be added as an AND condition
(filter1 and filter2)
type: list
elements: string
hostnames:
description: A list of options that describe the ordering for which
hostnames should be assigned. Currently supported hostnames are
'public_ip', 'private_ip', 'name' or 'labels.vm_name'.
'public_ip', 'private_ip', 'name', 'hostname' or 'labels.vm_name'.
default: ['public_ip', 'private_ip', 'name']
type: list
elements: string
name_suffix:
description: Custom domain suffix. If set, this string will be appended to all hosts.
default: ""
@ -63,6 +67,7 @@ DOCUMENTATION = """
scopes:
description: list of authentication scopes
type: list
elements: string
default: ['https://www.googleapis.com/auth/compute']
env:
- name: GCP_SCOPES
@ -116,7 +121,7 @@ DOCUMENTATION = """
EXAMPLES = """
plugin: google.cloud.gcp_compute
zones: # populate inventory with instances in these regions
zones: # populate inventory with instances in these zones
- us-east1-a
projects:
- gcp-prod-gke-100
@ -243,6 +248,8 @@ class GcpInstance(object):
name = self._get_publicip()
elif order == "private_ip":
name = self._get_privateip()
elif order == "hostname":
name = self.json.get("hostname", self.json["name"] + self.name_suffix)
elif order == "name":
name = self.json["name"] + self.name_suffix
else:

View file

@ -0,0 +1,315 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: gcp_parameter_manager
author: Google Inc. (@googlecloudplatform)
short_description: Get Parameters from Google Cloud as a Lookup plugin
description:
- retrieve parameter keys in parameter Manager for use in playbooks
- see https://cloud.google.com/iam/docs/service-account-creds for details on creating
credentials for Google Cloud and the format of such credentials
- once a parameter value is retreived, it is returned decoded. It is up to the developer
to maintain secrecy of this value once returned.
- if location option is defined, then it deals with the regional parameters of the
location
options:
key:
description:
- the name of the parameter to look up in parameter Manager
type: str
required: True
aliases:
- name
- parameter
- parameter_id
project:
description:
- The name of the google cloud project
- defaults to OS env variable GCP_PROJECT if not present
type: str
location:
description:
- If provided, it defines the location of the regional parameter.
type: str
render_secret:
description:
- support for rendering secrets
- defaults to false if not present
type: bool
auth_kind:
description:
- the type of authentication to use with Google Cloud (i.e. serviceaccount or machineaccount)
- defaults to OS env variable GCP_AUTH_KIND if not present
type: str
version:
description:
- the version name of your parameter to retrieve
type: str
required: False
service_account_email:
description:
- email associated with the service account
- defaults to OS env variable GCP_SERVICE_ACCOUNT_EMAIL if not present
type: str
required: False
service_account_file:
description:
- JSON Credential file obtained from Google Cloud
- defaults to OS env variable GCP_SERVICE_ACCOUNT_FILE if not present
- see https://cloud.google.com/iam/docs/service-account-creds for details
type: str
required: False
service_account_info:
description:
- JSON Object representing the contents of a service_account_file obtained from Google Cloud
- defaults to OS env variable GCP_SERVICE_ACCOUNT_INFO if not present
type: dict
required: False
access_token:
description:
- support for GCP Access Token
- defaults to OS env variable GCP_ACCESS_TOKEN if not present
type: str
required: False
on_error:
description:
- how to handle errors
- strict means raise an exception
- warn means warn, and return none
- ignore means just return none
type: str
required: False
choices:
- 'strict'
- 'warn'
- 'ignore'
default: 'strict'
scopes:
description:
- Authenticaiton scopes for Google parameter Manager
type: list
elements: str
default: ["https://www.googleapis.com/auth/cloud-platform"]
'''
EXAMPLES = '''
- name: Test parameter using env variables for credentials
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', version='test_version') }}"
- name: Test parameter using explicit credentials
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', version='test_version', project='project', auth_kind='serviceaccount',
service_account_file='file.json') }}"
- name: Test getting specific version of a parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', version='test-version') }}"
- name: Test getting latest version of a parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key') }}"
- name: Test render specific version of a parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', version='test-version', render_secret=True) }}"
- name: Test render latest version of a parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', render_secret=True) }}"
- name: Test regional parameter using env variables for credentials
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', location='us-central1', version='test_version') }}"
- name: Test regional parameter using explicit credentials
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', location='us-central1', version='test_version', project='project',
auth_kind='serviceaccount', service_account_file='file.json') }}"
- name: Test getting specific version of a regional parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', location='us-central1', version='test_version') }}"
- name: Test getting latest version of a regional parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', location='us-central1') }}"
- name: Test render specific version of a regional parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', location='us-central1', version='test_version', render_secret=True) }}"
- name: Test render latest version of a regional parameter
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key='parameter_key', location='us-central1', render_secret=True) }}"
'''
RETURN = '''
_raw:
description: the contents of the parameter requested (please use "no_log" to not expose this parameter)
type: list
elements: str
'''
################################################################################
# Imports
################################################################################
import os
import base64
from ansible.plugins.lookup import LookupBase
from ansible.errors import AnsibleError
from ansible.utils.display import Display
try:
import requests
HAS_REQUESTS = True
except ImportError:
HAS_REQUESTS = False
try:
from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import (
GcpSession,
)
HAS_GOOGLE_CLOUD_COLLECTION = True
except ImportError:
HAS_GOOGLE_CLOUD_COLLECTION = False
class GcpLookupException(Exception):
pass
class GcpMockModule(object):
def __init__(self, params):
self.params = params
def fail_json(self, *args, **kwargs):
raise AnsibleError(kwargs["msg"])
def raise_for_status(self, response):
try:
response.raise_for_status()
except getattr(requests.exceptions, "RequestException"):
self.fail_json(msg="GCP returned error: %s" % response.json())
class LookupModule(LookupBase):
def run(self, terms=None, variables=None, **kwargs):
self._display = Display()
if not HAS_GOOGLE_CLOUD_COLLECTION:
raise AnsibleError(
"""gcp_parameter lookup needs a supported version of the google.cloud
collection installed. Use `ansible-galaxy collection install google.cloud`
to install it"""
)
self.set_options(var_options=variables, direct=kwargs)
params = {
"key": self.get_option("key"),
"location": self.get_option("location"),
"version": self.get_option("version"),
"access_token": self.get_option("access_token"),
"scopes": self.get_option("scopes"),
"render_secret": self.get_option("render_secret"),
"on_error": self.get_option("on_error")
}
params['name'] = params['key']
# support GCP_* env variables for some parameters
for param in ["project", "auth_kind", "service_account_file", "service_account_info", "service_account_email", "access_token"]:
params[param] = self.fallback_from_env(param)
self._display.vvv(msg=f"Module Parameters: {params}")
fake_module = GcpMockModule(params)
result = self.get_parameter(fake_module)
return [base64.b64decode(result)]
def fallback_from_env(self, arg):
if self.get_option(arg):
return self.get_option(arg)
else:
env_name = f"GCP_{arg.upper()}"
if env_name in os.environ:
self.set_option(arg, os.environ[env_name])
return self.get_option(arg)
def raise_error(self, module, msg):
if module.params.get('on_error') == 'strict':
raise GcpLookupException(msg)
elif module.params.get('on_error') == 'warn':
self._display.warning(msg)
return None
def get_latest_version(self, module, auth):
url = (self.make_url_prefix(module) + "parameters/{name}/versions?orderBy=create_time desc&filter=disabled=false").format(
**module.params
)
response = auth.get(url)
self._display.vvv(msg=f"List Version Response: {response.status_code} for {response.request.url}: {response.json()}")
if response.status_code != 200:
self.raise_error(module, f"unable to list versions of parameter {response.status_code}")
version_list = response.json()
if "parameterVersions" in version_list and len(version_list["parameterVersions"]) > 0:
# Extract name from the first index
version_name = version_list["parameterVersions"][0]["name"]
return version_name.split('/')[-1]
else:
self.raise_error(module, f"unable to list parameter versions via {response.request.url}: {response.json()}")
def get_parameter(self, module):
auth = GcpSession(module, "parametermanager")
if module.params.get('project') is None:
self.raise_error(module, "The project is required. Please specify the Google Cloud project to use.")
if module.params.get('version') == 'latest' or module.params.get('version') is None:
module.params['version'] = self.get_latest_version(module, auth)
if module.params.get('render_secret') is None:
module.params['render_secret'] = False
# there was an error listing parameter versions
if module.params.get('version') is None:
return ''
if module.params.get('render_secret') is not None:
url = (self.make_url_prefix(module) + "parameters/{name}/versions/{version}:render").format(
**module.params
)
else:
url = (self.make_url_prefix(module) + "parameters/{name}/versions/{version}").format(
**module.params
)
response = auth.get(url)
self._display.vvv(msg=f"Response: {response.status_code} for {response.request.url}: {response.json()}")
if response.status_code != 200:
self.raise_error(module, f"Failed to lookup parameter value via {response.request.url} {response.status_code}")
return ''
response_json = response.json()
if module.params.get('render_secret') is not None:
if 'renderedPayload' not in response_json:
self.raise_error(module, "The parameter version is disabled or the response does not contain the 'renderedPayload' field.")
return ''
return response_json['renderedPayload']
else:
if 'payload' not in response_json or 'data' not in response_json['payload']:
self.raise_error(module, "The parameter version is disabled or the response does not contain the 'data' field.")
return ''
return response_json['payload']['data']
def make_url_prefix(self, module):
if module.params.get('location') and module.params.get('location') != 'global':
return "https://parametermanager.{location}.rep.googleapis.com/v1/projects/{project}/locations/{location}/"
return "https://parametermanager.googleapis.com/v1/projects/{project}/locations/global/"

View file

@ -5,8 +5,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
author:
- Dave Costakos <dcostako@redhat.com>
author: Google Inc. (@googlecloudplatform)
name: gcp_secret_manager
short_description: Get Secrets from Google Cloud as a Lookup plugin
description:
@ -15,6 +14,8 @@ DOCUMENTATION = '''
credentials for Google Cloud and the format of such credentials
- once a secret value is retreived, it is returned decoded. It is up to the developer
to maintain secrecy of this value once returned.
- if location option is defined, then it deals with the regional secrets of the
location
options:
key:
@ -31,6 +32,10 @@ DOCUMENTATION = '''
- The name of the google cloud project
- defaults to OS env variable GCP_PROJECT if not present
type: str
location:
description:
- If provided, it defines the location of the regional secret.
type: str
auth_kind:
description:
- the type of authentication to use with Google Cloud (i.e. serviceaccount or machineaccount)
@ -59,7 +64,7 @@ DOCUMENTATION = '''
description:
- JSON Object representing the contents of a service_account_file obtained from Google Cloud
- defaults to OS env variable GCP_SERVICE_ACCOUNT_INFO if not present
type: jsonarg
type: str
required: False
access_token:
description:
@ -84,6 +89,7 @@ DOCUMENTATION = '''
description:
- Authenticaiton scopes for Google Secret Manager
type: list
elements: str
default: ["https://www.googleapis.com/auth/cloud-platform"]
'''
@ -103,6 +109,23 @@ EXAMPLES = '''
- name: Test getting specific version of a secret (new version)
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', version='2') }}"
- name: Test regional secret using env variables for credentials
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', location='us-central1') }}"
- name: Test regional secret using explicit credentials
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', location='us-central1', project='project', auth_kind='serviceaccount',
service_account_file='file.json') }}"
- name: Test getting specific version of a regional secret (old version)
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', location='us-central1', version='1') }}"
- name: Test getting specific version of a regional secret (new version)
ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', location='us-central1', version='2') }}"
'''
RETURN = '''
@ -168,6 +191,7 @@ class LookupModule(LookupBase):
self.set_options(var_options=variables, direct=kwargs)
params = {
"key": self.get_option("key"),
"location": self.get_option("location"),
"version": self.get_option("version"),
"access_token": self.get_option("access_token"),
"scopes": self.get_option("scopes"),
@ -199,13 +223,28 @@ class LookupModule(LookupBase):
# to be set if secret versions get disabled
# see https://issuetracker.google.com/issues/286489671
def get_latest_version(self, module, auth):
url = "https://secretmanager.googleapis.com/v1/projects/{project}/secrets/{name}/versions?filter=state:ENABLED".format(
url = (self.make_url_prefix(module) + "secrets/{name}/versions?filter=state:ENABLED").format(
**module.params
)
response = auth.get(url)
self._display.vvv(msg=f"List Version Response: {response.status_code} for {response.request.url}: {response.json()}")
if response.status_code != 200:
self.raise_error(module, f"unable to list versions of secret {response.status_code}")
if response.status_code >= 500: # generic server error
self.raise_error(
module,
f"server error encountered while looking for secret '{module.params['name']}', code: {response.status_code}"
)
elif response.status_code >= 400: # generic client request error
self.raise_error(
module,
f"client error encountered while looking for secret '{module.params['name']}', code: {response.status_code}"
)
elif response.status_code >= 300: # all other possible errors
self.raise_error(
module,
f"unable to list versions for secret '{module.params['name']}', code: {response.status_code}"
)
else:
pass
version_list = response.json()
if "versions" in version_list:
versions_numbers = []
@ -234,7 +273,7 @@ class LookupModule(LookupBase):
if module.params['calc_version'] is None:
return ''
url = "https://secretmanager.googleapis.com/v1/projects/{project}/secrets/{name}/versions/{calc_version}:access".format(
url = (self.make_url_prefix(module) + "secrets/{name}/versions/{calc_version}:access").format(
**module.params
)
response = auth.get(url)
@ -244,3 +283,8 @@ class LookupModule(LookupBase):
return ''
return response.json()['payload']['data']
def make_url_prefix(self, module):
if module.params['location']:
return "https://secretmanager.{location}.rep.googleapis.com/v1/projects/{project}/locations/{location}/"
return "https://secretmanager.googleapis.com/v1/projects/{project}/"

View file

@ -150,7 +150,7 @@ import json
def main():
module = GcpModule(argument_spec=dict())
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -311,7 +311,7 @@ import json
def main():
module = GcpModule(argument_spec=dict())
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/bigquery']

View file

@ -253,6 +253,7 @@ options:
data .
required: false
type: int
default: 0
source_format:
description:
- The data format.
@ -328,6 +329,7 @@ options:
when reading the data.
required: false
type: int
default: 0
csv_options:
description:
- Additional properties to set if sourceFormat is set to CSV.
@ -368,6 +370,7 @@ options:
when reading the data.
required: false
type: int
default: 0
bigtable_options:
description:
- Additional options if sourceFormat is set to BIGTABLE.

View file

@ -590,7 +590,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(dataset=dict(type='str')))
module = GcpModule(argument_spec=dict(dataset=dict(type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/bigquery']

View file

@ -188,7 +188,7 @@ import json
def main():
module = GcpModule(argument_spec=dict())
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -1536,7 +1536,7 @@ def main():
),
),
pubsub_config=dict(type='dict', options=dict(topic=dict(required=True, type='str'), service_account_email=dict(type='str'))),
webhook_config=dict(type='dict', options=dict(secret=dict(required=True, type='str'))),
webhook_config=dict(type='dict', options=dict(secret=dict(required=True, type='str', no_log=True))),
build=dict(
type='dict',
options=dict(
@ -1568,7 +1568,11 @@ def main():
queue_ttl=dict(type='str'),
logs_bucket=dict(type='str'),
timeout=dict(default='600s', type='str'),
secrets=dict(type='list', elements='dict', options=dict(kms_key_name=dict(required=True, type='str'), secret_env=dict(type='dict'))),
secrets=dict(
type='list',
elements='dict',
no_log=True,
options=dict(kms_key_name=dict(required=True, type='str'), secret_env=dict(type='dict', no_log=True))),
steps=dict(
required=True,
type='list',
@ -1580,7 +1584,7 @@ def main():
id=dict(type='str'),
entrypoint=dict(type='str'),
dir=dict(type='str'),
secret_env=dict(type='list', elements='str'),
secret_env=dict(type='list', elements='str', no_log=True),
timeout=dict(type='str'),
timing=dict(type='str'),
volumes=dict(
@ -1609,7 +1613,7 @@ def main():
worker_pool=dict(type='str'),
logging=dict(type='str'),
env=dict(type='list', elements='str'),
secret_env=dict(type='list', elements='str'),
secret_env=dict(type='list', elements='str', no_log=True),
volumes=dict(type='list', elements='dict', options=dict(name=dict(type='str'), path=dict(type='str'))),
),
),

View file

@ -814,7 +814,7 @@ import json
def main():
module = GcpModule(argument_spec=dict())
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -273,7 +273,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -681,8 +681,8 @@ def main():
http_method=dict(type='str'),
body=dict(type='str'),
headers=dict(type='dict'),
oauth_token=dict(type='dict', options=dict(service_account_email=dict(required=True, type='str'), scope=dict(type='str'))),
oidc_token=dict(type='dict', options=dict(service_account_email=dict(required=True, type='str'), audience=dict(type='str'))),
oauth_token=dict(type='dict', no_log=True, options=dict(service_account_email=dict(required=True, type='str'), scope=dict(type='str'))),
oidc_token=dict(type='dict', no_log=True, options=dict(service_account_email=dict(required=True, type='str'), audience=dict(type='str'))),
),
),
region=dict(required=True, type='str'),

View file

@ -379,7 +379,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -279,7 +279,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -235,7 +235,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -320,7 +320,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -252,7 +252,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -88,7 +88,7 @@ options:
completely drained, offering 0% of its available Capacity. Valid range is
[0.0,1.0].
required: false
default: '1.0'
default: '1'
type: str
description:
description:
@ -422,6 +422,11 @@ options:
elements: str
required: false
type: list
fingerprint:
description:
- Fingerprint of this resource. A hash of the contents stored in this object. This
field is used in optimistic locking.
type: str
description:
description:
- An optional description of this resource.
@ -478,7 +483,7 @@ options:
- The load balancing algorithm used within the scope of the locality.
- The possible values are - * ROUND_ROBIN - This is a simple policy in which each
healthy backend is selected in round robin order.
- "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts
- "* LEAST_REQUEST - An algorithm which selects two random healthy hosts
and picks the host which has fewer active requests."
- "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing
to backends. The algorithm has the property that the addition/removal of a host
@ -566,6 +571,7 @@ options:
be used to disable ejection or to ramp it up slowly. Defaults to 0.
required: false
type: int
default: 0
enforcing_success_rate:
description:
- The percentage chance that a host will be actually ejected when an outlier
@ -1210,7 +1216,7 @@ localityLbPolicy:
- The load balancing algorithm used within the scope of the locality.
- The possible values are - * ROUND_ROBIN - This is a simple policy in which each
healthy backend is selected in round robin order.
- "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and
- "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and
picks the host which has fewer active requests."
- "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing
to backends. The algorithm has the property that the addition/removal of a host
@ -1490,6 +1496,7 @@ def main():
options=dict(
cache_key_policy=dict(
type="dict",
no_log=False,
options=dict(
include_host=dict(type="bool"),
include_protocol=dict(type="bool"),

View file

@ -549,7 +549,7 @@ resources:
- The load balancing algorithm used within the scope of the locality.
- The possible values are - * ROUND_ROBIN - This is a simple policy in which
each healthy backend is selected in round robin order.
- "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts
- "* LEAST_REQUEST - An algorithm which selects two random healthy hosts
and picks the host which has fewer active requests."
- "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing
to backends. The algorithm has the property that the addition/removal of a
@ -762,7 +762,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -570,14 +570,20 @@ def main():
provisioned_iops=dict(type='int'),
zone=dict(required=True, type='str'),
source_image_encryption_key=dict(
type='dict', no_log=True, options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
disk_encryption_key=dict(
type='dict', no_log=True, options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
source_snapshot=dict(type='dict', no_log=True),
source_snapshot_encryption_key=dict(
type='dict', no_log=True, options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
)
)

View file

@ -375,7 +375,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -175,7 +175,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -322,7 +322,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -314,7 +314,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -205,7 +205,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -289,7 +289,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -457,7 +457,6 @@ options:
- Indicates whether or not to export logs. This is false by default, which
means no health check logging will be done.
required: false
default: 'false'
type: bool
project:
description:

View file

@ -527,7 +527,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -204,7 +204,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -204,7 +204,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -545,13 +545,13 @@ def main():
disk_size_gb=dict(type='int'),
family=dict(type='str'),
guest_os_features=dict(type='list', elements='dict', options=dict(type=dict(required=True, type='str'))),
image_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str'))),
image_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str', no_log=True))),
labels=dict(type='dict'),
licenses=dict(type='list', elements='str'),
name=dict(required=True, type='str'),
raw_disk=dict(type='dict', options=dict(container_type=dict(type='str'), sha1_checksum=dict(type='str'), source=dict(required=True, type='str'))),
source_disk=dict(type='dict'),
source_disk_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str'))),
source_disk_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str', no_log=True))),
source_disk_id=dict(type='str'),
source_image=dict(type='dict'),
source_snapshot=dict(type='dict'),

View file

@ -351,7 +351,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -61,6 +61,13 @@ options:
- Whether the resource should be protected against deletion.
required: false
type: bool
discard_local_ssd:
description:
- Discards the contents of any attached Local SSD disks when changing status
to TERMINATED.
default: True
required: false
type: bool
disks:
description:
- An array of disks that are associated with the instances that are created from
@ -388,6 +395,19 @@ options:
field to "{{ name-of-resource }}"'
required: false
type: dict
nic_type:
description:
- Type of network interface card attached to instance.
- If unspecified it will use the default provided by GCP.
- As the next generation network interface which succeeds VirtIO, gVNIC
replaces VirtIO-Net as the only supported network interface in Compute
Engine for all new machine types (Generation 3 and onwards).
- Newer machine series and networking features require gVNIC instead of VirtIO.
required: false
type: str
choices:
- VIRTIO_NET
- GVNIC
scheduling:
description:
- Sets the scheduling options for this instance.
@ -1117,6 +1137,7 @@ def main():
state=dict(default='present', choices=['present', 'absent'], type='str'),
can_ip_forward=dict(type='bool', aliases=['ip_forward']),
deletion_protection=dict(type='bool'),
discard_local_ssd=dict(type='bool', required=False, default=True),
disks=dict(
type='list',
elements='dict',
@ -1124,7 +1145,9 @@ def main():
auto_delete=dict(type='bool'),
boot=dict(type='bool'),
device_name=dict(type='str'),
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))),
disk_encryption_key=dict(type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), rsa_encrypted_key=dict(type='str', no_log=True))),
index=dict(type='int'),
initialize_params=dict(
type='dict',
@ -1133,7 +1156,7 @@ def main():
disk_size_gb=dict(type='int'),
disk_type=dict(type='str'),
source_image=dict(type='str', aliases=['image', 'image_family']),
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
source_image_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str', no_log=True))),
),
),
interface=dict(type='str'),
@ -1170,6 +1193,7 @@ def main():
network_ip=dict(type='str'),
subnetwork=dict(type='dict'),
stack_type=dict(type='str'),
nic_type=dict(type='str', choices=['VIRTIO_NET', 'GVNIC']),
),
),
scheduling=dict(
@ -1510,7 +1534,9 @@ class InstancePower(object):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{name}/start".format(**self.module.params)
def _stop_url(self):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{name}/stop".format(**self.module.params)
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{name}/stop?discardLocalSsd={discard_local_ssd}".format(
**self.module.params
)
def deletion_protection_update(module, request, response):
@ -1710,6 +1736,7 @@ class InstanceNetworkinterfacesArray(object):
u'networkIP': item.get('network_ip'),
u'stackType': item.get('stack_type'),
u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'),
u'nicType': item.get('nic_type'),
}
)
@ -1722,6 +1749,7 @@ class InstanceNetworkinterfacesArray(object):
u'networkIP': item.get(u'networkIP'),
u'stackType': item.get('stackType'),
u'subnetwork': item.get(u'subnetwork'),
u'nicType': item.get(u'nicType'),
}
)

View file

@ -213,7 +213,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -288,7 +288,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -621,7 +621,8 @@ def main():
argument_spec=dict(
filters=dict(type="list", elements="str"),
zone=dict(required=True, type="str"),
)
),
supports_check_mode=True
)
if not module.params["scopes"]:

View file

@ -1019,7 +1019,9 @@ def main():
auto_delete=dict(type='bool'),
boot=dict(type='bool'),
device_name=dict(type='str'),
disk_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))),
disk_encryption_key=dict(type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), rsa_encrypted_key=dict(type='str', no_log=True))),
index=dict(type='int'),
initialize_params=dict(
type='dict',
@ -1028,7 +1030,7 @@ def main():
disk_size_gb=dict(type='int'),
disk_type=dict(type='str'),
source_image=dict(type='str'),
source_image_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str'))),
source_image_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str', no_log=True))),
),
),
interface=dict(type='str'),

View file

@ -560,7 +560,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -320,7 +320,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -192,7 +192,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -202,7 +202,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -219,7 +219,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -220,7 +220,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -320,7 +320,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -476,7 +476,7 @@ options:
- The load balancing algorithm used within the scope of the locality.
- The possible values are - * ROUND_ROBIN - This is a simple policy in which each
healthy backend is selected in round robin order.
- "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts
- "* LEAST_REQUEST - An algorithm which selects two random healthy hosts
and picks the host which has fewer active requests."
- "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing
to backends. The algorithm has the property that the addition/removal of a host
@ -566,6 +566,7 @@ options:
be used to disable ejection or to ramp it up slowly. Defaults to 0.
required: false
type: int
default: 0
enforcing_success_rate:
description:
- The percentage chance that a host will be actually ejected when an outlier
@ -1222,7 +1223,7 @@ localityLbPolicy:
- The load balancing algorithm used within the scope of the locality.
- The possible values are - * ROUND_ROBIN - This is a simple policy in which each
healthy backend is selected in round robin order.
- "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and
- "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and
picks the host which has fewer active requests."
- "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing
to backends. The algorithm has the property that the addition/removal of a host
@ -1507,6 +1508,7 @@ def main():
options=dict(
cache_key_policy=dict(
type='dict',
no_log=False,
options=dict(
include_host=dict(type='bool'),
include_protocol=dict(type='bool'),

View file

@ -559,7 +559,7 @@ resources:
- The load balancing algorithm used within the scope of the locality.
- The possible values are - * ROUND_ROBIN - This is a simple policy in which
each healthy backend is selected in round robin order.
- "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts
- "* LEAST_REQUEST - An algorithm which selects two random healthy hosts
and picks the host which has fewer active requests."
- "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing
to backends. The algorithm has the property that the addition/removal of a
@ -787,7 +787,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -430,9 +430,9 @@ def main():
replica_zones=dict(required=True, type='list', elements='str'),
type=dict(type='str'),
region=dict(required=True, type='str'),
disk_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str'))),
disk_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str', no_log=True))),
source_snapshot=dict(type='dict'),
source_snapshot_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str'))),
source_snapshot_encryption_key=dict(type='dict', no_log=True, options=dict(raw_key=dict(type='str', no_log=True))),
)
)

View file

@ -293,7 +293,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -452,7 +452,6 @@ options:
- Indicates whether or not to export logs. This is false by default, which
means no health check logging will be done.
required: false
default: 'false'
type: bool
region:
description:

View file

@ -538,7 +538,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -301,7 +301,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -176,7 +176,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -183,7 +183,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -302,7 +302,6 @@ options:
is considered a match if the match criteria above are NOT met.
Defaults to false.
required: false
default: 'false'
type: bool
prefix_match:
description:
@ -364,7 +363,6 @@ options:
- Specifies that prefixMatch and fullPathMatch matches are case sensitive.
- Defaults to false.
required: false
default: 'false'
type: bool
metadata_filters:
description:
@ -499,7 +497,6 @@ options:
to the Access- Control-Allow-Credentials header. Defaults to
false.
required: false
default: 'false'
type: bool
allow_headers:
description:
@ -535,7 +532,6 @@ options:
- which indicates that the CORS policy is in effect. Defaults
to false.
required: false
default: 'false'
type: bool
expose_headers:
description:
@ -882,7 +878,6 @@ options:
used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -926,7 +921,6 @@ options:
query portion of the original URL is retained. The default value
is false.
required: false
default: 'false'
type: bool
path_rules:
description:
@ -993,7 +987,6 @@ options:
to the Access- Control-Allow-Credentials header. Defaults to
false.
required: false
default: 'false'
type: bool
allow_headers:
description:
@ -1373,7 +1366,6 @@ options:
used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -1416,7 +1408,6 @@ options:
is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained.
required: false
default: 'false'
type: bool
default_url_redirect:
description:
@ -1441,7 +1432,6 @@ options:
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -1483,7 +1473,6 @@ options:
removed prior to redirecting the request. If set to false, the query
portion of the original URL is retained.
required: false
default: 'false'
type: bool
tests:
description:
@ -1541,7 +1530,6 @@ options:
Setting this true for TargetHttpsProxy is not permitted. The default is
set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -1582,7 +1570,6 @@ options:
prior to redirecting the request. If set to false, the query portion of
the original URL is retained.
required: false
default: 'false'
type: bool
region:
description:

View file

@ -1604,7 +1604,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -73,7 +73,6 @@ options:
this reservation. Otherwise, it can be consumed by VMs with affinity for any
reservation. Defaults to false.
required: false
default: 'false'
type: bool
specific_reservation:
description:

View file

@ -258,7 +258,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -346,7 +346,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -217,7 +217,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -222,7 +222,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -388,10 +388,14 @@ def main():
source_disk=dict(required=True, type='dict'),
zone=dict(type='str'),
snapshot_encryption_key=dict(
type='dict', no_log=True, options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
source_disk_encryption_key=dict(
type='dict', no_log=True, options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
type='dict',
no_log=True,
options=dict(raw_key=dict(type='str', no_log=True), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
)
)

View file

@ -260,7 +260,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -171,7 +171,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -207,7 +207,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -226,7 +226,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -171,7 +171,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -193,7 +193,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -178,7 +178,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -224,7 +224,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -183,7 +183,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -175,7 +175,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -186,7 +186,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -70,6 +70,11 @@ options:
the resource.
required: false
type: str
fingerprint:
description:
- Fingerprint of this resource. A hash of the contents stored in this object. This
field is used in optimistic locking.
type: str
header_action:
description:
- Specifies changes to request and response headers that need to take effect for
@ -357,7 +362,6 @@ options:
to the Access- Control-Allow-Credentials header. Defaults to
false.
required: false
default: 'false'
type: bool
allow_headers:
description:
@ -737,7 +741,6 @@ options:
used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -780,7 +783,6 @@ options:
is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained.
required: false
default: 'false'
type: bool
route_rules:
description:
@ -948,7 +950,6 @@ options:
is considered a match if the match criteria above are NOT met.
Defaults to false.
required: false
default: 'false'
type: bool
prefix_match:
description:
@ -1010,7 +1011,6 @@ options:
- Specifies that prefixMatch and fullPathMatch matches are case sensitive.
- Defaults to false.
required: false
default: 'false'
type: bool
metadata_filters:
description:
@ -1145,7 +1145,6 @@ options:
to the Access- Control-Allow-Credentials header. Defaults to
false.
required: false
default: 'false'
type: bool
allow_headers:
description:
@ -1181,7 +1180,6 @@ options:
- which indicates that the CORS policy is in effect. Defaults
to false.
required: false
default: 'false'
type: bool
expose_headers:
description:
@ -1531,7 +1529,6 @@ options:
- Setting this true for TargetHttpsProxy is not permitted. Defaults
to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -1569,7 +1566,6 @@ options:
is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained. Defaults to false.
required: false
default: 'false'
type: bool
default_url_redirect:
description:
@ -1594,7 +1590,6 @@ options:
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -1636,7 +1631,6 @@ options:
removed prior to redirecting the request. If set to false, the query
portion of the original URL is retained.
required: false
default: 'false'
type: bool
default_route_action:
description:
@ -1733,7 +1727,6 @@ options:
- If true, headerValue is set for the header, discarding any
values that were set for that header.
required: false
default: 'false'
type: bool
response_headers_to_remove:
description:
@ -1767,7 +1760,6 @@ options:
- If true, headerValue is set for the header, discarding any
values that were set for that header.
required: false
default: 'false'
type: bool
url_rewrite:
description:
@ -1960,14 +1952,12 @@ options:
that the actual request can include user credentials.
- This translates to the Access-Control-Allow-Credentials header.
required: false
default: 'false'
type: bool
disabled:
description:
- If true, specifies the CORS policy is disabled. The default value
is false, which indicates that the CORS policy is in effect.
required: false
default: 'false'
type: bool
fault_injection_policy:
description:
@ -2095,7 +2085,6 @@ options:
Setting this true for TargetHttpsProxy is not permitted. The default is
set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
@ -2136,7 +2125,6 @@ options:
prior to redirecting the request. If set to false, the query portion of
the original URL is retained. The default is set to false.
required: false
default: 'false'
type: bool
default_route_action:
description:
@ -2231,8 +2219,6 @@ options:
exist for the header.
- If true, headerValue is set for the header, discarding any values
that were set for that header.
required: false
default: 'false'
type: bool
response_headers_to_remove:
description:
@ -2266,7 +2252,6 @@ options:
- If true, headerValue is set for the header, discarding any values
that were set for that header.
required: false
default: 'false'
type: bool
url_rewrite:
description:
@ -2456,14 +2441,12 @@ options:
the actual request can include user credentials.
- This translates to the Access-Control-Allow-Credentials header.
required: false
default: 'false'
type: bool
disabled:
description:
- If true, specifies the CORS policy is disabled. The default value is
false, which indicates that the CORS policy is in effect.
required: false
default: 'false'
type: bool
fault_injection_policy:
description:

View file

@ -2487,7 +2487,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -247,7 +247,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -1528,7 +1528,9 @@ def main():
accelerators=dict(type='list', elements='dict', options=dict(accelerator_count=dict(type='str'), accelerator_type=dict(type='str'))),
disk_type=dict(type='str'),
min_cpu_platform=dict(type='str'),
taints=dict(type='list', elements='dict', options=dict(key=dict(type='str'), value=dict(type='str'), effect=dict(type='str'))),
taints=dict(type='list',
elements='dict',
options=dict(key=dict(type='str', no_log=False), value=dict(type='str'), effect=dict(type='str'))),
shielded_instance_config=dict(
type='dict', options=dict(enable_secure_boot=dict(type='bool'), enable_integrity_monitoring=dict(type='bool'))
),
@ -1538,7 +1540,7 @@ def main():
type='dict',
options=dict(
username=dict(type='str'),
password=dict(type='str'),
password=dict(type='str', no_log=True),
client_certificate_config=dict(type='dict', options=dict(issue_client_certificate=dict(type='bool'))),
),
),

View file

@ -859,7 +859,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str', aliases=['region', 'zone'])))
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str', aliases=['region', 'zone'])), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -764,7 +764,9 @@ def main():
accelerators=dict(type='list', elements='dict', options=dict(accelerator_count=dict(type='int'), accelerator_type=dict(type='str'))),
disk_type=dict(type='str'),
min_cpu_platform=dict(type='str'),
taints=dict(type='list', elements='dict', options=dict(key=dict(type='str'), value=dict(type='str'), effect=dict(type='str'))),
taints=dict(type='list',
elements='dict',
options=dict(key=dict(type='str', no_log=False), value=dict(type='str'), effect=dict(type='str'))),
shielded_instance_config=dict(
type='dict', options=dict(enable_secure_boot=dict(type='bool'), enable_integrity_monitoring=dict(type='bool'))
),

View file

@ -450,7 +450,8 @@ import json
def main():
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str', aliases=['region', 'zone']), cluster=dict(required=True, type='dict')))
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str', aliases=['region', 'zone']), cluster=dict(required=True, type='dict')),
supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

View file

@ -508,8 +508,12 @@ def main():
default_key_specs=dict(
type='list',
elements='dict',
no_log=False,
options=dict(
algorithm=dict(type='str'), key_length=dict(type='int'), key_type=dict(type='str'), kind=dict(default='dns#dnsKeySpec', type='str')
algorithm=dict(type='str'),
key_length=dict(type='int', no_log=False),
key_type=dict(type='str'),
kind=dict(default='dns#dnsKeySpec', type='str')
),
),
),

View file

@ -308,7 +308,7 @@ import json
def main():
module = GcpModule(argument_spec=dict(dns_name=dict(type='list', elements='str')))
module = GcpModule(argument_spec=dict(dns_name=dict(type='list', elements='str')), supports_check_mode=True)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/ndev.clouddns.readwrite']

Some files were not shown because too many files have changed in this diff Show more