1 Star 1 Fork 0

安家/tidb-ansible

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
deploy_ntp.yml 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
Louis 提交于 2018-09-11 16:39 . update deploy_ntp.yml (#535)
---
- hosts: all
tasks:
- name: get facts
setup:
- name: RedHat family Linux distribution - make sure ntp, ntpstat have been installed
yum:
name: "{{ item }}"
state: present
with_items:
- ntp
when:
- ansible_os_family == "RedHat"
- name: RedHat family Linux distribution - make sure ntpdate have been installed
yum:
name: "{{ item }}"
state: present
with_items:
- ntpdate
when:
- ansible_os_family == "RedHat"
- ntp_server is defined
- name: Debian family Linux distribution - make sure ntp, ntpstat have been installed
apt:
name: "{{ item }}"
state: present
with_items:
- ntp
- ntpstat
when:
- ansible_os_family == "Debian"
- name: Debian family Linux distribution - make sure ntpdate have been installed
apt:
name: "{{ item }}"
state: present
with_items:
- ntpdate
when:
- ansible_os_family == "Debian"
- ntp_server is defined
- name: RedHat family Linux distribution - make sure ntpd service has been stopped
service:
name: ntpd
state: stopped
when:
- ansible_os_family == "RedHat"
- ntp_server is defined
- name: Debian family Linux distribution - make sure ntp service has been stopped
service:
name: ntp
state: stopped
when:
- ansible_os_family == "Debian"
- ntp_server is defined
- name: Adjust Time | start to adjust time with {{ ntp_server }}
shell: ntpdate {{ ntp_server }}
when: ntp_server is defined
- name: RedHat family Linux distribution - make sure ntpd service has been started
service:
name: ntpd
state: started
when:
- ansible_os_family == "RedHat"
- name: Debian family Linux distribution - Make sure ntp service has been started
service:
name: ntp
state: started
when:
- ansible_os_family == "Debian"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/anjia/tidb-ansible.git
git@gitee.com:anjia/tidb-ansible.git
anjia
tidb-ansible
tidb-ansible
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385