Documentation

ce_ntp - Manages core NTP configuration on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Manages core NTP configuration on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
is_preferred
no
  • enable
  • disable
Makes given NTP server or peer the preferred NTP server or peer for the device.
key_id
no
Authentication key identifier to use with given NTP server or peer.
peer
no
Network address of NTP peer.
server
no
Network address of NTP server.
source_int
no
Local source interface from which NTP messages are sent. Must be fully qualified interface name, i.e. 40GE1/0/22, vlanif10. Interface types, such as 10GE, 40GE, 100GE, Eth-Trunk, LoopBack, MEth, NULL, Tunnel, Vlanif.
state
no present
  • present
  • absent
Manage the state of the resource.
vpn_name
no _public_
Makes the device communicate with the given NTP server or peer over a specific vpn.

Examples

- name: NTP test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Set NTP Server with parameters"
    ce_ntp:
      server: 192.8.2.6
      vpn_name: js
      source_int: vlanif4001
      is_preferred: enable
      key_id: 32
      provider: "{{ cli }}"

  - name: "Set NTP Peer with parameters"
    ce_ntp:
      peer: 192.8.2.6
      vpn_name: js
      source_int: vlanif4001
      is_preferred: enable
      key_id: 32
      provider: "{{ cli }}"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
end_state k/v pairs of ntp info after module execution always dict {'key_id': '48', 'vpn_name': 'js', 'server': '2.2.2.2', 'is_preferred': 'enable', 'source_int': 'vlanif4002'}
changed check to see if a change was made on the device always boolean True
updates command sent to the device always list ['ntp server 2.2.2.2 authentication-keyid 48 source-interface vlanif4002 vpn-instance js preferred']
proposed k/v pairs of parameters passed into module always dict {'state': 'present', 'is_preferred': 'enable', 'key_id': '48', 'vpn_name': 'js', 'server': '2.2.2.2', 'source_int': 'vlanif4002'}
existing k/v pairs of existing ntp server/peer always dict {'key_id': '32', 'vpn_name': 'js', 'server': '2.2.2.2', 'is_preferred': 'disable', 'source_int': 'vlanif4002'}


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.