Forum: Cfengine Help
Subject: Re: Cfengine Help: How to configure a client machine to contact the 
policy server and downloads updates?
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,19909,19973#msg-19973

I have a policy host that is set to trust clients.  I have the clients download 
the policy host's key the first time via an agent bundle that is called 
manually.
bundle agent handshake{
# Handshake used to perform key exhange.

        classes:

                "exists" expression => fileexists("/tmp/cf-agent");
        files:

                !exists::
                        "/tmp/cf-agent"
                        handle => "handshake_copy",
                        comment => "Copy file to initiate client server key 
exchange.",
                        classes => if_repaired("handshake_complete"),
                        copy_from => 
                                
remote_cp_trust("${g.masterfiles}/config/bin/linux-64/bin/cf-agent","${g.phost}");

        reports:

                exists.!handshake_complete::
                        "Remove /tmp/cf-agent before attempted handshake 
promise.";

                handshake_complete::
                        "Client server handshake successful.";

                !handshake_complete::
                        "Client server handshake NOT successful.";
}
body copy_from remote_cp_trust(from,server)
{
servers     => { "$(server)" };
source      => "$(from)";
compare     => "mtime";
trustkey    => "true";
}



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

Reply via email to