Skip to content

Commit

Permalink
Switch from template to lineinfile for chrony
Browse files Browse the repository at this point in the history
This is to allow individual chrony configs.
CIS compliance requirement will be met by lineinfile instead.
  • Loading branch information
Niklas Myrefelt committed May 6, 2020
1 parent e769cf5 commit da1ae5c
Showing 2 changed files with 9 additions and 102 deletions.
18 changes: 9 additions & 9 deletions tasks/section2.yml
Original file line number Diff line number Diff line change
@@ -240,7 +240,7 @@
- level1
- scored
- patch
- rhel7cis_disable_service_checks is defined and rhel7cis_disable_service_checks
- rhel7cis_disable_service_checks is defined and rhel7cis_disable_service_checks
- rule_2.1.6

- name: "SCORED | 2.1.6 | PATCH | Ensure tftp server is not enabled"
@@ -253,7 +253,7 @@
tags:
- level1
- scored
- patch
- patch
- rule_2.1.6

- name: "SCORED | 2.1.7 | PATCH | Ensure xinetd is not enabled"
@@ -369,12 +369,12 @@
- rule_2.2.1.2

- name: "SCORED | 2.2.1.3 | PATCH | Ensure chrony is configured"
template:
src: chrony.conf.j2
dest: /etc/chrony.conf
owner: root
group: root
mode: 0644
lineinfile:
path: /etc/chrony.conf
regexp: "^server\\s+{{ item }}(.*)$"
line: "server {{ item }}\\1"
backrefs: yes
loop: "{{ rhel7cis_time_synchronization_servers }}"
when:
- rhel7cis_level1 is defined and rhel7cis_level1
- rhel7cis_time_synchronization is defined
@@ -463,7 +463,7 @@
when:
- rhel7cis_level1 is defined and rhel7cis_level1
- rhel7cis_cups_server is defined and (not rhel7cis_cups_server and cups_service_status.stdout == "loaded")
- rhel7cis_disable_service_checks is defined and rhel7cis_disable_service_checks
- rhel7cis_disable_service_checks is defined and rhel7cis_disable_service_checks
tags:
- level1
- scored
93 changes: 0 additions & 93 deletions templates/chrony.conf.j2

This file was deleted.

0 comments on commit da1ae5c

Please sign in to comment.