ansible-collections / ansible-collections/google.cloud

Removal of parameter enable_flow_logs in gcp_compute_subnetwork

Open Beginner friendly
#298 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
105
Forks
144
Avg merge
5d 10h
Merged PRs (30d)
4

Description

##### SUMMARY
When using gcp_* modules installed with ansible 2.10 form pip parameter ```enable_flow_logs```
is missing in module ```gcp_compute_subnetwork```. To the best of my knowledge because of this there is now way to enable flow logs using any ansible modules

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME

gcp_compute_network

##### ANSIBLE VERSION
```paste below
$ ansible --version
ansible 2.10.1
....
python version = 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0]
```

##### CONFIGURATION
```paste below
DEFAULT_HOST_LIST ...
DEFAULT_LOG_PATH ...
DEFAULT_ROLES_PATH ...
DEFAULT_STDOUT_CALLBACK ...
```

##### OS / ENVIRONMENT

target OS Ubuntu,
Google Cloud Platform

##### STEPS TO REPRODUCE

```yaml
---
- hosts: 127.0.0.1
gather_facts: false
connection: local
tasks:

- set_fact: &c
auth_kind: serviceaccount
project: some_project

- name: Get subnetworks
gcp_compute_subnetwork_info:
<<: *c
filters:
- name = subnet-1
region: us-east1
register: subnet_output
- set_fact:
subnets: "{{subnet_output.resources}}"
- name: Subnet info
debug:
var: subnets
- name: For each subnet enable log flow
gcp_compute_subnetwork:
<<: *c
name: "{{ item.name}}"
ip_cidr_range: "{{item.ipCidrRange}}"
region: "{{ item.region | urlsplit('path') | basename }}"
enable_flow_logs: true
# workaround to strange requirement of module
# it requires network url but passed as dict with key selfLink so
network: "{{ dict(['selfLink'] | zip(item.network)) }}" # | urlspplit('path') | dirname }}"
loop: "{{ subnets }}"
register: enabled_logflow
```
##### EXPECTED RESULTS
ok: [127.0.0.1]

##### ACTUAL RESULTS

```paste below
Unsupported parameters for (gcp_compute_subnetwork) module: enable_flow_logs Supported parameters include: auth_kind, description, env_type, ip_cidr_range, name, network, private_ip_google_access, project, region, scopes, secondary_ip_ranges, service_account_contents, service_account_email, service_account_file, state'
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the gcp_compute_subnetwork module and checking its accepted parameters, then run the issue's minimal playbook against the stated Ansible version. Done means enable_flow_logs is accepted by the module and the subnetwork update completes with the expected ok result.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, python
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.