Releases: hashicorp/terraform-ansible-collection
Releases · hashicorp/terraform-ansible-collection
2.0.0
Release Summary
Version 2.0.0 migrates the collection to the official pytfe SDK, updates the public authentication surface to tfe_* options, expands Terraform Cloud/Enterprise workspace management coverage, and adds a dynamic inventory plugin for statefile and outputs based inventory.
Major Changes
- client - Added a shared pytfe-backed
TerraformClientlifecycle wrapper for modules, lookups, action plugins, and inventory plugins. The wrapper centralizes token/address handling, timeout, retry, TLS verification, CA bundle, proxy, and collectionUser-Agentsuffix configuration. - module_utils - Removed the collection's custom request/session and local response-model layer in favor of the first-class pytfe SDK and pytfe's response models.
Minor Changes
- actions - Added
hashicorp.terraform.promote_runto gate and optionally apply a run based on Sentinel policy-check outcomes, andhashicorp.terraform.workspace_bootstrapto converge workspace settings, variables, variable-set attachments, run triggers, and notification configurations in one idempotent task. - inventory - Added the
hashicorp.terraform.tfc_invdynamic inventory plugin for HCP Terraform and Terraform Enterprise. The plugin supportssource=outputsandsource=statefile, targets a single workspace byworkspace_idor byorganizationplusworkspace, uses the pytfe SDK, supports constructed inventory features, and does not require the Terraform CLI or direct backend credentials. - inventory outputs source - Added
source=outputsto build hosts from current state version outputs. The source supportshosts_frommappings using Terraform type expressions for primitives, objects, lists, sets, maps, tuples, and dynamic values, including automaticansible_hostassignment for primitive shapes whencomposeis empty. - inventory outputs source - Object-shaped outputs spread user fields at the top level of host variables; primitive-shaped outputs expose the scalar as
value; map-shaped outputs use the map key as the inventory hostname.hostvars_prefixandhostvars_suffixcan namespace user fields while leaving plugin-injectedansible_hostandvalueunchanged. - inventory outputs source - Sensitive outputs are fetched with
display_sensitive=Falseand are masked by the shared output helper unless the API omits the value. - inventory statefile source - Added
source=statefileto build hosts from the latest Terraform state version. The source supports Terraform state v4, managed resources, optional child-module traversal withsearch_child_modules, built-in mappings for common AWS, AzureRM, and Google compute resources, customprovider_mappingentries, attribute and tag-based hostname preferences, include/exclude filters, and keyed groups. - inventory statefile source - Terraform resource attributes marked in
sensitive_attributesare stripped before host variables are emitted. Sensitive values are dropped rather than masked, and stripped values are not available to hostname resolution, filters, compose, groups, or keyed groups. - lookups - Added
hashicorp.terraform.tf_policy_checks,hashicorp.terraform.tf_run_events, andhashicorp.terraform.tf_variable_set_varsfor policy-check gating, run timeline inspection, and variable-set variable retrieval. Sensitive variable-set values are masked by default. - module_utils - Added pytfe-backed helpers for notification configurations, organizations, run events, run triggers, SSH keys, workspace variables, variable-set variables, and variable sets.
- modules - Added
hashicorp.terraform.notification_configuration,hashicorp.terraform.organizations,hashicorp.terraform.run_trigger,hashicorp.terraform.ssh_keys,hashicorp.terraform.variable, andhashicorp.terraform.variable_sets. - modules - The previously released modules (
configuration_version,configuration_version_info,output,project,project_info,run,run_info,view_plan,workspace,workspace_info) have been re-implemented on the pytfe SDK. Public module parameters are unchanged apart from the shared authentication surface migration noted in breaking_changes.
Breaking Changes / Porting Guide
- authentication - The canonical authentication and transport options are now
tfe_token,tfe_address,tfe_timeout,tfe_verify_tls,tfe_max_retries,tfe_ca_bundle, andtfe_proxies. Thetf_tokenoption remains as an alias fortfe_tokenfor compatibility, but old transport names such astf_hostname,tf_validate_certs,tf_timeout, andtf_max_retriesare not supported by the pytfe-backed client. The primary environment variables also move toTFE_TOKENandTFE_ADDRESS. - client - The collection now uses a shared pytfe-backed client wrapper (
plugins/module_utils/client.py) instead of the removedplugins/module_utils/common.pyrequest helpers. Custom plugins or automation that imported the internalcommonmodule must migrate toAnsibleTerraformModuleandTerraformClientfromplugins/module_utils/client.py.
Bugfixes
- modules - Preserved task invocation parameters in module results so module code does not override the invocation data reported by Ansible.
- run - Increased the default run polling timeout to 120 seconds to avoid premature timeout failures on normal Terraform Cloud/Enterprise runs.
New Plugins
Inventory
- tfc_inv - Unified dynamic inventory plugin for HCP Terraform / Terraform Enterprise. Supports statefile and output based inventory.
Lookup
- tf_policy_checks - Retrieve Sentinel policy check outcomes for a run
- tf_run_events - Retrieve the timeline of events for a Terraform Cloud/Enterprise run
- tf_variable_set_vars - Retrieve variables owned by a Terraform Cloud/Enterprise variable set
New Modules
- notification_configuration - Manage Terraform Cloud/Enterprise workspace notification configurations (create, update, delete).
- organizations - Manage Terraform Cloud/Enterprise organizations (create, update, delete).
- promote_run - Gate and apply a Terraform Cloud/Enterprise run based on policy outcomes.
- run_trigger - Manage Terraform Cloud/Enterprise run triggers (create, delete).
- ssh_keys - Manage Terraform Cloud/Enterprise organization SSH keys (create, update, delete).
- variable - Manage Terraform Cloud/Enterprise workspace variables (create, update, delete).
- variable_sets - Manage Terraform Cloud/Enterprise variable sets (create, update, delete, attach).
- workspace_bootstrap - Converge a Terraform Cloud/Enterprise workspace baseline in a single task.
1.2.0
Release Notes
Latest Release: 1.2.0
New Modules
- output - Retrieve Terraform Cloud/Enterprise state version outputs
- project - Manage Terraform Cloud/Enterprise projects (create, update, delete).
- project_info - Gather information about a project in Terraform Enterprise/Cloud.
Lookup
- tf_output - Retrieve Terraform Cloud/Enterprise output values
Bugfixes
- Increased the default poll_timeout for the run module to 120s. The previous default of 25s was low and caused issues in tasks.
1.1.0
New Modules
- configuration_version_info - Retrieve information about configuration versions in Terraform Enterprise/Cloud.
- run_info - Retrieve information about a run in Terraform Enterprise/Cloud.
- view_plan - View Terraform Cloud/Enterprise plan information
- workspace - Manage workspaces in Terraform Enterprise/Cloud.
- workspace_info - Gather information about a workspace in Terraform Enterprise/Cloud.
Bugfixes
- Ensures module invocation parameters in the task execution result aren't overridden by module code logic.
Full Changelog: 1.0.0...1.1.0
1.0.0
Release Summary
This marks the first release of the hashicorp.terraform collection.
New Modules
configuration_version— Manage configuration versions in Terraform Enterprise/Cloud.run— Manage Terraform Cloud/Enterprise runs (create, apply, cancel, discard).