ansible-collections / ansible-collections/google.cloud
google.cloud.gcp_pubsub_subscription: Missing pubsub_wrapper and no_wrapper in push_config
- Dominant language
- Python
- Stars
- 105
- Forks
- 144
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 4
Description
##### SUMMARY
Not sure if it's a bug, but it's a real limitation.
In GCP, when we create a subscription, we can choose to unwrap the message ([cf doc](https://cloud.google.com/pubsub/docs/payload-unwrapping) and [api doc](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions#pushconfig))
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
google.cloud.gcp_pubsub_subscription
##### ANSIBLE VERSION
```paste below
ansible [core 2.14.1]
config file = None
configured module search path = ['/Users/sven/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/homebrew/lib/python3.10/site-packages/ansible
ansible collection location = /Users/sven/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/homebrew/bin/ansible
python version = 3.10.12 (main, Jun 7 2023, 00:38:32) [Clang 14.0.3 (clang-1403.0.22.14.1)] (/opt/homebrew/opt/python@3.10/bin/python3.10)
jinja version = 3.1.2
libyaml = True
```
##### COLLECTION VERSION
```paste below
google.cloud 1.3.0
```
##### CONFIGURATION
```paste below
CONFIG_FILE() = None
```
##### OS / ENVIRONMENT
MacOS
##### STEPS TO REPRODUCE
Simply add the no_wrapper attribute to push_config.
```yaml
- name: Create a Pub/Sub subscription
google.cloud.gcp_pubsub_subscription:
name: "my-topic_subscription"
topic:
name: "my-topic"
push_config:
push_endpoint: "https://example.com"
no_wrapper:
write_metadata: true
```
##### EXPECTED RESULTS
we should be able to pass `no_wrapper` or `pubsub_wrapper` to push_config.
##### ACTUAL RESULTS
```sh
TASK [Create a Pub/Sub subscription"]
fatal: [localhost]: FAILED! => {
"changed": false,
"msg": "Unsupported parameters for (google.cloud.gcp_pubsub_subscription) module: push_config.no_wrapper.
Supported parameters include:
message_retention_duration, retry_policy, enable_message_ordering, push_config, filter, env_type, state,
dead_letter_policy, labels, service_account_contents, auth_kind, scopes, retain_acked_messages, project,
service_account_email, expiration_policy, ack_deadline_seconds, name, topic, access_token, service_account_file."
}
```
Contributor guide
Research direction
Start at the google.cloud.gcp_pubsub_subscription module entry point and compare its push_config parameters with the linked Google Cloud Pub/Sub documentation. Add support for the documented no_wrapper and pubsub_wrapper options, then verify the provided playbook no longer rejects no_wrapper and accepts both forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100