Practice Free EX457 Exam Online Questions
A Project is configured to pull playbooks from the `main` branch. An administrator creates a Job Template to run a playbook from this Project. In the Job Template settings, the administrator enters `feature/new-bgp-policy` into the "Branch Override" field.
What happens when this Job Template is launched? (Select all that apply.)
- A . If the `feature/new-bgp-policy` branch exists in the remote repository, the job will execute using the playbooks from that branch.
- B . This Job Template must have "Prompt on Launch" enabled for the branch override to take effect.
- C . On job launch, Automation Controller will attempt to check out the code from the `feature/new-bgp-policy` branch.
- D . The job will fail because the branch set in the Project cannot be overridden.
- E . The Project’s default "Source Control Branch" setting will be permanently changed to `feature/new-bgp-policy`.
A playbook needs to apply a configuration to a list of VLAN IDs. The initial list is provided as a string from an external system.
"vlan_string": "10,20,30, 40 ,50"
The `ios_vlans` module requires a list of integers, not a string.
Which sequence of filters will correctly transform `vlan_string` into the required format `[10, 20, 30, 40, 50]`?
- A . `{{ vlan_string | split(‘,’) | map(‘trim’) | map(‘int’) | list }}`
- B . `{{ vlan_string | to_yaml | map(‘int’) }}`
- C . `{{ vlan_string | split(‘,’) | list }}`
- D . `{{ vlan_string | split(‘ ‘) | map(‘int’) | list }}`
A playbook needs to apply a configuration to a list of VLAN IDs. The initial list is provided as a string from an external system.
"vlan_string": "10,20,30, 40 ,50"
The `ios_vlans` module requires a list of integers, not a string.
Which sequence of filters will correctly transform `vlan_string` into the required format `[10, 20, 30, 40, 50]`?
- A . `{{ vlan_string | split(‘,’) | map(‘trim’) | map(‘int’) | list }}`
- B . `{{ vlan_string | to_yaml | map(‘int’) }}`
- C . `{{ vlan_string | split(‘,’) | list }}`
- D . `{{ vlan_string | split(‘ ‘) | map(‘int’) | list }}`
A playbook task registers the following variable, `service_data`, which contains a dictionary of network services and their states.
"service_data": {
"ntp": {
"state": "enabled",
"server": "1.1.1.1"
},
"dns": {
"state": "disabled",
"server": "8.8.8.8"
},
"snmp": {
"state": "enabled",
"community": "public"
}
}
An administrator wants to create a simple list containing only the names of the services that are "enabled".
Which Jinja2 expression will accomplish this?
- A . `{{ service_data | dict2items | selectattr(‘value.state’, ‘equalto’, ‘enabled’) | map(attribute=’key’) | list }}`
- B . `{{ service_data | selectattr(‘state’, ‘enabled’) }}`
- C . `{{ service_data | to_json | search(‘enabled’) }}`
- D . `{{ service_data | items2dict | map(‘enabled’) }}`
An engineer wants to create a new directory for playbook backups and immediately change into that new directory. They want to ensure the second command only runs if the first command is successful.
They execute the following command but it fails:
[student@control-node ~]$ mkdir /root/backups && cd /root/backups
mkdir: cannot create directory ‘/root/backups’: Permission denied
Which statement accurately describes the outcome of this command sequence?
- A . The `&&` operator causes the `mkdir` command to be retried until it succeeds.
- B . The `mkdir` command fails, but the `cd` command still executes, causing an error.
- C . Both the `mkdir` and `cd` commands execute, but a warning is displayed.
- D . The `mkdir` command fails, and because the `&&` operator was used, the `cd` command does not execute.
An engineer is writing a script to run a playbook and then perform a cleanup task. The cleanup task (e.g., `rm -rf /tmp/playbook-run-cache`) must be executed after the playbook run, regardless of whether the `ansible-navigator run` command succeeds or fails.
Which command separator should be used between the `ansible-navigator` command and the `rm` command to ensure this behavior?
- A . `&&`
- B . `||`
- C . `;`
- D . `|`
An engineer needs to write a playbook that first gathers facts from all network devices and then applies a specific security patch using a role named `apply_security_patch`. However, the patch is only compatible with devices of the model "vEOS-LAB".
Assuming the `ansible.builtin.import_role` task is used, which `when` condition correctly ensures the role is applied only to the targeted devices?
- A . `when: ansible_net_model is "vEOS-LAB"`
- B . `when: item.model == "vEOS-LAB"`
- C . `when: ansible_net_model == "vEOS-LAB"`
- D . `when: ansible_facts[‘ansible_net_model’] == "vEOS-LAB"`
An administrator is creating a Job Template in Automation Controller to run a playbook against a set of Arista switches. The playbook requires SSH access with a specific username and password to configure the switches.
Which credential type must be created and associated with the Job Template for the playbook to authenticate successfully to the Arista switches?
- A . Vault
- B . Ansible Galaxy
- C . Machine
- D . Source Control
An administrator is creating a Job Template in Automation Controller to run a playbook against a set of Arista switches. The playbook requires SSH access with a specific username and password to configure the switches.
Which credential type must be created and associated with the Job Template for the playbook to authenticate successfully to the Arista switches?
- A . Vault
- B . Ansible Galaxy
- C . Machine
- D . Source Control
What is the primary advantage of using a Source Code Management (SCM) system like Git to manage playbooks within Ansible Automation Controller?
- A . It automatically encrypts all variables within the playbooks.
- B . It guarantees that the playbooks will run successfully in any execution environment.
- C . It automatically pushes the execution results of the playbook to the Git repository.
- D . It provides version control, collaboration, and a history of changes for the playbooks.
