Skip to content

Commit

Permalink
UnixPB: Restart NTPD after disabling of GUI (#3479)
Browse files Browse the repository at this point in the history
* UnixPB: Restart NTPD after disabling of GUI

* UnixPB: Linter fix
  • Loading branch information
steelhead31 authored Mar 26, 2024
1 parent a9a2c40 commit 08600b9
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,31 @@
- desktop_installed.stat.exists
- gui_disabled.stdout == ''
tags: disable_gui

# Restart NTPD On Centos 7 after gui disablement

- name: Gather Facts About The Services Present
service_facts:
tags: disable_gui

- name: Check If NTPD Exists In The Service Facts
set_fact:
ntpd_entry_exists: "{{ 'ntpd.service' in services }}"
when: ansible_facts.services is defined
tags: disable_gui

- name: Set Fact Where NTPD Is Not Available As A Service
set_fact:
ntpd_entry_exists: "false"
when: ansible_facts.services is not defined
tags: disable_gui

- name: Start NTP for CentOS7 following GUI disablement
service:
name: ntpd
state: restarted
enabled: yes
when:
- ntpd_entry_exists | default(false) | bool
- (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" )
tags: disable_gui

0 comments on commit 08600b9

Please sign in to comment.