Skip to content

Commit

Permalink
add tf_in_automation env to module execution
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Dec 9, 2024
1 parent cfb1537 commit bfd7a76
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### 1.1.1 (Next)
- Various plugin module code stability improvements and fixes.

### 1.1.0
- Add first set of Terraform modules.
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/terraform_fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def main() -> None:
return_code: int
stdout: str
stderr: str
return_code, stdout, stderr = module.run_command(command, cwd=config_dir)
return_code, stdout, stderr = module.run_command(command, cwd=config_dir, environ_update={'TF_IN_AUTOMATION':'true'})

# post-process
if return_code == 0:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/terraform_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def main() -> None:
return_code: int
stdout: str
stderr: str
return_code, stdout, stderr = module.run_command(command, cwd=config_dir)
return_code, stdout, stderr = module.run_command(command, cwd=config_dir, environ_update={'TF_IN_AUTOMATION':'true'})

# check idempotence
if 'Import successful!' in stdout:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/terraform_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def main() -> None:
return_code: int
stdout: str
stderr: str
return_code, stdout, stderr = module.run_command(command, cwd=config_dir)
return_code, stdout, stderr = module.run_command(command, cwd=config_dir, environ_update={'TF_IN_AUTOMATION':'true'})

# check idempotence
if 'successfully initialized' in stdout:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/terraform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def main() -> None:
return_code: int
stdout: str
stderr: str
return_code, stdout, stderr = module.run_command(command, cwd=config_dir)
return_code, stdout, stderr = module.run_command(command, cwd=config_dir, environ_update={'TF_IN_AUTOMATION':'true'})

# post-process
if return_code == 0:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/terraform_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def main() -> None:
return_code: int
stdout: str
stderr: str
return_code, stdout, stderr = module.run_command(command, cwd=config_dir)
return_code, stdout, stderr = module.run_command(command, cwd=config_dir, environ_update={'TF_IN_AUTOMATION':'true'})

# post-process
if return_code == 0:
Expand Down

0 comments on commit bfd7a76

Please sign in to comment.