Dell-Networking.dellos-ntp
NTP Role
This role helps set up Network Time Protocol (NTP) features for Dell networking devices. It supports Dell operating systems: dellos6, dellos9, and dellos10. It allows you to configure the NTP server and other NTP settings specifically for dellos10.
To use this role, you need an SSH connection to a Dell EMC Networking device. You can utilize any of the built-in connection variables offered by the operating system.
Installation
You can install this role using the following command:
ansible-galaxy install Dell-Networking.dellos-ntp
Role Variables
Here's a summary of the variables you can use in this role:
- The role uses the variable ansible_network_os, which can take values dellos6, dellos9, or dellos10.
- If dellos_cfg_generate is true, configuration commands are generated in a file.
- Any variable set to "absent" will not be configured; similarly, setting any variable to empty will also prevent it from being set.
- Remember that variable names and values are case-sensitive.
dellos_ntp Keys
Key | Type | Description | Supported OS |
---|---|---|---|
server |
list | Configures the NTP server | dellos6, dellos9, dellos10 |
server.ip |
string (required) | Sets an IPv4 address for the NTP server | dellos6, dellos9, dellos10 |
server.key |
integer | Sets the peer authentication key for the NTP server | dellos10 |
server.prefer |
boolean | Sets the peer preference | dellos10 |
server.vrf |
list | Configures NTP server for VRF; list contains VRF names | dellos9 |
server.state |
string: absent,present* | Deletes the NTP server if set to absent | dellos6, dellos9, dellos10 |
source |
string | Configures the interface for the source address | dellos10 |
master |
integer | Sets the local clock to act as the NTP server | dellos10 |
authenticate |
boolean | Configures authentication for time sources | dellos10 |
authentication_key |
list | Configures keys for trusted time sources | dellos10 |
trusted_key |
list | Configures key numbers for trusted time sources | dellos10 |
intf |
dictionary | Configures NTP on the interface | dellos10 |
<interface name> |
dictionary | Configures NTP for that specific interface | dellos10 |
<interface name>.disable |
boolean | Disables NTP on the interface | dellos10 |
<interface name>.broadcast |
boolean | Configures NTP broadcast client service on the interface | dellos10 |
NOTE: An asterisk (*) indicates the default value if none is specified.
Connection Variables
To connect to Dell EMC devices, you need to provide connection details. These can be kept in the group_vars or host_vars directories, in your inventory, or in the playbook itself.
Key | Required | Choices | Description |
---|---|---|---|
ansible_host |
yes | Hostname or address for connecting to the device | |
ansible_port |
no | Port for connection (default is 22) | |
ansible_ssh_user |
no | Username for CLI login | |
ansible_ssh_pass |
no | Password for connection | |
ansible_become |
no | yes, no* | Switches to privileged mode before sending commands |
ansible_become_method |
no | enable, sudo* | Method for privilege escalation |
ansible_become_pass |
no | Password for privileged mode (if needed) | |
ansible_network_os |
yes | dellos6, dellos9, dellos10, null* | Loads correct plugins for communication |
NOTE: An asterisk (*) indicates the default value if none is specified.
Dependencies
The dellos-ntp role relies on core Ansible modules, which were added in Ansible version 2.2.0.
Example Playbook
Here's a simple example that uses the dellos-ntp role to configure the NTP server, source IP, authentication, and broadcast service. You will first create a hosts file with switch details and appropriate variables.
Sample hosts file
leaf1 ansible_host=<ip_address>
Sample host_vars/leaf1
host: leaf1
ansible_ssh_user: xxxxx
ansible_ssh_pass: xxxxx
ansible_network_os: dellos10
build_dir: ../temp/dellos10
dellos_ntp:
source: ethernet 1/1/2
master: 5
authenticate: true
authentication_key:
- key_num: 123
key_string_type: 7
key_string: test
state: present
trusted_key:
- key_num: 1323
state: present
server:
- ip: 2.2.2.2
key: 345
prefer: true
state: present
intf:
ethernet 1/1/2:
disable: true
broadcast: true
Simple Playbook to Set Up NTP - leaf.yaml
- hosts: leaf1
roles:
- Dell-Networking.dellos-ntp
To Run:
ansible-playbook -i hosts leaf.yaml
(c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
The dellos-ntp role facilitates the configuration of NTP attributes in devices running Dell EMC Networking Operating Systems.
ansible-galaxy install Dell-Networking.dellos-ntp