# platform = multi_platform_all
# reboot = false
# strategy = disable
# complexity = low
# disruption = low
- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - DISA-STIG-UBTU-22-215020
  - disable_strategy
  - low_complexity
  - low_disruption
  - low_severity
  - no_reboot_needed
  - package_timesyncd_removed
- (xccdf-var var_timesync_service)

- name: Ensure systemd-timesyncd is removed
  ansible.builtin.package:
    name: systemd-timesyncd
    state: absent
  when:
  - '"linux-base" in ansible_facts.packages'
  - var_timesync_service != "systemd-timesyncd"
  tags:
  - DISA-STIG-UBTU-22-215020
  - disable_strategy
  - low_complexity
  - low_disruption
  - low_severity
  - no_reboot_needed
  - package_timesyncd_removed
