Is there any way to do a multiline regex check in CFEngine?
I want to check if the Red Hat Satellite Tools repo definition in /etc/yum.repos.d/redhat.repo is enabled (enabled = 1).
There are multiple repo definitions in that file.
I am trying to make that check (to see if the satellite-tools repo is enabled) lighter weight.
For example:
# time (yum repolist | grep satellite-tools)
rhel-6-server-satellite-tools-6.2-rpms Red Hat Satellite Tools 6.2 (for R 115
real 0m1.347s
user 0m0.583s
sys 0m0.074s
# time (awk '/satellite-tools/,/enabled/' /etc/yum.repos.d/redhat.repo | grep 'enabled = 1')
enabled = 1
real 0m0.002s
user 0m0.001s
sys 0m0.001s
#
I am trying to keep the CFEngine agent resource utilization footprint small so people don't complain about cf-agent showing up using 100% CPU in "top". I haven't had any such complaints for over a year and I don't want to start getting them again. :)
Thanks!
Aleksey
--
Achieve real learning. Email
trai...@verticalsysadmin.com.