---
title: VMware Host NTP
slug: homologacao-atmosphere/vmware-host-ntp
description: Learn how to configure, add, or remove NTP servers from an ESXi host using this comprehensive module. Discover a list of parameters and examples for configuring NTP servers for individual hosts or entire clusters. Gain insights into the metadata returned 
createdAt: 2022-01-14T11:49:24.000Z
---

## Resumo

- Este módulo pode ser usado para configurar, adicionar ou remover servidores NTP de um host ESXi.

## Parâmetros

| **Parâmetro**             | **Tipo**               | **Escolhas \| Valor Padrão**                          | **Comentários**                                                                                                                                                                                                                                     |
| ------------------------- | ---------------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cluster\_name             | string                 |                                                       | Nome do cluster do qual todos os sistemas host serão usados. Esse parâmetro é obrigatório se esxi\_hostname não for especificado.                                                                                                                   |
| esxi\_hostname            | string                 |                                                       | Nome do sistema host com o qual trabalhar. Este parâmetro é obrigatório se cluster\_name não for especificado.                                                                                                                                      |
| ntp\_servers - *required* | list / elements=string |                                                       | IP ou FQDN do(s) servidor(es) NTP. Aceita uma lista de servidores NTP.                                                                                                                                                                              |
| state                     | string                 | Escolhas:<br />- present<br />(default)<br />- absent | Present: Adicionar servidor(es) NTP, se o(s) servidor(es) especificado(s) estiverem ausentes, senão não fazer nada.<br /><br />Absent: Remover servidor(es) NTP, se o(s) servidor(es) especificado(s) estiver(em) presente(s) senão não fazer nada. |
| verbose                   | boolean                | Escolhas:<br />- false<br />(default)<br />- true     | Saída detalhada da alteração de configuração. Explica se um servidor NTP foi adicionado, removido ou se a sequência do servidor NTP foi alterada.                                                                                                   |




## Exemplos

```yaml
# Exemplo: Configurar servidores NTP para um host ESXi
- vmware_host_ntp:
    hostname: vcenter01.example.local
    username: administrator@vsphere.local
    password: SuperSecretPassword
    esxi_hostname: esx01.example.local
    ntp_servers:
        - 0.pool.ntp.org
        - 1.pool.ntp.org
  
# Exemplo: Definir servidores NTP para todos os hosts ESXi em determinado cluster
- vmware_host_ntp:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    cluster_name: '{{ cluster_name }}'
    state: present
    ntp_servers:
        - 0.pool.ntp.org
        - 1.pool.ntp.org

# Exemplo: Definir servidores NTP para um host ESXi
- vmware_host_ntp:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    esxi_hostname: '{{ esxi_hostname }}'
    state: present
    ntp_servers:
        - 0.pool.ntp.org
        - 1.pool.ntp.org

# Exemplo: Remover servidores NTP de um host ESXi
- vmware_host_ntp:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    esxi_hostname: '{{ esxi_hostname }}'
    state: absent
    ntp_servers:
        - bad.server.ntp.org
```



## Valores retornados

| **Chave**          | **Tipo**   | **Retornado quando** | **Descrição**                                       |
| ------------------ | ---------- | -------------------- | --------------------------------------------------- |
| host\_ntp\_status  | dictionary | Sempre               | Metadados sobre a configuração NTP do sistema host. |

