Your Ansible playbook must push interface descriptions and a syslog server to 40 IOS XE switches over SSH, apply only what is missing, and save the running configuration when it finishes. Re-running the playbook should change nothing on devices that already match. Which connection type and module pairing should the playbook use?
Select an answer to reveal the explanation.
Short Explanation
Right on — network_cli is the SSH transport and ios_config is the module made for configuration work. It compares what you asked for with what's already on the switch and sends only the difference. It's like a packing list that skips the socks you already folded.
Full Explanation
Ansible separates transport from task: connection: network_cli opens the SSH command-line session that the cisco.ios collection expects, and the ios_config module drives it with configuration-mode handling. Because the module compares the requested lines against the device's current configuration, a second run finds nothing to change, it understands parent context such as an interface stanza, and its save_when option can write the running configuration to startup at the end of the task. Choosing httpapi is a transport mismatch, since that connection type targets HTTP-based device APIs and the cisco.ios config modules are not built to run over it. Reaching for cli_command keeps the SSH session but does not provide ios_config's configuration diff, parent-context, or save_when behavior. Using ios_command keeps the connection correct but does not provide ios_config's configuration-management behavior for applying and checking configuration lines. Exam caveat: collection names moved to the cisco.ios namespace years ago, so older examples showing a bare ios_config may need the prefix. Practical check: run the playbook twice with -v and watch the second pass report zero changed.