Design Center issue

95 views
Skip to first unread message

Jonathan Bayer

unread,
Oct 7, 2013, 8:47:10 AM10/7/13
to help-c...@googlegroups.com
Hi,

I just started looking at the Design Center.  It looks impressive, but I ran into a roadblock:

I first started by cloning it in my home directory.  Then I went in and followed the instructions on https://cfengine.com/docs/3.5/manuals-design-center.html to setup and configure a sample (I used the System::tzconfig).  Finally I did tried to run it.

I got the following:

]$  /usr/sbin/cf-agent  -f /home/jbayer/.cfagent/inputs/cf-sketch-runfile-standalone.cf
/home/jbayer/.cfagent/inputs/sketches/libraries/dclib/library.cf:83:0: error: Undefined body local_cp with type copy_from
/home/jbayer/.cfagent/inputs/sketches/system/tzconfig/main.cf:37:0: error: Undefined body empty with type edit_defaults
/home/jbayer/.cfagent/inputs/sketches/system/tzconfig/main.cf:58:0: error: Undefined body if_repaired with type classes
/home/jbayer/.cfagent/inputs/sketches/system/tzconfig/main.cf:39:0: error: Undefined bundle insert_lines with type edit_line
/home/jbayer/.cfagent/inputs/sketches/system/tzconfig/main.cf:47:0: error: Undefined bundle replace_or_add with type edit_line
2013-10-07T08:42:47-0400    error: Policy failed validation with command '"/home/jbayer/.cfagent/bin/cf-promises" -c "/home/jbayer/.cfagent/inputs/cf-sketch-runfile-standalone.cf"'

I traced this to the fact that the stdlib wasn't in the inputs list.  This is the "inputs" as it was generated:

 "inputs" slist => { "sketches/libraries/dclib/library.cf", "sketches/system/tzconfig/main.cf" };

When I changed it to the following and copied the stdlib into the libraries directory, it worked:

"inputs" slist => { "libraries/cfengine_stdlib.cf", "sketches/libraries/dclib/library.cf", "sketches/system/tzconfig/main.cf" };

This is what I got (which was expected due to permissions):
]$  /usr/sbin/cf-agent  -f /home/jbayer/.cfagent/inputs/cf-sketch-runfile-standalone.cf
2013-10-07T08:44:34-0400    error: Unable to open destination file '/etc/sysconfig/clock.cf-after-edit' for writing. (fopen: Permission denied)
2013-10-07T08:44:34-0400    error: /cfsketch_run/methods/'__System_tzconfig_1_001_System_tzconfig_set'/cfdc_tzconfig:set/files/'$(relocate)/etc/sysconfig/clock': Unable to save file '/etc/sysconfig/clock' after editing
So, did I do anything wrong?

Also, I'd like to have a comment automatically included at the top of the generated deploy file, warning users to not change it.  Is it possible to do that, or do I have to do it manually?

Thanks in advance


JBB

Jonathan Bayer

unread,
Oct 7, 2013, 8:55:37 AM10/7/13
to help-c...@googlegroups.com
I forgot to say that this was CF-Engine 3.5.1, running on CentOS 6

JBB

Diego Zamboni

unread,
Oct 7, 2013, 11:00:51 AM10/7/13
to Jonathan Bayer, Diego Zamboni, help-c...@googlegroups.com
Jonathan,

Strange - stdlib should be included automatically. In fact the common problem is that you end up with two loaded instances of the stdlib - the one from promises.cf and the one included in the generated runfile.

If you could, please make sure you are using CFEngine 3.5.2 and the very latest checkout from the DC repository. Many bugs have been fixed recently, so there is a possibility you hit one of them if you are using an older version.

re: the comment at the top of the file - not possible right now, but sounds reasonable. Could you please open an issue at http://github.com/cfengine/design-center/ ?

Thanks,
--Diego


--
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/groups/opt_out.

Ted Zlatanov

unread,
Oct 11, 2013, 6:43:33 PM10/11/13
to help-c...@googlegroups.com
On Mon, 07 Oct 2013 08:47:10 -0400 Jonathan Bayer <linuxgu...@gmail.com> wrote:

JB> I just started looking at the Design Center. It looks impressive, but
JB> I ran into a roadblock:
...
JB> I traced this to the fact that the stdlib wasn't in the inputs list.
JB> This is the "inputs" as it was generated:

JB> "inputs" slist => { "sketches/libraries/dclib/library.cf",
JB> "sketches/system/tzconfig/main.cf" };

JB> When I changed it to the following and copied the stdlib into the
JB> libraries directory, it worked:
...
JB> So, did I do anything wrong?

You didn't do anything wrong :)

This is due to some recent changes in the master branch:

commit 1f981349ac24b002c046706335f15dca46a7c122
Author: Nick Anderson <ni...@cmdln.org>
Date: Fri Sep 13 00:06:10 2013 -0400

So I've added a --standalone_inputs list parameter to cf-sketch.pl to
make adding the stdlib easier (the example you gave becomes a
modification of the cf-sketch.pl invocation), but the proper solution is
not ready yet. In the end, no sketches will have a hard dependency on
the stdlib bundled with DC. This is still under construction and we
will have more concrete things to say next week; it only affects the
standalone runfile. Sorry for the inconvenience.

JB> Also, I'd like to have a comment automatically included at the top of
JB> the generated deploy file, warning users to not change it. Is it
JB> possible to do that, or do I have to do it manually?

I added the --runfile_header="x" option to cf-sketch.pl, which sets a
"header" option for the runfile as far as the DC API is concerned. That
should do it for you, whether you use the command-line option or change
your DC API config.json.

HTH
Ted

Reply all
Reply to author
Forward
0 new messages