350-901 · Question #19
Refer to the exhibit. Which key value pair from the ios_ntp Ansible module creates an NTP server peer? name: IOS XE Configuration hosts: ios_xe connection: local gather_facts: false tasks: - name…
The correct answer is A. state: present. The state: present key-value pair instructs Ansible to ensure the NTP server configuration exists, which creates the NTP peer if it is not already present.
Question
- name: IOS XE Configuration hosts: ios_xe connection: local gather_facts: false
- name: IOS NTP ios_ntp: provider: "{{ creds }}" server: 10.0.255.10 source_int: GigabitEthernet2 logging: false
Options
- Astate: present
- Bstate: True
- Cconfig: present
- Dconfig: True
How the community answered
(32 responses)- A88% (28)
- B3% (1)
- C3% (1)
- D6% (2)
Why each option
The state: present key-value pair instructs Ansible to ensure the NTP server configuration exists, which creates the NTP peer if it is not already present.
In Ansible modules, state: present is the standard idempotent directive that tells the module to create or ensure the existence of the specified resource - in this case the NTP server peer defined by the server and source_int parameters. Without state: present, the module may not take any action to persist the configuration to the device.
state: True is not a valid Ansible module state value; Ansible states use string literals such as present, absent, or enabled.
config is not a valid parameter key for the ios_ntp module; the correct parameter for declaring intent is state.
config: True is not a recognized parameter or value combination in the ios_ntp Ansible module.
Concept tested: Ansible ios_ntp module state parameter for NTP configuration
Source: https://docs.ansible.com/ansible/latest/collections/cisco/ios/ios_ntp_global_module.html
Topics
Community Discussion
No community discussion yet for this question.