1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

terraform: add parallelism parameter (#3540)

* terraform: add parallelism parameter

* terraform: add parallelism parameter version
This commit is contained in:
linxside 2021-10-11 22:44:20 +02:00 committed by GitHub
parent d44c85aa90
commit ed2c1e4ac9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,3 @@
---
minor_changes:
- terraform - add ``parallelism`` parameter (https://github.com/ansible-collections/community.general/pull/3540).

View file

@ -137,6 +137,11 @@ options:
type: bool
default: false
version_added: '3.3.0'
parallelism:
description:
- Restrict concurrent operations when Terraform applies the plan.
type: int
version_added: '3.8.0'
notes:
- To just run a `terraform plan`, use check mode.
requirements: [ "terraform" ]
@ -363,6 +368,7 @@ def main():
init_reconfigure=dict(type='bool', default=False),
overwrite_init=dict(type='bool', default=True),
check_destroy=dict(type='bool', default=False),
parallelism=dict(type='int'),
),
required_if=[('state', 'planned', ['plan_file'])],
supports_check_mode=True,
@ -415,6 +421,9 @@ def main():
elif state == 'absent':
command.extend(DESTROY_ARGS)
if state == 'present' and module.params.get('parallelism') is not None:
command.append('-parallelism=%d' % module.params.get('parallelism'))
variables_args = []
for k, v in variables.items():
variables_args.extend([