help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

editfiles


From: James Treleaven
Subject: editfiles
Date: Fri, 16 Apr 2004 19:04:32 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

I know this list gets a lot of questions about the 'editfiles' functionality, and I really have looked hard at the docs before posting this.

I have found that the approach described by Jamie Wilkinson (http://www.shipyard.com.au/articles/sysadmin/cfengine-configfiles.py) works for me, but I suspect there is a better way.

Should it really take me 9 lines to code 'Make sure SyslogFacility is set to AUTHPRIV in /etc/ssh/sshd_config' as he does it:
---
      BeginGroupIfNoLineMatching '^SyslogFacility.*'
        Append 'SyslogFacility'
      EndGroup
      ResetSearch 1
      LocateLineMatching '^SyslogFacility.*'
      BeginGroupIfNoMatch '^SyslogFacility AUTHPRIV$'
        ReplaceLineWith 'SyslogFacility AUTHPRIV'
      EndGroup
      ResetSearch 1
---

If any of you cfengine gurus wish to share a better idiom, I would appreciate it.

thanks,
James





reply via email to

[Prev in Thread] Current Thread [Next in Thread]