diff --git a/changelogs/fragments/5147-terraform-init-no-color.yml b/changelogs/fragments/5147-terraform-init-no-color.yml new file mode 100644 index 0000000000..6f0e805ea3 --- /dev/null +++ b/changelogs/fragments/5147-terraform-init-no-color.yml @@ -0,0 +1,2 @@ +minor_changes: + - terraform - run ``terraform init`` with ``-no-color`` not to mess up the stdout of the task (https://github.com/ansible-collections/community.general/pull/5147). diff --git a/plugins/modules/cloud/misc/terraform.py b/plugins/modules/cloud/misc/terraform.py index c8b654eb12..e4da9cbbf0 100644 --- a/plugins/modules/cloud/misc/terraform.py +++ b/plugins/modules/cloud/misc/terraform.py @@ -273,7 +273,7 @@ def _state_args(state_file): def init_plugins(bin_path, project_path, backend_config, backend_config_files, init_reconfigure, provider_upgrade, plugin_paths): - command = [bin_path, 'init', '-input=false'] + command = [bin_path, 'init', '-input=false', '-no-color'] if backend_config: for key, val in backend_config.items(): command.extend([