Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ind:textfilecontent54_object comment="Matches pool entries in Chrony conf files"
id="object_chronyd_no_pool_directive" version="1">
<ind:filepath operation="pattern match">{{{ filepath_regex }}}</ind:filepath>
<ind:pattern operation="pattern match">^[\s]+pool.*$</ind:pattern>
<ind:pattern operation="pattern match">^[\s]*pool.*$</ind:pattern>
<ind:instance datatype="int">1</ind:instance>
</ind:textfilecontent54_object>
</def-group>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# packages = chrony
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_almalinux,multi_platform_ubuntu
Comment thread
alanmcanonical marked this conversation as resolved.
# remediation = none

echo "pool 0.pool.ntp.org" > {{{ chrony_conf_path }}}
echo "server 0.pool.ntp.org" >> {{{ chrony_conf_path }}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# packages = chrony
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_almalinux,multi_platform_ubuntu

sed -i "^pool.*" {{{ chrony_conf_path }}}
sed -i '/^pool.*/d' {{{ chrony_conf_path }}}
echo "server 0.pool.ntp.org" > {{{ chrony_conf_path }}}
echo "server 1.pool.ntp.org" >> {{{ chrony_conf_path }}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_almalinux,multi_platform_ubuntu
# remediation = none

sed -i "^server.*" {{{ chrony_conf_path }}}
sed -i '/^server.*/d' {{{ chrony_conf_path }}}
if ! grep "^pool.*" {{{ chrony_conf_path }}}; then
echo "pool 0.pool.ntp.org" > {{{ chrony_conf_path }}}
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# packages = chrony
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_almalinux,multi_platform_ubuntu

sed -i "^pool.*" {{{ chrony_conf_path }}}
sed -i '/^pool.*/d' {{{ chrony_conf_path }}}
echo "server 0.pool.ntp.org" > {{{ chrony_conf_path }}}
Loading