community.general.ce_ntp (0.1.1) — module

Manages core NTP configuration on HUAWEI CloudEngine switches.

Authors: Zhijin Zhou (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manages core NTP configuration on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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 }}"

Inputs

    
peer:
    description:
    - Network address of NTP peer.

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Manage the state of the resource.

key_id:
    description:
    - Authentication key identifier to use with given NTP server or peer.

server:
    description:
    - Network address of NTP server.

vpn_name:
    default: _public_
    description:
    - Makes the device communicate with the given NTP server or peer over a specific vpn.

source_int:
    description:
    - Local source interface from which NTP messages are sent. Must be fully qualified
      interface name, i.e. C(40GE1/0/22), C(vlanif10). Interface types, such as C(10GE),
      C(40GE), C(100GE), C(Eth-Trunk), C(LoopBack), C(MEth), C(NULL), C(Tunnel), C(Vlanif).

is_preferred:
    choices:
    - enable
    - disable
    description:
    - Makes given NTP server or peer the preferred NTP server or peer for the device.

Outputs

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