polytech-ansible-2023/roles/ntp/tasks/main.yml
Thomas Maurice 93bb0b0742
All checks were successful
Master branch: build & lint / build (push) Successful in 1m0s
feat(actions): Adds actions & lint (#1)
Adds an action to perform some linting actions on ansible and the yaml files, both on push onto master and on pull requests

Reviewed-on: #1
2024-02-20 17:46:29 +00:00

24 lines
649 B
YAML

---
- name: "Install ntp"
ansible.builtin.apt:
name: ntp
state: present
- name: "Configure ntp"
ansible.builtin.copy:
src: ntp.conf
dest: /etc/ntp.conf
owner: root
group: root
mode: "644"
# notify is going to invoke the "Restart ntp" handler defined in
# the roles/ntp/handlers/main.yml file. Basically it says that
# you want to restart the ntp service every time the configuratio
# changes
notify: "Restart ntp"
# Here you say that you want the NTP service to be restarted as well
# as enabled on boot.
- name: "NTP service"
ansible.builtin.service:
name: ntp
state: restarted
enabled: true