Undefined body first_line with type location

21 views
Skip to first unread message

Christian Linden

unread,
Sep 23, 2015, 7:47:44 AM9/23/15
to help-cfengine
Hi,

any hint what the problem here is?

bundle edit_line edit_ntp_conf (s) {
  delete_lines:
    "server .*";
  insert_lines:
    "#configuration by cfengine 3"
    location => first_line;
    "server $(s)";
}


Thanks,
Chris


Nick Anderson

unread,
Sep 23, 2015, 8:21:52 AM9/23/15
to help-cfengine, Christian Linden
You don't have a body called first_line included in your policy but you have specified that the edit be located based on that body definition.

Look for body location in your policy. I like to use cf-locate for this kind of thing.

https://github.com/cfengine/core/tree/master/contrib/cf-locate

Sent from my mobile device.
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.

Neil Watson

unread,
Sep 23, 2015, 8:22:40 AM9/23/15
to help-cfengine
1. IIRC ntp.conf correctly, order does not matter, so lose the location
attribute.

2. Use a template, it's way simpler.

3. What are you actual and expected results?

--
Neil H Watson
Sr. Partner, Architecture and Infrastructure
CFEngine reporting: https://github.com/evolvethinking/delta_reporting
CFEngine policy: https://github.com/evolvethinking/evolve_cfengine_freelib
CFEngine and vim: https://github.com/neilhwatson/vim_cf3
CFEngine support: http://evolvethinking.com

Christian Linden

unread,
Sep 23, 2015, 11:08:03 AM9/23/15
to help-cfengine, cfen...@watson-wilson.ca
Right, order doesn't matter here, just took it out and I'm fine..
But I don't understand why this body is not found.. it's not in my promise but should be found in the lib IMO..

Thanks Neil!
Reply all
Reply to author
Forward
0 new messages