Skip to content

Instantly share code, notes, and snippets.

@ZeroDeth
Last active August 12, 2017 18:59
Show Gist options
  • Save ZeroDeth/6ae8057cfdf9d351fd99778fd48049fc to your computer and use it in GitHub Desktop.
Save ZeroDeth/6ae8057cfdf9d351fd99778fd48049fc to your computer and use it in GitHub Desktop.
---
- hosts: all
become: yes
tasks:
- name: Ensure NTP (for time synchronization) is installed.
yum: name=ntp state=present
- name: Ensure NTP is running.
service: name=ntpd state=started enabled=yes
when: ansible_os_family == "RedHat"
- name: Ensure NTP (for time synchronization) is installed.
apt: name=ntp state=present
- name: Ensure NTP is running.
service: name=ntp state=started enabled=yes
when: ansible_os_family == "Debian"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment