Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform: run init with no-color, too #5147

Merged

Conversation

azrdev
Copy link
Contributor

@azrdev azrdev commented Aug 23, 2022

SUMMARY

When running terraform init fails, it would output ansi color sequences, making the output hard to read.

Maybe setting TF_IN_AUTOMATION would also be beneficial: https://www.terraform.io/cli/config/environment-variables#tf_in_automation

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

terraform

ADDITIONAL INFORMATION

When running `terraform init` fails, it would output ansi color sequences, making the output hard to read.

Maybe setting TF_IN_AUTOMATION would also be beneficial: https://www.terraform.io/cli/config/environment-variables#tf_in_automation
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Aug 23, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Could you please add a changelog fragment? Thanks.

Also a question: does it make sense to pass that flag only here, and nowhere else? Also, is this flag supported by all versions of terraform?

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Aug 23, 2022
@azrdev
Copy link
Contributor Author

azrdev commented Aug 29, 2022

Current terraform indeed has -no-color as a global argument, so I assume it's applicable to all commands:
https://github.com/hashicorp/terraform/blob/71dec30/internal/command/arguments/view.go#L26

I don't know when this parameter was introduced, https://www.terraform.io/cli/v1.1.x/commands/init and the current 1.2 have it without version notice. S/o would have to look that up.

@ansibullbot ansibullbot removed the small_patch Hopefully easy to review label Aug 29, 2022
@ansibullbot
Copy link
Collaborator

The test licenses failed with 2 errors:

changelogs/5147-terraform-init-no-color.yml:0:0: found no copyright notice
changelogs/5147-terraform-init-no-color.yml:0:0: must have at least one license

click here for bot help

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Aug 29, 2022
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Sep 6, 2022
@felixfontein
Copy link
Collaborator

@azrdev ping?

needs_info

@ansibullbot ansibullbot added the needs_info This issue requires further information. Please answer any outstanding questions label Sep 12, 2022
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI stale_ci CI is older than 7 days, rerun before merging labels Sep 28, 2022
@azrdev
Copy link
Contributor Author

azrdev commented Sep 28, 2022

@felixfontein changed as proposed

@ansibullbot ansibullbot removed needs_info This issue requires further information. Please answer any outstanding questions needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Sep 28, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nobody complains, I'll merge in a couple of days.

@felixfontein felixfontein merged commit 202cabc into ansible-collections:main Oct 1, 2022
This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants