Skip to content
Snippets Groups Projects
Select Git revision
  • f1774b4a3870bf8decd8ec675ebb57ec91fab4b7
  • master default protected
  • th/btop
  • th/ssh-config
  • th/rwth-afu
  • th/rhel
  • th/emacs-nox-gtk
7 results

ntpd.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ntpd.yml 796 B
    ---
    
    - name: ensure ntpd is installed
      apt:
        name: ntp
        state: present
      tags:
        - ntpd
    
    - name: ensure there is no timesyncd running
      service:
        name: systemd-timesyncd
        state: stopped
        enabled: false
      when: ansible_distribution_major_version|int(default=99) < 11
      tags:
        - ntpd
    
    - name: ensure there is no timesyncd running
      apt:
        name: systemd-timesyncd
        state: absent
      when: ansible_distribution_major_version|int(default=99) > 10
      tags:
        - ntpd
    
    - name: ensure ntpd configured
      template:
        src: ntp.conf.j2
        dest: /etc/ntp.conf
        owner: root
        group: root
        mode: "0644"
      notify:
        - restart ntpd
      tags:
        - ntpd
    
    - name: ensure ntpd is running and enabled
      service:
        name: ntp
        state: started
        enabled: true
      tags:
        - ntpd