W3cubDocs

/Ansible

community.network.ce_ntp_auth – Manages NTP authentication configuration on HUAWEI CloudEngine switches.

Note

This plugin is part of the community.network collection (version 3.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.network.

To use it in a playbook, specify: community.network.ce_ntp_auth.

Synopsis

  • Manages NTP authentication configuration on HUAWEI CloudEngine switches.

Parameters

Parameter Choices/Defaults Comments
auth_mode
string
    Choices:
  • hmac-sha256
  • md5
Specify authentication algorithm.
auth_pwd
string
Plain text with length of 1 to 255, encrypted text with length of 20 to 392.
auth_type
string
    Choices:
  • text
  • encrypt
Whether the given password is in cleartext or has been encrypted. If in cleartext, the device will encrypt it before storing it.
authentication
string
    Choices:
  • enable
  • disable
Configure ntp authentication enable or unconfigure ntp authentication enable.
key_id
string / required
Authentication key identifier (numeric).
state
string
    Choices:
  • present
  • absent
Manage the state of the resource.
trusted_key
string
    Choices:
  • enable
  • disable
Whether the given key is required to be supplied by a time source for the device to synchronize to the time source.

Notes

Note

  • If state=absent, the module will attempt to remove the given key configuration. If a matching key configuration isn’t found on the device, the module will fail.
  • If state=absent and authentication=on, authentication will be turned on.
  • If state=absent and authentication=off, authentication will be turned off.
  • Recommended connection is network_cli.
  • This module also works with local connections for legacy playbooks.

Examples

- name: NTP AUTH 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: "Configure ntp authentication key-id"
    community.network.ce_ntp_auth:
      key_id: 32
      auth_mode: md5
      auth_pwd: 11111111111111111111111
      provider: "{{ cli }}"

  - name: "Configure ntp authentication key-id and trusted authentication keyid"
    community.network.ce_ntp_auth:
      key_id: 32
      auth_mode: md5
      auth_pwd: 11111111111111111111111
      trusted_key: enable
      provider: "{{ cli }}"

  - name: "Configure ntp authentication key-id and authentication enable"
    community.network.ce_ntp_auth:
      key_id: 32
      auth_mode: md5
      auth_pwd: 11111111111111111111111
      authentication: enable
      provider: "{{ cli }}"

  - name: "Unconfigure ntp authentication key-id and trusted authentication keyid"
    community.network.ce_ntp_auth:
      key_id: 32
      state: absent
      provider: "{{ cli }}"

  - name: "Unconfigure ntp authentication key-id and authentication enable"
    community.network.ce_ntp_auth:
      key_id: 32
      authentication: enable
      state: absent
      provider: "{{ cli }}"

Return Values

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

Key Returned Description
changed
boolean
always
check to see if a change was made on the device

Sample:
True
end_state
dictionary
always
k/v pairs of ntp authentication after module execution

Sample:
{'authentication': 'off', 'authentication-keyid': [{'auth_mode': 'md5', 'key_id': '1', 'trusted_key': 'disable'}, {'auth_mode': 'md5', 'key_id': '32', 'trusted_key': 'enable'}]}
existing
dictionary
always
k/v pairs of existing ntp authentication

Sample:
{'authentication': 'off', 'authentication-keyid': [{'auth_mode': 'md5', 'key_id': '1', 'trusted_key': 'disable'}]}
proposed
dictionary
always
k/v pairs of parameters passed into module

Sample:
{'auth_mode': 'md5', 'auth_pwd': '1111', 'auth_type': 'text', 'authentication': 'enable', 'key_id': '32', 'state': 'present', 'trusted_key': 'enable'}
state
string
always
state as sent in from the playbook

Sample:
present
updates
list / elements=string
always
command sent to the device

Sample:
['ntp authentication-key 32 md5 1111', 'ntp trusted-key 32', 'ntp authentication enable']


Authors

  • Zhijin Zhou (@QijunPan)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/network/ce_ntp_auth_module.html