File: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_ntp.cpython-39.pyc
a
��`]V � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddlm
Z
ddlmZ dd lmZ dd
l
mZmZ ddlmZ e�e�ZeZdZd
Zg d�Zdddgdddd�dedgdddd�dedgdddd�ddg dddd�d�Zddd�dg dd�d �dd!diid"did"did#�d"diddd�d$d%id&�d"diddd�d$d%id&�dd!diid'�Zd(d)d*ed+�eed,�ed-�ged.dd.d/gd0d1d2d3�d4ed5�d6�d0d1d2d3�d4ed7�d6�d1d8ed9�d:�d;d4ed<�d:�ed=�d.gd1ed>�d?�d1ed@�d?�d0dAd1id4edB�d6�d1edC�d?�d1edD�d?�dE�g dFdGdH�dI�g dGdJ�idK� Zeg dL��Zee�Z dMdN� ZdOdP� Zd_dQdR�Z d`dSdT�Z!dUdV� Z"dadWdX�Z#dbdYdZ�Z$d[d\� Z%d]d^� Z&dS )czNTP: enable and configure ntp� N)�dedent)�log)�
temp_utils)� templater)�
type_utils��subp)�util)�get_schema_doc�validate_cloudconfig_schema)�PER_INSTANCEz
/etc/ntp.conf� )�alpine�centos�debian�fedora�opensuse�rhel�sles�ubuntuZchronydz/etc/chrony.conf�chronyzchrony.conf.{distro})� check_exe�confpath�packages�service_name�
template_name�template�ntpd�ntpzntp.conf.{distro}�ntpdatez/lib/systemd/systemd-timesyncdz-/etc/systemd/timesyncd.conf.d/cloud-init.conf�systemd-timesyncdztimesyncd.conf)r r r r z/etc/chrony/chrony.conf)r r )r r r )r r r r )r r r z"/usr/lib/systemd/systemd-timesyncd)r r r )r r r r r r Zcc_ntpZNTPzenable and configure ntpaD Handle ntp configuration. If ntp is not installed on the system and
ntp configuration is specified, ntp will be installed. If there is a
default ntp config file in the image or one is present in the
distro's ntp package, it will be copied to a file with ``.dist``
appended to the filename before any changes are made. A list of ntp
pools and ntp servers can be provided under the ``ntp`` config key.
If no ntp ``servers`` or ``pools`` are provided, 4 pools will be used
in the format ``{0-3}.{distro}.pool.ntp.org``.z� # Override ntp with chrony configuration on Ubuntu
ntp:
enabled: true
ntp_client: chrony # Uses cloud-init default chrony configuration
a� # Provide a custom ntp client configuration
ntp:
enabled: true
ntp_client: myntpclient
config:
confpath: /etc/myntpclient/myntpclient.conf
check_exe: myntpclientd
packages:
- myntpclient
service_name: myntpclient
template: |
## template:jinja
# My NTP Client config
{% if pools -%}# pools{% endif %}
{% for pool in pools -%}
pool {{pool}} iburst
{% endfor %}
{%- if servers %}# servers
{% endif %}
{% for server in servers -%}
server {{server}} iburst
{% endfor %}
pools: [0.int.pool.ntp.org, 1.int.pool.ntp.org, ntp.myorg.org]
servers:
- ntp.server.local
- ntp.ubuntu.com
- 192.168.23.2�object�null�array�string�hostname)�type�formatTa� List of ntp pools. If both pools and servers are
empty, 4 default pool servers will be provided of
the format ``{0-3}.{distro}.pool.ntp.org``. NOTE:
for Alpine Linux when using the Busybox NTP client
this setting will be ignored due to the limited
functionality of Busybox's ntpd.)r&