Forum: CFEngine Help
Subject: editfiles question
Author: sgsax
Link to topic: https://cfengine.com/forum/read.php?3,23396,23396#msg-23396

I'm running cfengine 2.2.10 and want to be able to use editfiles to edit a file 
conditionally based on class.  Something like this:


editfiles:
    class1::
    { myfile
        AppendIfNoSuchLine "foo"
    }
    class2::
    { myfile
        DeleteLinesContaining "bar"
    }


This returns the error message "Multiple filenames in editfiles".  Is there a 
conditional directive internal to the editfiles block that will let me select 
an action based on the class for a given file?  I'm not seeing an obvious way 
to do this, if it's at all possible.

Thanks.
Seth

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to