A platform team with 60 IOS XE switches must choose between Ansible and Terraform and wants an honest summary of how each tool's core pieces work. They care about listing targets, describing the desired configuration, and seeing drift before applying anything. Which statement correctly contrasts the Ansible inventory with the Terraform state file and plan?
Select an answer to reveal the explanation.
Short Explanation
Your Ansible inventory is like an address book: it lists target hosts, groups, and variables, while Terraform state links managed resources to real devices. When Terraform refreshes that state, its plan can flag drift before you apply changes; the inventory isn’t a record of the last deployment.
Full Explanation
Terraform uses declarative configuration and a state file that maps managed resource instances to remote objects. A plan can refresh state from the provider and report differences before making changes, so the drift view depends on provider support and a successful refresh. Ansible works differently: an inventory defines hosts, groups, and variables for playbooks, and tasks generally act on live device state during execution; Ansible does not provide a Terraform-style state file for diffing deployed configurations. Both tools can manage IOS XE without an agent installed on the switches, using supported network interfaces and integrations. Terraform uses provider-based configuration, not Ansible inventory and playbook files. A Terraform plan is only as accurate as the available provider data and state refresh. Ansible check mode can preview some changes, but its results depend on the modules and tasks used.