{{%- set ok_by_default = false %}} {{%- if product in ["rhel7", "ol7", "rhel8", "ol8", "rhel9", "ol9", "fedora"] %}} {{%- set ok_by_default = true %}} {{%- endif %}}

{{%- if ok_by_default %}} {{{ oval_metadata("Ensure that no other user than chrony is configured to run the chrony service") }}} /etc/sysconfig/chronyd ^\s*OPTIONS=.*[\s'"]-u(?!\s*chrony\b).* 0 {{%- elif 'ubuntu' in product -%}} {{{ oval_check_config_file(path='/etc/chrony/chrony.conf', prefix_regex='^[ \\t]*', parameter='user', separator_regex='[[:space:]]', value='_chrony', missing_parameter_pass=true, missing_config_file_fail=false) }}} {{%- else -%}} {{{ oval_check_config_file(path='/etc/sysconfig/chronyd', prefix_regex='^[ \\t]*', parameter='OPTIONS', separator_regex='=', value='["]?.*-u[\s]*chrony.*["]?', missing_parameter_pass=ok_by_default, missing_config_file_fail=true) }}} {{%- endif %}}