Commit graph

1086 commits

Author SHA1 Message Date
durgesh-ninave-crest
9101671c0e feat(secretmanager): added support for regional secret manager 2025-05-13 18:36:36 +05:30
durgesh-ninave-crest
342a0b2f95 feat(parametermanager): added support for parameter manager module and lookup 2025-05-13 17:58:24 +05:30
Chris Hawk
3588a6e63d
Merge pull request #683 from ansible-collections/release-1.5.3
Some checks failed
Run integration tests for the cloud.google collection / integration (stable-2.16) (push) Has been cancelled
Run integration tests for the cloud.google collection / integration (stable-2.17) (push) Has been cancelled
Run integration tests for the cloud.google collection / integration (stable-2.18) (push) Has been cancelled
Prepare for 1.5.3 release
2025-04-30 11:41:21 -07:00
Chris Hawk
f1197aaaf5 Prepare for 1.5.3 release 2025-04-30 11:33:26 -07:00
Chris Hawk
f462bbd7c1
Merge pull request #682 from ansible-collections/update-readme
Update README to match current requirements
2025-04-30 11:23:45 -07:00
Chris Hawk
663fefd092 Update README to match current requirements 2025-04-29 16:20:18 -07:00
Chris Hawk
eef427d24e
Merge pull request #679 from ansible-collections/release-1.5.2
Some checks failed
Run integration tests for the cloud.google collection / integration (stable-2.16) (push) Has been cancelled
Run integration tests for the cloud.google collection / integration (stable-2.17) (push) Has been cancelled
Run integration tests for the cloud.google collection / integration (stable-2.18) (push) Has been cancelled
Prepare for release of v1.5.2
2025-04-22 10:03:03 -07:00
Chris Hawk
8fd16c6515 Prepare for release of v1.5.2 2025-04-18 15:15:50 -07:00
Chris Hawk
6fa0c8718f
Merge pull request #677 from p3ck/issues-651
Some checks failed
Run integration tests for the cloud.google collection / integration (stable-2.16) (push) Has been cancelled
Run integration tests for the cloud.google collection / integration (stable-2.17) (push) Has been cancelled
Run integration tests for the cloud.google collection / integration (stable-2.18) (push) Has been cancelled
Fix get_project_disks to process all responses
2025-04-03 08:40:07 -07:00
Chris Hawk
cffc8bb98b
Merge pull request #678 from ansible-collections/codecovconfig
Make code coverage messages informational
2025-04-03 08:37:27 -07:00
Chris Hawk
b66d1c6129 Make code coverage messages informational 2025-04-02 14:28:04 -07:00
Bill Peck
fdcf1fa1fd
Fix get_project_disks to process all responses
The code to process the reponses was not indented correctly so it would
only process the last projects response.

Fixes #651
2025-04-02 12:39:00 -04:00
Vi P
307839b810
Remove plugin option from inventory config for compatibility with passthrough plugins
One niche but useful feature of Ansible inventory plugins is the ability to call one plugin from another. For example, you can write a custom plugin (`my.plugin.multi_cloud`) that acts as a sort of normalization interface between project inventories deployed on multiple cloud platforms. This makes it feasible to create a single set of Ansible Playbooks that can act on hosts across cloud platforms because they can expect managed node (inventory host) data to be consistent across those cloud platform vendors.

For example, `my.plugin.multi_cloud` inventory plugin might look something like the following code, which simply dynamically loads one or another underlying (upstream) vendor'ed inventory plugins based on the value of the shell environment variable called `CLOUD_PLATFORM`:

```python
#!/usr/bin/env python3

from ansible.errors import AnsibleError, AnsibleParserError
from ansible.plugins.inventory import BaseInventoryPlugin
from ansible.plugins.loader import inventory_loader
import os

class InventoryModule(BaseInventoryPlugin):

    def parse(self, inventory, loader, path, cache=True):
        super(InventoryModule, self).parse(inventory, loader, path)

        # Map the cloud platform to the appropriate vendor's inventory plugin.
        cloud_platform = os.environ.get('CLOUD_PLATFORM', '').lower()
        if cloud_platform == 'aws':
            plugin_fqcn = 'amazon.aws.aws_ec2'
        elif cloud_platform == 'gcp':
            plugin_fqcn = 'google.cloud.gcp_compute'
        else:
            raise AnsibleParserError(
                    f"Error: Unrecognized or unset cloud platform '{cloud_platform}'. "
                    f"Set ENTROPY_CLOUD_PLATFORM to 'aws' or 'gcp'.\n"
            )

        if not inventory_loader.has_plugin(plugin_fqcn):
            raise AnsibleParserError(f"Error: '{plugin_fqcn}' inventory plugin not found.\n")

        # Load the requested plugin.
        self.inventory_plugin = inventory_loader.get(plugin_fqcn)
```

In the above example, we see code loading either this `google.cloud.gcp_compute` inventory plugin or Amazon's `amazon.aws.aws_ec2` inventory plugin.

Later, we can invoke the underlying (upstream) plugin in a passthrough manner like this:

```python
        # Passthrough to the underlying plugin.
        if self.inventory_plugin.verify_file(path):
            self.inventory_plugin.parse(inventory, loader, path)
        else:
            raise AnsibleParserError(f"Error: Inventory configuration file '{path}' failed verification by plugin '{plugin_fqcn}'")
```

However, in order for this to work, we must supply the underlying plugin with knowledge of the fact that we are calling it from a different actual plugin. This is facilitated via Ansible's built in `_redirected_names` class property. Before calling the underlying plugin's `parse()` method, we must first do:

```python
        self.inventory_plugin._redirected_names.append(InventoryModule.NAME)
```

Now the underlying plugin will be permitted to run because the underlying plugin is informing Ansible that one of the names it is permitted to use is this "redirected" (aliased) name of the calling plugin. We have effectively monkey-patched the plugin during runtime, which is exactly what we want.

Unfortunately, for _this_ `google.cloud.gcp_compute` inventory plugin, that's not enough, because of the fact that the `plugin` option in its configuration file is also checked and compared against this same name. That's something that, for example, the `amazon.aws.aws_ec2` inventory plugin _doesn't_ do, and for good reason: enforcing this check with hardcoded options breaks the built-in functionality of the Ansible module loading alias features.

That's why I'm suggesting we remove this option. It isn't needed for the `auto` inventory plugin to load the plugin correctly, nor does it ever really need to be checked once this plugin is actually running; it's already running! But its presence _does_ break existing Ansible features, and makes the above use case of a pass-through plugin, for example, infeasible.

Thanks for considering this proposal.
2025-03-14 23:12:41 -04:00
Chris Hawk
99ac225a1a
Merge pull request #667 from ansible-collections/min-version
Run integration tests against 2.16
2025-01-31 12:49:49 -08:00
Chris Hawk
7c808c047c Update version 2025-01-30 13:57:06 -08:00
Chris Hawk
ad6df1688f Add release note fragment 2025-01-30 13:53:56 -08:00
Chris Hawk
e6c49c0f69 Settle on 2.16.0 2025-01-30 11:34:10 -08:00
Chris Hawk
529d21630a Run integration tests against 2.16 2025-01-29 15:32:12 -08:00
Chris Hawk
f22858dea9 Reduce minimal Ansible version to >=2.15.0 2025-01-29 14:57:59 -08:00
Chris Hawk
73eb40d532
Merge pull request #666 from ansible-collections/collections-gh-action
Switch test GitHub workflow to the standardized collection workflow
2025-01-15 15:39:58 -08:00
Chris Hawk
c80eb6ad21 Reduce minimum ansible version back to 2.16 2025-01-15 11:29:51 -08:00
Chris Hawk
8f053e08ab Switch test GitHub workflow to the standardized collection workflow 2025-01-15 10:52:15 -08:00
Chris Hawk
0ef324e88e
Merge pull request #665 from ansible-collections/release-1.5.0
Bump version to 1.5.0
2025-01-14 15:39:23 -08:00
Chris Hawk
4ee4cc60b5 Enable required YAML lint rules and fix results 2025-01-14 15:15:59 -08:00
Chris Hawk
3de16da36a Remove google_cloud_ops_agents submodule 2025-01-14 14:24:58 -08:00
Chris Hawk
623c78f131 Bump version to 1.5.0 2025-01-14 14:02:54 -08:00
Chris Hawk
a1bcf46abc
Merge pull request #655 from ansible-collections/issue-613
Fix errors reported by ansible-test sanity
2025-01-14 12:01:57 -08:00
Chris Hawk
42dca7bb17 Update gcsfuse molecule test docker image versions 2025-01-10 16:36:21 -08:00
Chris Hawk
237f50e8af Upgrade archive version of gcloud 2025-01-10 16:23:45 -08:00
Chris Hawk
b1a75cf383 Install google-cloud-cli instead of google-cloud-sdk 2025-01-10 15:58:54 -08:00
Chris Hawk
d1cf030d93 Try updating gcloud molecule test docker image versions 2025-01-10 15:44:30 -08:00
Chris Hawk
c819fc798d Test with Python 3.11 and 3.12, the two versions compatible with Ansible 2.17 and 2.18 2025-01-10 15:06:25 -08:00
Chris Hawk
38146cdc9b Back off Python versions as Ansible 2.17 is not supported with Python 3.13 2025-01-10 15:03:59 -08:00
Chris Hawk
7cee2e87b0 Make 2.17 the min Ansible version 2025-01-10 15:01:28 -08:00
Chris Hawk
5ebc615a48 Fix doc lint errors in gcp_pubsub_subscription 2025-01-10 14:52:33 -08:00
Chris Hawk
25d53ff320 Merge branch 'master' into issue-613 2025-01-10 13:59:02 -08:00
Chris Hawk
5a395e234f
Merge pull request #652 from gomesfernandes/fix/bigquery-clustering-fields
fix: google.cloud.gcp_bigquery_table clustering fields
2024-11-11 17:05:12 -08:00
Chris Hawk
850e4c6ea5
Merge pull request #658 from lsieradzki/feature/#657
https://github.com/ansible-collections/google.cloud/issues/657
2024-11-11 16:55:06 -08:00
Chris Hawk
d719b0efaa
Fix a YAML doc parsing error in gcp_pubsub_subscription.py 2024-11-11 16:49:34 -08:00
Chris Hawk
68c9af276c
Update gcp_pubsub_subscription.py
Fix lint errors
2024-11-11 16:40:47 -08:00
Chris Hawk
198adf8cfd
Merge branch 'master' into feature/#657 2024-11-11 16:25:50 -08:00
Sieradzki, Lukasz
e89571eb91 https://github.com/ansible-collections/google.cloud/issues/657 2024-11-08 23:03:14 +01:00
Sieradzki, Lukasz
2b35fbf404 https://github.com/ansible-collections/google.cloud/issues/657 2024-11-08 23:02:23 +01:00
Chris Hawk
a1b9e17eab
Merge pull request #656 from ansible-collections/add-pubsub-update-test
Add a test that updates a pubsub subscription
2024-11-08 13:13:06 -08:00
Sieradzki, Lukasz
8b9a2c70dd https://github.com/ansible-collections/google.cloud/issues/657 2024-11-08 18:46:49 +01:00
Chris Hawk
cc1784084c Add a test that updates a pubsub subscription 2024-11-07 11:40:49 -08:00
Chris Hawk
e23c44c612
Merge pull request #654 from lsieradzki/bugfix/issue-653
https://github.com/ansible-collections/google.cloud/issues/653
2024-11-07 11:38:21 -08:00
Sieradzki, Lukasz
6794d18478 https://github.com/ansible-collections/google.cloud/issues/653 2024-11-07 11:02:53 +01:00
Chris Hawk
537707deef Fix a compute_backend_service permadiff 2024-11-06 16:16:00 -08:00
Chris Hawk
4b7f31c000 Remove submodule ignore file 2024-11-06 15:03:59 -08:00