Skip to content

Commit a1bcf46

Browse files
authored
Merge pull request #655 from ansible-collections/issue-613
Fix errors reported by ansible-test sanity
2 parents 5a395e2 + 42dca7b commit a1bcf46

File tree

126 files changed

+264
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+264
-233
lines changed

.github/workflows/ansible-integration-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
# and test against the minimum version of Python supported by both. If/when we change
2626
# the integration tests to support parallelism we can revisit.
2727
ansible_version:
28-
- stable-2.16
2928
- stable-2.17
29+
- stable-2.18
3030
steps:
3131
- name: check out code
3232
uses: actions/checkout@v4
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up Python
3636
uses: actions/setup-python@v4
3737
with:
38-
python-version: '3.10' # this is the minimum version required for Ansible 2.16
38+
python-version: '3.11' # this is the minimum version required for Ansible 2.17
3939
- name: Install dependencies
4040
run: pip install -r requirements.txt
4141
- name: Install ansible-base (${{ matrix.ansible_version }})
@@ -70,4 +70,4 @@ jobs:
7070
# run tests
7171
- name: Run integration tests
7272
# Add the -vvv flag to print out more output
73-
run: ansible-test integration -v --color --python 3.10 --venv-system-site-packages
73+
run: ansible-test integration -v --color --python 3.11 --venv-system-site-packages

.github/workflows/ansible-test.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ jobs:
1313
# of ansible-core and each major version of Python supported by both.
1414
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
1515
ansible_version:
16-
- stable-2.16
1716
- stable-2.17
17+
- stable-2.18
1818
python_version:
19-
- '3.10'
2019
- '3.11'
2120
- '3.12'
2221
steps:
@@ -46,10 +45,9 @@ jobs:
4645
strategy:
4746
matrix:
4847
ansible_version:
49-
- stable-2.16
5048
- stable-2.17
49+
- stable-2.18
5150
python_version:
52-
- '3.10'
5351
- '3.11'
5452
- '3.12'
5553
steps:

.github/workflows/gcloud.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
with:
3232
path: ansible_collections/google/cloud
3333

34-
- name: Set up Python 3.10
34+
- name: Set up Python 3.11
3535
uses: actions/setup-python@v4
3636
with:
37-
python-version: '3.10'
37+
python-version: '3.11'
3838

3939
- name: Install dependencies
4040
run: |

.github/workflows/gcsfuse.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
with:
2727
path: ansible_collections/google/cloud
2828

29-
- name: Set up Python 3.10
29+
- name: Set up Python 3.11
3030
uses: actions/setup-python@v4
3131
with:
32-
python-version: '3.10'
32+
python-version: '3.11'
3333

3434
- name: Install dependencies
3535
run: |

meta/runtime.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
requires_ansible: ">=2.16.0"
2+
requires_ansible: ">=2.17.0"
33

44
action_groups:
55
gcp:

molecule/gcloud/Dockerfile.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN yum -y install python-pip
4646
{% endif %}
4747

4848
{# Install of Python3 #}
49-
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "debian:10"] %}
49+
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:10", "debian:11", "debian:12"] %}
5050
RUN apt-get update \
5151
&& apt-get install -y --no-install-recommends \
5252
apt-utils python3-setuptools python3-pip
@@ -99,13 +99,13 @@ RUN locale-gen en_US.UTF-8
9999
RUN mkdir -p /etc/ansible
100100
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
101101

102-
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10"] %}
102+
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10", "debian:11", "debian:12"] %}
103103
VOLUME ["/sys/fs/cgroup"]
104-
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04"] %}
104+
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04"] %}
105105
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
106106
{% endif %}
107107
{% if item.image in ["centos:7", "centos:8"] %}
108108
CMD ["/usr/sbin/init"]
109-
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "debian:9", "debian:10"] %}
109+
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:9", "debian:10", "debian:11", "debian:12"] %}
110110
CMD ["/lib/systemd/systemd"]
111111
{% endif %}

molecule/gcloud/molecule.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ lint: |
99
ansible-lint
1010
platforms:
1111
- name: instance
12-
image: ubuntu:20.04
12+
image: ubuntu:24.04
1313
privileged: true
1414
ansible.builtin.command: /lib/systemd/systemd
1515
volumes:
1616
- /sys/fs/cgroup:/sys/fs/cgroup:ro
1717
- name: instance
18-
image: debian:10
18+
image: debian:12
1919
privileged: true
2020
ansible.builtin.command: /lib/systemd/systemd
2121
volumes:

molecule/gcsfuse/Dockerfile.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN yum -y install python-pip
4646
{% endif %}
4747

4848
{# Install of Python3 #}
49-
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "debian:10"] %}
49+
{% if item.image in ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:10", "debian:11", "debian:12"] %}
5050
RUN apt-get update \
5151
&& apt-get install -y --no-install-recommends \
5252
apt-utils python3-setuptools python3-pip
@@ -99,13 +99,13 @@ RUN locale-gen en_US.UTF-8
9999
RUN mkdir -p /etc/ansible
100100
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
101101

102-
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10"] %}
102+
{% if item.image in ["centos:7", "centos:8", "debian:9", "debian:10", "debian:11", "debian:12"] %}
103103
VOLUME ["/sys/fs/cgroup"]
104-
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04"] %}
104+
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04"] %}
105105
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
106106
{% endif %}
107107
{% if item.image in ["centos:7", "centos:8"] %}
108108
CMD ["/usr/sbin/init"]
109-
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "debian:9", "debian:10"] %}
109+
{% elif item.image in ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:24.04", "debian:9", "debian:10", "debian:11", "debian:12"] %}
110110
CMD ["/lib/systemd/systemd"]
111111
{% endif %}

molecule/gcsfuse/molecule.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ lint: |
99
ansible-lint
1010
platforms:
1111
- name: instance
12-
image: ubuntu:20.04
12+
image: ubuntu:24.04
1313
privileged: true
1414
ansible.builtin.command: /lib/systemd/systemd
1515
volumes:
1616
- /sys/fs/cgroup:/sys/fs/cgroup:ro
1717
- name: instance
18-
image: debian:10
18+
image: debian:12
1919
privileged: true
2020
ansible.builtin.command: /lib/systemd/systemd
2121
volumes:

plugins/inventory/gcp_compute.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
DOCUMENTATION = """
99
name: gcp_compute
10-
plugin_type: inventory
1110
short_description: Google Cloud Compute Engine inventory source
1211
requirements:
1312
- requests >= 2.18.4
@@ -27,27 +26,32 @@
2726
description: A list of regions in which to describe GCE instances.
2827
If none provided, it defaults to all zones available to a given project.
2928
type: list
29+
elements: string
3030
folders:
3131
description: A folder that contains many projects
3232
type: list
3333
required: False
34+
elements: string
3435
projects:
3536
description: A list of projects in which to describe GCE instances.
3637
type: list
3738
required: False
39+
elements: string
3840
filters:
3941
description: >
4042
A list of filter value pairs. Available filters are listed here
4143
U(https://cloud.google.com/compute/docs/reference/rest/v1/instances/aggregatedList).
4244
Each additional filter in the list will be added as an AND condition
4345
(filter1 and filter2)
4446
type: list
47+
elements: string
4548
hostnames:
4649
description: A list of options that describe the ordering for which
4750
hostnames should be assigned. Currently supported hostnames are
4851
'public_ip', 'private_ip', 'name' or 'labels.vm_name'.
4952
default: ['public_ip', 'private_ip', 'name']
5053
type: list
54+
elements: string
5155
name_suffix:
5256
description: Custom domain suffix. If set, this string will be appended to all hosts.
5357
default: ""
@@ -63,6 +67,7 @@
6367
scopes:
6468
description: list of authentication scopes
6569
type: list
70+
elements: string
6671
default: ['https://www.googleapis.com/auth/compute']
6772
env:
6873
- name: GCP_SCOPES

plugins/lookup/gcp_secret_manager.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
__metaclass__ = type
66

77
DOCUMENTATION = '''
8-
author:
9-
- Dave Costakos <[email protected]>
108
name: gcp_secret_manager
9+
author: Dave Costakos (@davecostakos) <[email protected]>
1110
short_description: Get Secrets from Google Cloud as a Lookup plugin
1211
description:
1312
- retrieve secret keys in Secret Manager for use in playbooks
@@ -59,7 +58,7 @@
5958
description:
6059
- JSON Object representing the contents of a service_account_file obtained from Google Cloud
6160
- defaults to OS env variable GCP_SERVICE_ACCOUNT_INFO if not present
62-
type: jsonarg
61+
type: str
6362
required: False
6463
access_token:
6564
description:
@@ -84,6 +83,7 @@
8483
description:
8584
- Authenticaiton scopes for Google Secret Manager
8685
type: list
86+
elements: str
8787
default: ["https://www.googleapis.com/auth/cloud-platform"]
8888
'''
8989

plugins/modules/gcp_appengine_firewall_rule_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150

151151

152152
def main():
153-
module = GcpModule(argument_spec=dict())
153+
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
154154

155155
if not module.params['scopes']:
156156
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

plugins/modules/gcp_bigquery_dataset_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311

312312

313313
def main():
314-
module = GcpModule(argument_spec=dict())
314+
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
315315

316316
if not module.params['scopes']:
317317
module.params['scopes'] = ['https://www.googleapis.com/auth/bigquery']

plugins/modules/gcp_bigquery_table.py

+3
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@
253253
data .
254254
required: false
255255
type: int
256+
default: 0
256257
source_format:
257258
description:
258259
- The data format.
@@ -328,6 +329,7 @@
328329
when reading the data.
329330
required: false
330331
type: int
332+
default: 0
331333
csv_options:
332334
description:
333335
- Additional properties to set if sourceFormat is set to CSV.
@@ -368,6 +370,7 @@
368370
when reading the data.
369371
required: false
370372
type: int
373+
default: 0
371374
bigtable_options:
372375
description:
373376
- Additional options if sourceFormat is set to BIGTABLE.

plugins/modules/gcp_bigquery_table_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@
590590

591591

592592
def main():
593-
module = GcpModule(argument_spec=dict(dataset=dict(type='str')))
593+
module = GcpModule(argument_spec=dict(dataset=dict(type='str')), supports_check_mode=True)
594594

595595
if not module.params['scopes']:
596596
module.params['scopes'] = ['https://www.googleapis.com/auth/bigquery']

plugins/modules/gcp_bigtable_instance_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188

189189

190190
def main():
191-
module = GcpModule(argument_spec=dict())
191+
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
192192

193193
if not module.params['scopes']:
194194
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

plugins/modules/gcp_cloudbuild_trigger.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ def main():
15361536
),
15371537
),
15381538
pubsub_config=dict(type='dict', options=dict(topic=dict(required=True, type='str'), service_account_email=dict(type='str'))),
1539-
webhook_config=dict(type='dict', options=dict(secret=dict(required=True, type='str'))),
1539+
webhook_config=dict(type='dict', options=dict(secret=dict(required=True, type='str', no_log=True))),
15401540
build=dict(
15411541
type='dict',
15421542
options=dict(
@@ -1568,7 +1568,11 @@ def main():
15681568
queue_ttl=dict(type='str'),
15691569
logs_bucket=dict(type='str'),
15701570
timeout=dict(default='600s', type='str'),
1571-
secrets=dict(type='list', elements='dict', options=dict(kms_key_name=dict(required=True, type='str'), secret_env=dict(type='dict'))),
1571+
secrets=dict(
1572+
type='list',
1573+
elements='dict',
1574+
no_log=True,
1575+
options=dict(kms_key_name=dict(required=True, type='str'), secret_env=dict(type='dict', no_log=True))),
15721576
steps=dict(
15731577
required=True,
15741578
type='list',
@@ -1580,7 +1584,7 @@ def main():
15801584
id=dict(type='str'),
15811585
entrypoint=dict(type='str'),
15821586
dir=dict(type='str'),
1583-
secret_env=dict(type='list', elements='str'),
1587+
secret_env=dict(type='list', elements='str', no_log=True),
15841588
timeout=dict(type='str'),
15851589
timing=dict(type='str'),
15861590
volumes=dict(
@@ -1609,7 +1613,7 @@ def main():
16091613
worker_pool=dict(type='str'),
16101614
logging=dict(type='str'),
16111615
env=dict(type='list', elements='str'),
1612-
secret_env=dict(type='list', elements='str'),
1616+
secret_env=dict(type='list', elements='str', no_log=True),
16131617
volumes=dict(type='list', elements='dict', options=dict(name=dict(type='str'), path=dict(type='str'))),
16141618
),
16151619
),

plugins/modules/gcp_cloudbuild_trigger_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@
814814

815815

816816
def main():
817-
module = GcpModule(argument_spec=dict())
817+
module = GcpModule(argument_spec=dict(), supports_check_mode=True)
818818

819819
if not module.params['scopes']:
820820
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

plugins/modules/gcp_cloudfunctions_cloud_function_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273

274274

275275
def main():
276-
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')))
276+
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')), supports_check_mode=True)
277277

278278
if not module.params['scopes']:
279279
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

plugins/modules/gcp_cloudscheduler_job.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,8 @@ def main():
681681
http_method=dict(type='str'),
682682
body=dict(type='str'),
683683
headers=dict(type='dict'),
684-
oauth_token=dict(type='dict', options=dict(service_account_email=dict(required=True, type='str'), scope=dict(type='str'))),
685-
oidc_token=dict(type='dict', options=dict(service_account_email=dict(required=True, type='str'), audience=dict(type='str'))),
684+
oauth_token=dict(type='dict', no_log=True, options=dict(service_account_email=dict(required=True, type='str'), scope=dict(type='str'))),
685+
oidc_token=dict(type='dict', no_log=True, options=dict(service_account_email=dict(required=True, type='str'), audience=dict(type='str'))),
686686
),
687687
),
688688
region=dict(required=True, type='str'),

plugins/modules/gcp_cloudscheduler_job_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379

380380

381381
def main():
382-
module = GcpModule(argument_spec=dict(region=dict(required=True, type='str')))
382+
module = GcpModule(argument_spec=dict(region=dict(required=True, type='str')), supports_check_mode=True)
383383

384384
if not module.params['scopes']:
385385
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

plugins/modules/gcp_cloudtasks_queue_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279

280280

281281
def main():
282-
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')))
282+
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str')), supports_check_mode=True)
283283

284284
if not module.params['scopes']:
285285
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']

plugins/modules/gcp_compute_address_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235

236236

237237
def main():
238-
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
238+
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')), supports_check_mode=True)
239239

240240
if not module.params['scopes']:
241241
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

0 commit comments

Comments
 (0)