Skip to content
Snippets Groups Projects
Select Git revision
  • a7da5085be93d5b1c92ee440733e3c8a42bbd8a5
  • master default
2 results

ntpd.yml

Blame
  • Adar Nimrod's avatar
    nimrod authored
    - Removed init detection, already present in Ansible, removed reference in
      tasks.
    - Removed root_group var, use gid 0.
    - State file mode as octal number instead of string.
    a6792aa5
    History
    ntpd.yml 514 B
    ---
    
    - assert:
        that: ansible_os_family in [ 'Debian', 'OpenBSD' ]
    
    - name: apt install ntpd
      when: ansible_pkg_mgr == 'apt'
      apt:
        name: ntp
        state: present
        update_cache: yes
        cache_valid_time: 3600
    
    - name: Configure ntpd
      template:
        src: ntpd.conf.j2
        dest: '{{ ntpd_conf[ansible_os_family] }}'
        owner: root
        group: 0
        mode: 0o0644
      notify:
      - Restart ntpd
    
    - name: Enable ntpd
      service:
        name: '{{ ntpd_service[ansible_os_family] }}'
        enabled: yes
        state: started