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

init_reconfigure fails on module cloud/misc/terraform.py (#1620)

* fix reconfigure option

If `init_reconfigure` is true, the init fails because it is run as:
`terraform init -input=false - r e c o n f i g u r e`

* changelog fragment

* typo

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
christophemorio 2021-01-13 07:49:00 +01:00 committed by GitHub
parent 19fdb29db7
commit 9f4fd4c899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- terraform - fix ``init_reconfigure`` option for proper CLI args (https://github.com/ansible-collections/community.general/pull/1620).

View file

@ -219,7 +219,7 @@ def init_plugins(bin_path, project_path, backend_config, backend_config_files, i
for f in backend_config_files: for f in backend_config_files:
command.extend(['-backend-config', f]) command.extend(['-backend-config', f])
if init_reconfigure: if init_reconfigure:
command.extend('-reconfigure') command.extend(['-reconfigure'])
rc, out, err = module.run_command(command, cwd=project_path) rc, out, err = module.run_command(command, cwd=project_path)
if rc != 0: if rc != 0:
module.fail_json(msg="Failed to initialize Terraform modules:\r\n{0}".format(err)) module.fail_json(msg="Failed to initialize Terraform modules:\r\n{0}".format(err))