robertdebock.ntp

Ansible角色ntp

在您的系统上安装和配置ntp。

GitHub GitLab 下载次数 版本
github gitlab downloads 版本

示例Playbook

这个示例来自molecule/default/converge.yml,并在每次推送、拉取请求和发布时进行测试。

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.cron
    - role: robertdebock.ntp
      ntp_state: stopped

需要准备机器。在CI中,这通过molecule/default/prepare.yml完成:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap

还可以查看完整的解释和示例以了解如何使用这些角色。

角色变量

变量的默认值设置在defaults/main.yml中:

---
# ntp的默认文件

# NTP服务的状态。
ntp_state: started

# 启动时NTP服务的状态。
ntp_enabled: true

# 要监听的IP地址列表。
ntp_interfaces:
  - address: "127.0.0.1"

# NTP池及其选项列表。
ntp_pool:
  - name: "0.pool.ntp.org iburst"
  - name: "1.pool.ntp.org iburst"
  - name: "2.pool.ntp.org iburst"
  - name: "3.pool.ntp.org iburst"

# NTP服务器及其选项列表。
# ntp_server:
#   - name: ntp.example.com
#     options:
#       - iburst

# 时区。
ntp_timezone: Etc/UTC

要求

使用的角色状态

以下角色用于准备系统。您可以以其他方式准备系统。

要求 GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.cron Build Status GitHub Build Status GitLab

上下文

这个角色是许多兼容角色的一部分。请查看这些角色的文档以获取更多信息。

这是相关角色的概述: dependencies

兼容性

这个角色已经在以下容器镜像上进行测试:

容器 标签
Amazon 候选
EL 9
Debian 所有
Fedora 所有
Ubuntu 所有

所需的最低Ansible版本为2.12,测试已在:

  • 之前的版本。
  • 当前版本。
  • 开发版本上完成。

如果您发现问题,请在GitHub上注册。

许可证

Apache-2.0

作者信息

robertdebock

请考虑赞助我

关于项目

Install and configure ntp on your system.

安装
ansible-galaxy install robertdebock.ntp
许可证
apache-2.0
下载
22.3k
拥有者
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.