huawei.enterprise.hw_enterprise_ntp_server module – NTP Server operations for Huawei Enterprise Storage

Note

This module is part of the huawei.enterprise collection (version 2.0.0).

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 huawei.enterprise. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: huawei.enterprise.hw_enterprise_ntp_server.

Synopsis

  • modify and get the detail of a NTP Server

Requirements

The below requirements are needed on the host that executes this module.

  • Huawei Dorado v5/v6/v7 and OceanStor v5/v6/v7 Storage

Parameters

Parameter

Comments

cmo_sys_ntp_clnt_conf_auth_switch

string

NTP authentication status.

The NTP version needs to be NTPv4 (included) or later.

Choices:

  • "disable"

  • "enable"

cmo_sys_ntp_clnt_conf_server_ip

string

NTP server address.

The value can be a domain name or an IPv4 or IPv6 address.

A maximum of two addresses can be configured for an NTP server. The addresses are separated by commas (,).

When the NTP service is set as enabled, this parameter must be delivered.

cmo_sys_ntp_clnt_conf_switch

string

NTP service status.

Required when modify NTP Service.

Choices:

  • "disable"

  • "enable"

cmo_sys_ntp_sync_period

string

Synchronization period.

60~864000.

custom_vars

dictionary

Parameters used to extend those not currently supported by the module.

Configuration needs to be based on the REST API documentation for storage.

If necessary, you can contact the plugin technical support for assistance.

filter

list / elements=string

Parameter required for all query operations.

The response will include the storage parameters that match the indicate filter criteria.

Choices:

  • "cmo_sys_ntp_clnt_conf_switch"

  • " cmo_sys_ntp_clnt_conf_server_ip"

  • "cmo_sys_ntp_clnt_conf_auth_switch"

  • "cmo_sys_ntp_clnt_conf_period"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

password

string / required

The password of the PowerStore host.

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

state

string / required

Define whether the Ntp Server should exist or not.

Choices:

  • "present"

storage_port

integer

Port number for the Huawei Enterprise array.

If not passed, it will take 8088 as default.

Default: 8088

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

username

string / required

The username of the PowerStore host.

valid_certs

string

The path of the SSL certificate variable to specify whether to validate SSL certificate or not.

If don’t set means no need to verify ssl cert.

Notes

Note

  • The check_mode is not supported.

  • The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.

Examples

tasks:
  - name: Modify NTP Server
    register: ntp_info
    huawei.enterprise.hw_enterprise_ntp_server:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      cmo_sys_ntp_clnt_conf_switch: "< disabled | enabled >"
      cmo_sys_ntp_clnt_conf_server_ip: "< ntp_server_ip >"
      cmo_sys_ntp_clnt_conf_auth_switch: "< disabled | enabled >"
      cmo_sys_ntp_sync_period : "< cmo_sys_ntp_sync_period >"
      state: "present"

  - name: Get NTP Server Config
    register: ntp_info
    huawei.enterprise.hw_enterprise_ntp_server:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      state: "present"
      filter:
        - cmo_sys_ntp_clnt_conf_switch
        - cmo_sys_ntp_clnt_conf_server_ip
        - cmo_sys_ntp_clnt_conf_auth_switch
        - cmo_sys_ntp_sync_period

Return Values

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

Key

Description

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["modify"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

ntp_detail

complex

Details of the NTP Server.

Returned: When NTP Server exists

Sample: {"cmo_sys_ntp_clnt_conf_auth_switch": "disable", "cmo_sys_ntp_clnt_conf_server_ip": "10.169.2.1,10.169.60.22", "cmo_sys_ntp_clnt_conf_switch": "enable", "cmo_sys_ntp_sync_period": "7200"}

cmo_sys_ntp_clnt_conf_auth_switch

string

NTP authentication status.

Returned: success

cmo_sys_ntp_clnt_conf_server_ip

string

NTP server address.

Returned: success

cmo_sys_ntp_clnt_conf_switch

string

NTP service status.

Returned: success

cmo_sys_ntp_sync_period

string

Synchronization period.

Returned: success

remark

string

task execute remark

Returned: always

Sample: "sample_ntp_server modify success"

Authors

  • Huawei eSDK Ansible Team