zen_ntp/tasks/main.yml
Chris Hammer c80a55fe7d 0.1.3-DEV-20210219-022129
-------------------------
    * ADD:
      - add support for centos 8

    * MODIFY:
      - update .gitlab-ci.yml so jobs will run on the correct ci host
2021-02-19 02:22:32 -05:00

38 lines
769 B
YAML

---
# tasks file for zen_ntp
- name: set service name for debian if required
set_fact:
ntp_service: ntp
when: ansible_distribution == "Debian"
- name: set package and service for centos 8
set_fact:
ntp_pkg : chrony
ntp_service : chronyd
when: ansible_distribution_major_version == "8"
- name: install ntp if not present
package:
name : "{{ ntp_pkg | default('ntp') }}"
state : present
- name: deploy {{ ntp_conf_file }}
template:
src: templates/ntp_conf.j2
dest: "{{ ntp_conf_file }}"
mode: 0644
owner: root
group: root
notify: restart ntpd
- name: enable/start ntpd or chrony
service:
name: "{{ ntp_service }}"
enabled: yes
state: started
when: ansible_virtualization_type != "docker"