Documentation

ce_ntp_auth - Manages NTP authentication configuration on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Manages NTP authentication configuration on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
auth_mode
no
  • hmac-sha256
  • md5
Specify authentication algorithm.
auth_pwd
no
Plain text with length of 1 to 255, encrypted text with length of 20 to 392.
auth_type
no encrypt
  • 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
no
  • enable
  • disable
Configure ntp authentication enable or unconfigure ntp authentication enable.
key_id
yes
Authentication key identifier (numeric).
state
no present
  • present
  • absent
Manage the state of the resource.
trusted_key
no disable
  • enable
  • disable
Whether the given key is required to be supplied by a time source for the device to synchronize to the time source.

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"
    ce_ntp_auth:
      key_id: 32
      auth_mode: md5
      auth_pwd: 11111111111111111111111
      provider: "{{ cli }}"

  - name: "Configure ntp authentication key-id and trusted authentication keyid"
    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"
    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"
    ce_ntp_auth:
      key_id: 32
      state: absent
      provider: "{{ cli }}"

  - name: "Unconfigure ntp authentication key-id and authentication enable"
    ce_ntp_auth:
      key_id: 32
      authentication: enable
      state: absent
      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
changed
check to see if a change was made on the device
always boolean True
end_state
k/v pairs of ntp authentication after module execution
always dict {'authentication-keyid': [{'key_id': '1', 'trusted_key': 'disable', 'auth_mode': 'md5'}, {'key_id': '32', 'trusted_key': 'enable', 'auth_mode': 'md5'}], 'authentication': 'off'}
existing
k/v pairs of existing ntp authentication
always dict {'authentication-keyid': [{'key_id': '1', 'trusted_key': 'disable', 'auth_mode': 'md5'}], 'authentication': 'off'}
proposed
k/v pairs of parameters passed into module
always dict {'auth_type': 'text', 'authentication': 'enable', 'state': 'present', 'auth_pwd': '1111', 'key_id': '32', 'trusted_key': 'enable', 'auth_mode': 'md5'}
state
state as sent in from the playbook
always string present
updates
command sent to the device
always list ['ntp authentication-key 32 md5 1111', 'ntp trusted-key 32', 'ntp authentication enable']


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.

Status

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

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