Skip to content

Commit 08600b9

Browse files
authored
UnixPB: Restart NTPD after disabling of GUI (#3479)
* UnixPB: Restart NTPD after disabling of GUI * UnixPB: Linter fix
1 parent a9a2c40 commit 08600b9

File tree

1 file changed

+28
-0
lines changed
  • ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks

1 file changed

+28
-0
lines changed

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks/main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,31 @@
2525
- desktop_installed.stat.exists
2626
- gui_disabled.stdout == ''
2727
tags: disable_gui
28+
29+
# Restart NTPD On Centos 7 after gui disablement
30+
31+
- name: Gather Facts About The Services Present
32+
service_facts:
33+
tags: disable_gui
34+
35+
- name: Check If NTPD Exists In The Service Facts
36+
set_fact:
37+
ntpd_entry_exists: "{{ 'ntpd.service' in services }}"
38+
when: ansible_facts.services is defined
39+
tags: disable_gui
40+
41+
- name: Set Fact Where NTPD Is Not Available As A Service
42+
set_fact:
43+
ntpd_entry_exists: "false"
44+
when: ansible_facts.services is not defined
45+
tags: disable_gui
46+
47+
- name: Start NTP for CentOS7 following GUI disablement
48+
service:
49+
name: ntpd
50+
state: restarted
51+
enabled: yes
52+
when:
53+
- ntpd_entry_exists | default(false) | bool
54+
- (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" )
55+
tags: disable_gui

0 commit comments

Comments
 (0)