0

I have installed cfengine 3 enterprise for testing. However when I go to run a test promise I get an error back saying

Redefinition of body "control" for "common" is a broken promise

Below is the code, any ideas?

body common control
{
bundlesequence =>{ "edit_motd"};
}
bundle agent edit_motd
 {
vars: 
 "motd" string => "/etc/motd";
 files: 
 "$(motd)"
create => "true",
edit_line => addmessage;
reports: 
 cfengine::
 "Hello world!";
}
 bundle edit_line addmessage
{
insert_lines:
"This system is managed by CFEngine 3";
 }
Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504
JoshP
  • 23
  • 4

2 Answers2

0

Just add host_licenses_paid in common control and you should be fine:

    body common control
    {
    bundlesequence =>{ "edit_motd"};
    host_licenses_paid => "25";
    }

However, the error message is a bit different than what I get with my installation. Can you check if the above works?

awsiv
  • 1
  • 3
  • Ahh.. I see, did you try to include this file somewhere (promises.cf)? If that's the case, then you must remove body common control from this policy. – awsiv Aug 13 '12 at 22:59
0

Could you please show the command you are using to run this code, and the complete output you get?

I think the most likely cause is what awsiv mentioned: that you are including this file from some other that already contains "body common control", hence the error message.

Diego Zamboni
  • 543
  • 2
  • 9