2018-12-28 11:54:06 +01:00
|
|
|
---
|
|
|
|
# Tasks file for install ntp daemon on Linux system
|
|
|
|
|
2021-03-12 13:20:58 +01:00
|
|
|
- name: Update apt cache
|
|
|
|
become: true
|
|
|
|
ansible.builtin.apt:
|
|
|
|
cache_valid_time: 3600
|
|
|
|
update_cache: true
|
|
|
|
when:
|
|
|
|
- ansible_pkg_mgr == "apt"
|
|
|
|
|
2018-12-28 13:00:01 +01:00
|
|
|
- name: Update emerge cache on Gentoo
|
2021-03-12 13:20:58 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.shell: emerge-webrsync
|
2018-12-28 13:00:01 +01:00
|
|
|
changed_when: false
|
|
|
|
when: ansible_os_family == "Gentoo"
|
2022-04-07 23:04:39 +02:00
|
|
|
tags: 'skip_ansible_lint'
|
2018-12-28 13:00:01 +01:00
|
|
|
|
2018-12-28 11:54:06 +01:00
|
|
|
- name: Install ntp daemon on Linux
|
2021-03-12 13:20:58 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.package:
|
2018-12-28 11:54:06 +01:00
|
|
|
name: "{{ ntp_package }}"
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Service ntp on Linux
|
2021-03-12 13:20:58 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.service:
|
2018-12-28 11:54:06 +01:00
|
|
|
name: "{{ ntp_service }}"
|
2021-03-12 13:20:58 +01:00
|
|
|
enabled: true
|
2018-12-28 11:54:06 +01:00
|
|
|
state: started
|