help-cfengine
[Top][All Lists]
Advanced

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

LocateLineMatching madness


From: Oyvind Gronnesby
Subject: LocateLineMatching madness
Date: Wed, 05 May 2004 13:28:58 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)

I'm trying to use editfiles for a small configuration file, but I'm
unable to do the most basic things.


The cfengine file:
----------------------------------------------------------------------
editfiles:
    software_slapd::
        { /etc/ldap/ldap.conf
            BeginGroupIfNoLineMatching "^URI ldap://localhost/";
                LocateLineMatching "URI"
                ReplaceLineWith "URI ldap://localhost/";
            EndGroup

            BeginGroupIfNoLineMatching "^BASE $(slapd_base_dn)"
                LocateLineMatching "BASE"
                ReplaceLineWith "BASE $(slapd_base_dn)"
            EndGroup
        }
----------------------------------------------------------------------


The ldap.conf file
----------------------------------------------------------------------
vile:~# cat /etc/ldap/ldap.conf 
# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.9 2000/09/04
19:57:01 kurt Exp $
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE   dc=example, dc=com
#URI    ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT      12
#TIMELIMIT      15
#DEREF          never
----------------------------------------------------------------------


The cfengine log message
----------------------------------------------------------------------
Begin editing /etc/ldap/ldap.conf
Edit: Search for ^URI ldap://localhost/ failed. Current line still 1
(Begin Group - no line matching ^URI ldap://localhost/)
Edit: Search for URI failed. Current line still 1
LocateLineMatchingRegexp failed in /etc/ldap/ldap.conf, aborting
editing
End editing /etc/ldap/ldap.conf
----------------------------------------------------------------------


I have tried with more sophisticated regular expressions, but have
been continually dumbing them down so that I'm sure the regular
expressions themselves are not at fault.

Any hints will be appreciated.

-- 
Øyvind Grønnesby




reply via email to

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