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

482 views Asked by At

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";
 }
2

There are 2 answers

1
awsiv On

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?

0
Diego Zamboni On

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.