ntp: Initial PB and role to set up ntpd
This commit is contained in:
34
roles/ntpd/tasks/main.yml
Normal file
34
roles/ntpd/tasks/main.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
- name: load distribution-specific values
|
||||
include_vars: '{{ item }}'
|
||||
with_first_found:
|
||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
||||
- '{{ ansible_distribution }}.yml'
|
||||
- '{{ ansible_os_family }}.yml'
|
||||
- defaults.yml
|
||||
|
||||
- name: ensure ntpd is installed
|
||||
package:
|
||||
name={{ ntpd_required_packages|join(',') }}
|
||||
state=present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure ntpd starts at boot
|
||||
service:
|
||||
name={{ ntpd_svc }}
|
||||
enabled=yes
|
||||
- meta: flush_handlers
|
||||
- name: ensure ntpd is running
|
||||
service:
|
||||
name={{ ntpd_svc }}
|
||||
state=started
|
||||
|
||||
- name: ensure ntpd is allowed in the firewall
|
||||
firewalld:
|
||||
service=ntp
|
||||
state=enabled
|
||||
permanent=no
|
||||
immediate=yes
|
||||
notify: save firewalld configuration
|
||||
tags:
|
||||
- firewalld
|
||||
Reference in New Issue
Block a user