300-435 Question 89
Select 3You are tasked with configuring an IOS XE device using Ansible. You need to apply a configuration to enable an interface and assign it an IP address. Which of the following steps are required to achieve this using an Ansible playbook?
- A
Define the 'hosts' parameter in the playbook to specify the target IOS XE device.
- B
Use the 'ios_config' module to apply the configuration to the IOS XE device.
- C
Define the 'ansible_connection' as 'ssh' in the inventory file.
- D
Include the 'become: yes' directive to elevate privileges on the IOS XE device.
- E
Use the 'ios_facts' module to gather device information before applying the configuration.
Show answer and explanation
Correct answers: A, B, C
Explanation
To configure an IOS XE device using Ansible, you must define the target device in the 'hosts' parameter of the playbook, use the 'ios_config' module to apply the configuration, and ensure the Ansible inventory specifies 'ansible_connection' as 'ssh' for proper communication. The 'become' directive is unnecessary for IOS XE, and while 'ios_facts' is useful for gathering information, it is not a requirement for this specific task.
- A. Correct.
The 'hosts' parameter specifies which devices the playbook will target, and this is essential for applying configurations to the IOS XE device.
- B. Correct.
The 'ios_config' module is used to push configuration commands to IOS XE devices, making it the correct module for this task.
- C. Correct.
The 'ansible_connection' should be set as 'ssh' in the inventory file to ensure proper communication with the IOS XE device.
- D. Incorrect.
The 'become' directive is not required for IOS XE devices, as privilege escalation is typically handled through the device's enable mode.
- E. Incorrect.
While the 'ios_facts' module can gather information about the IOS XE device, it is not mandatory for applying a configuration using the 'ios_config' module.