Hi, guys.

    I am having trouble getting file copying going.  I am sure it's
something simple, but I am having trouble spotting what it is.
    The error message I get is:

$ cf-agent -f test_copy.cf
Not authorized to trust the server=127.0.0.1's public key (trustkey=false)
Authentication dialogue with 127.0.0.1 failed
$


The tutorial says,

    If you are using secure copy, make sure that you
    have created a key file and that you have distributed
    and installed it to all participating hosts in your cluster.

I am not sure HOW to distribute and install it.

My ppkeys directory contains:

$ ls -l ~/.cfagent/ppkeys/
total 24
-rw------- 1 tsalolia tsalolia 1743 Dec 14 22:24 localhost.priv
-rw------- 1 tsalolia tsalolia  426 Dec 14 22:24 localhost.pub
-rw------- 1 tsalolia tsalolia  426 Dec 16 12:41 tsalolia-127.0.0.1.pub
$


My cf-serverd configuration:

    body server control

    {
    allowconnects         => { "127.0.0.1" , "::1" };
    allowallconnects      => { "127.0.0.1" , "::1" };
    trustkeysfrom         => { "127.0.0.1" , "::1" };

    # Make updates and runs happen in one

    cfruncommand          => "$(sys.workdir)/bin/cf-agent -f
failsafe.cf && $(sys.workdir)/bin/cf-agent";
    allowusers            => { "root" , "tsalolia" };
    }

(I am running cf-serverd and cf-agent as "tsalolia".)

I tried adding

    trustkey         =>  "true" ;

to the "body server control" body, but that earned me a

     Q: "...cf-serverd": Unknown lval trustkey in server control body


I did add

    trustkey         =>  "true" ;

to my copy_from example body. (see below).


Please advise?


Here is my test_copy.cf:


--- start of test_copy.cf ---

body common control
{
bundlesequence => { "testcopy" };
version => "1.2.3";
inputs => { "library.cf" };
}




bundle agent testcopy
{
files:
"/tmp/testcopy1"
copy_from => my_copy_body_with_options("/tmp/testcopy2","127.0.0.1");
}



body copy_from my_copy_body_with_options(sourcefile,sourceserver)
{
source => "$(sourcefile)";
servers => { "$(sourceserver)" };
copy_backup => "true";
special_class:: purge => "true";
trustkey        => "true";
compare     => "digest";
encrypt     => "true";
verify      => "true";
force_ipv4  => "false";
collapse_destination_dir => "false";
copy_size => irange("0","50000");
# etc. etc.
}

--- end of test_copy.cf ---


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

Reply via email to