Skip to content

Commit

Permalink
Merge pull request #20 from QLPD/TECHOPS-11798
Browse files Browse the repository at this point in the history
TECHOPS-11798 fix chronyd remote server check
  • Loading branch information
gnuru authored Feb 12, 2023
2 parents af9c5ed + e8834e5 commit ecdd81b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tasks/level-1/2.1.1.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
# 2.1.1.3 Ensure chrony is configured

- name: 2.1.1.3 verify a remote chrony server is configured
command: >
egrep -c '^(server|pool)' /etc/chrony.conf
register: line_matched
shell: "egrep --no-filename -Rc '^(server|pool)' /etc/chrony.conf /etc/chrony.d"
ignore_errors: true
register: lines_matched
when: cis_enable_chrony and not cis_enable_ntp
tags:
- level-1
- "2.1.1.3"
- scored

- set_fact:
matchCount: "{{ lines_matched.stdout_lines|map('int')|sum }}"

- fail:
msg: No server or pool seems to be configured for Chrony. Please fix this as per item 2.1.1.3 of the benchmark, and re-run this play.
when: line_matched == "0"
when: matchCount == 0

0 comments on commit ecdd81b

Please sign in to comment.