update..
This commit is contained in:
@ -148,6 +148,18 @@
|
||||
tags: sudoers
|
||||
|
||||
|
||||
- import_tasks: motd.yml
|
||||
tags: motd
|
||||
|
||||
|
||||
# tags supported inside ntp.yml:
|
||||
#
|
||||
# ntp-server
|
||||
- import_tasks: ntp.yml
|
||||
tags:
|
||||
- ntp
|
||||
|
||||
|
||||
# tags supportetd inside git.yml
|
||||
#
|
||||
# git-firewall-repository
|
||||
|
19
roles/common/tasks/motd.yml
Normal file
19
roles/common/tasks/motd.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
# ----------
|
||||
# /etc/motd
|
||||
# ----------
|
||||
|
||||
- name: (motd.yml) Check if /etc/motd.ORIG exist
|
||||
stat:
|
||||
path: /etc/motd.ORIG
|
||||
register: motd_orig_exist
|
||||
|
||||
|
||||
- name: (motd.yml) Backup existing file /etc/motd
|
||||
command: cp -a /etc/motd /etc/motd.ORIG
|
||||
when: motd_orig_exist.stat.exists == False
|
||||
|
||||
- name: (motd.yml) create /etc/motd
|
||||
shell: figlet {{ ansible_hostname }} > /etc/motd
|
||||
when: motd_orig_exist.stat.exists == False
|
60
roles/common/tasks/ntp.yml
Normal file
60
roles/common/tasks/ntp.yml
Normal file
@ -0,0 +1,60 @@
|
||||
---
|
||||
|
||||
# ---
|
||||
# NTP Server
|
||||
# ---
|
||||
|
||||
- name: (ntp.yml) Ensure ntpsec package is installed.
|
||||
apt:
|
||||
name:
|
||||
- ntpsec
|
||||
state: present
|
||||
when:
|
||||
- ansible_os_family == "Debian"
|
||||
tags:
|
||||
- ntp-server
|
||||
|
||||
- name: (ntp.yml) Check file '/etc/ntpsec/ntp.conf.ORIG' exists
|
||||
stat:
|
||||
path: /etc/ntpsec/ntp.conf.ORIG
|
||||
register: etc_ntpsec_conf_ORIG
|
||||
when:
|
||||
- ansible_distribution == "Debian"
|
||||
tags:
|
||||
- ntp-server
|
||||
|
||||
|
||||
- name: (ntp.yml) Ensure directory '/var/log/ntpsec' is present
|
||||
file:
|
||||
path: /var/log/ntpsec
|
||||
state: directory
|
||||
owner: ntpsec
|
||||
group: ntpsec
|
||||
mode: '0755'
|
||||
when:
|
||||
- ansible_distribution == "Debian"
|
||||
|
||||
|
||||
- name: (ntp.yml) Backup installation version of file '/etc/ntpsec/ntp.conf'
|
||||
command: cp /etc/ntpsec/ntp.conf /etc/ntpsec/ntp.conf.ORIG
|
||||
when:
|
||||
- groups['oopen_office_server']|string is search(inventory_hostname)
|
||||
- etc_ntpsec_conf_ORIG.stat.exists == False
|
||||
- local_ntp_service is defined and local_ntp_service|bool
|
||||
tags:
|
||||
- ntp-server
|
||||
|
||||
- name: (ntp.yml) Update '/etc/ntpsec/ntp.conf'
|
||||
template:
|
||||
src: "etc/ntpsec/ntp.conf.j2"
|
||||
dest: /etc/ntpsec/ntp.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: Restart ntp
|
||||
when:
|
||||
- groups['oopen_office_server']|string is search(inventory_hostname)
|
||||
- local_ntp_service is defined and local_ntp_service|bool
|
||||
tags:
|
||||
- ntp-server
|
||||
|
Reference in New Issue
Block a user