inisital commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
---
|
||||
# Handler to handle common notifications. Handlers are called by other plays.
|
||||
# See http://docs.ansible.com/playbooks_intro.html for more information about handlers.
|
||||
|
||||
- name: restart ntp
|
||||
service:
|
||||
name: ntp
|
||||
state: restarted
|
||||
23
lamp_ubuntu1804_2hosts_withroles/roles/common/tasks/main.yml
Normal file
23
lamp_ubuntu1804_2hosts_withroles/roles/common/tasks/main.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
# This playbook contains common plays that will be run on all nodes.
|
||||
|
||||
- name: Install ntp
|
||||
apt:
|
||||
name: ntp
|
||||
update_cache: true
|
||||
state: present
|
||||
tags: ntp
|
||||
|
||||
- name: Configure ntp file
|
||||
template:
|
||||
src: ntp.conf.j2
|
||||
dest: /etc/ntp.conf
|
||||
tags: ntp
|
||||
notify: restart ntp
|
||||
|
||||
- name: Start the ntp service
|
||||
service:
|
||||
name: ntp
|
||||
state: started
|
||||
enabled: yes
|
||||
tags: ntp
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
driftfile /var/lib/ntp/drift
|
||||
|
||||
restrict 127.0.0.1
|
||||
restrict -6 ::1
|
||||
|
||||
server {{ ntpserver }}
|
||||
|
||||
includefile /etc/ntp/crypto/pw
|
||||
|
||||
keys /etc/ntp/keys
|
||||
|
||||
Reference in New Issue
Block a user