hello,
 i want to configure pxe boot with cfengine3 .please tell me how to
configure cf-agent and promises and any other configurations i have to make.
thanks in advance

On Wed, Dec 29, 2010 at 4:30 PM, <help-cfengine-requ...@cfengine.org> wrote:

> Send Help-cfengine mailing list submissions to
>        help-cfengine@cfengine.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://cfengine.org/mailman/listinfo/help-cfengine
> or, via email, send a message with subject or body 'help' to
>        help-cfengine-requ...@cfengine.org
>
> You can reach the person managing the list at
>        help-cfengine-ow...@cfengine.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Help-cfengine digest..."
>
>
> Today's Topics:
>
>   1. Cfengine Help: Inherit shell variables in "commands:"
>      (no-re...@cfengine.com)
>   2. Re: Cfengine Help: Inherit shell variables in "commands:"
>      (Daniel V. Klein)
>   3. Cfengine Help: Re: Inherit shell variables in "commands:"
>      (no-re...@cfengine.com)
>   4. Cfengine Help: Re: Cfengine Help: Inherit shell variables in
>      "commands:" (no-re...@cfengine.com)
>   5. Cfengine Help: Re: Cfengine Help: How to configure a client
>      machine   to contact the policy server and downloads updates?
>      (no-re...@cfengine.com)
>   6. Cfengine Help: how do you restart a process only after .conf
>      update? (no-re...@cfengine.com)
>   7. Cfengine Help: Re: Cfengine Help: How to configure a client
>      machine   to contact the policy server and downloads updates?
>      (no-re...@cfengine.com)
>   8. Cfengine Help: Re: how do you restart a process only after
>      .conf     update? (no-re...@cfengine.com)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 28 Dec 2010 16:05:47 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: Inherit shell variables in "commands:"
> To: help-cfengine@cfengine.org
> Message-ID:
>        <ca14314b7ce882db5f8f5983b245a635.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: Inherit shell variables in "commands:"
> Author: berntjernberg
> Link to topic: https://cfengine.com/forum/read.php?3,19964,19964#msg-19964
>
> Hi all,
>
> I need to assign 10 variables in shell before I run a script. How can I
> inherit shell variables in a commands-section?
> I have tried to create a file, containing exports of variables, run it
> followed by a commands section on the same line
> but it didn't work:
>
> Like this:
>
> commands:
>    "/tmp/filewithvars && $(script)";
>
> Any ideas?
>
> Regards
> /Bernt Jernberg
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 28 Dec 2010 10:16:56 -0500
> From: "Daniel V. Klein" <d...@lonewolf.com>
> Subject: Re: Cfengine Help: Inherit shell variables in "commands:"
> To: no-re...@cfengine.com
> Cc: help-cfengine@cfengine.org
> Message-ID: <e624f229-795d-45a5-8d52-972fcdb29...@lonewolf.com>
> Content-Type: text/plain; charset=us-ascii
>
> You want a commands promise that is a "module".  See
> http://www.cfengine.org/manuals/cf3-reference.html#module-in-commands.
>  You can't exactly inherit shell variables, but this is pretty close to what
> you said you need, and probably what you really want.
>
> -Dan
> On Dec 28, 2010, at 10:05 AM, no-re...@cfengine.com wrote:
>
> > Forum: Cfengine Help
> > Subject: Inherit shell variables in "commands:"
> > Author: berntjernberg
> > Link to topic:
> https://cfengine.com/forum/read.php?3,19964,19964#msg-19964
> >
> > Hi all,
> >
> > I need to assign 10 variables in shell before I run a script. How can I
> inherit shell variables in a commands-section?
> > I have tried to create a file, containing exports of variables, run it
> followed by a commands section on the same line
> > but it didn't work:
> >
> > Like this:
> >
> > commands:
> >    "/tmp/filewithvars && $(script)";
> >
> > Any ideas?
> >
> > Regards
> > /Bernt Jernberg
> >
> > _______________________________________________
> > Help-cfengine mailing list
> > Help-cfengine@cfengine.org
> > https://cfengine.org/mailman/listinfo/help-cfengine
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 28 Dec 2010 16:21:18 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: Re: Inherit shell variables in "commands:"
> To: help-cfengine@cfengine.org
> Message-ID:
>        <d59d3d5ae2eca57829678dd7c320319f.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: Re: Inherit shell variables in "commands:"
> Author: berntjernberg
> Link to topic: https://cfengine.com/forum/read.php?3,19964,19965#msg-19965
>
> I found information about "environment" but I want the variables to be
> local to the current bundle.
>
> Regards
> /Bernt Jernberg
>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 28 Dec 2010 18:34:00 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: Re: Cfengine Help: Inherit shell variables in
>        "commands:"
> To: help-cfengine@cfengine.org
> Message-ID:
>        <605150e50ed2a03ad6cb164f6f6a1e85.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: Re: Cfengine Help: Inherit shell variables in "commands:"
> Author: berntjernberg
> Link to topic: https://cfengine.com/forum/read.php?3,19966,19967#msg-19967
>
> Hi,
>
> As I understand it the variables are "imported" to cfengine with module but
> I need the variables to stay in shell context.
> Great info though. :-)
>
> I came up with this code:
>
>
>
> bundle agent remove_file(file)
> {
>    files:
>        # Delete file.
>        "$(file)"
>        delete => tidy,
>        file_select => plain;
> }
>
> bundle agent run_vip_script
> {
>    vars:
>        "wrapper_content"  string =>
> "#!/usr/bin/bash
> export VAR1=val1
> export VAR2=val2
> export VAR3=val3
> export VAR4=val4
> export VAR5=val5
> export VAR6=val6
> export VAR7=val7
> export VAR8=val8
> export VAR9=val9
> export VAR10=val10
>
> /path/to/external_script arg";
>
>
>    files:
>        !wrapper_created::
>            "/tmp/wrapper"
>            perms => mog(0700,root,root),
>            create => "true",
>            edit_defaults => std_defs,
>            edit_line => create_file("$(wrapper_content)"),
>            classes => if_repaired("wrapper_created");
>
>    commands:
>        wrapper_created::
>             "/tmp/wrapper"
>             classes => if_repaired("wrapper_has_run");
>
>    methods:
>        wrapper_has_run::
>            "remove_wrapper" usebundle => remove_file("/tmp/wrapper");
> }
>
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 28 Dec 2010 21:04:14 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: Re: Cfengine Help: How to configure a client
>        machine to contact the policy server and downloads updates?
> To: help-cfengine@cfengine.org
> Message-ID:
>        <bb33ea8865bf533112669431de453d2e.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: Re: Cfengine Help: How to configure a client machine to contact
> the policy server and downloads updates?
> Author: David Brazzeal
> Link to topic: https://cfengine.com/forum/read.php?3,19909,19968#msg-19968
>
> Thanks for your responses!
> On my test policy server, I edited the /var/cfengine/masterfiles/
> promises.cf and added my client?s IP:
> allowconnects         => { "127.0.0.1" , "::1", "172.18.160.102" };
> allowallconnects      => { "127.0.0.1" , "::1", "172.18.160.102" };
> trustkeysfrom         => { "127.0.0.1" , "::1", "172.18.160.102" };
>
> I then ran cf-agent to get the promises file copied from the masterfiles
> dir to the input dir on the policy server.
>
> Now it looks like my key authentication is working. I can tell because I
> see this in my agent log after I run this: cf-agent -v -B -s dbraz17
> Strong authentication of server=dbraz17.aafes.com connection confirmed
> cf3  -> Public key identity of host "172.18.161.2" is
> "MD5=b95774952d4a8a76b4f43196850afae8"
> cf3  -> Last saw 172.18.161.2 (+MD5=b95774952d4a8a76b4f43196850afae8) first
> time now
> cf3  -> Going to secondary storage for key
>
> But I?m still seeing this error on my agent:
> cf3 Server returned error:  Unspecified server refusal (see verbose server
> output)
> cf3 Can't stat /var/cfengine/masterfiles in files.copyfrom promise
>
> In following this:
> http://www.cfengine.org/manuals/cf3-tutorial.html#Server-connection
> It says this:
>
> ?Permission to access something
> Your host name or IP address must be mentioned in an access promise inside
> a server bundle, made by the file that you are trying to access.?
>
> Do you have any examples of how that?s done? (What does the access promise
> look like in what file(s) on the policy server?) Should I configure the
> server to give clients access to all files under /var/cfengine/masterfiles?
> Am I supposed to expect all files from my policy server?s
> /var/cfengine/masterfiles folder to get copied to my agent?s
> /var/cfengine/input folder?
> Thanks!
>
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 28 Dec 2010 23:13:49 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: how do you restart a process only after .conf
>        update?
> To: help-cfengine@cfengine.org
> Message-ID:
>        <de9207cb5771b0df5bd195bdd89345e9.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: how do you restart a process only after .conf update?
> Author: Sal
> Link to topic: https://cfengine.com/forum/read.php?3,19969,19969#msg-19969
>
> We manage changes to several .conf files via cfengine and want to restart
> the daemon only after each new .conf file is pushed but my current logic
> seems to restart the daemon each time cfengine runs.
>
> My syntax within the bundle is:
>
> files:
>
>        any.!ntp_servers::
>                "$(ntp_conf_dest)"
>                        perms => system("644"),
>                        copy_from =>
> mycopy("$(master_etc)/ntp/$(ntp_conf_source)","$(p_server)"),
>                        action => immediate;
>
> processes:
>
>        "$(ntp_conf_dest)" restart_class => "start_ntpd";
>
> commands:
>
>        start_ntpd::
>
>                "/etc/init.d/ntpd restart";
>
> Since cf-execd is set to run every 20 minutes, ntpd gets restarted every 20
> minutes. What am I missing? It looks like the logic is now that if the file
> $(ntp_conf_dest) exists then restart ntpd. I was hoping this method would
> only run when the file was transferred. Should I not be using restart_class?
> Should I instead use some logic that checks for a change in the .conf file
> and that triggers the restart?
>
>
>
> ------------------------------
>
> Message: 7
> Date: Tue, 28 Dec 2010 23:34:12 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: Re: Cfengine Help: How to configure a client
>        machine to contact the policy server and downloads updates?
> To: help-cfengine@cfengine.org
> Message-ID:
>        <dcecd9e0f662523ddf2d00e49eb6a7ad.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: Re: Cfengine Help: How to configure a client machine to contact
> the policy server and downloads updates?
> Author: David Brazzeal
> Link to topic: https://cfengine.com/forum/read.php?3,19909,19970#msg-19970
>
> Never mind. I edited this below section in the site.cf on the policy
> server to allow access to /var/cfengine/masterfiles and then when I ran
> "cf-agent -v -B -s " on my agent,  all of the files from the
> /var/cfengine/masterfiles on my policy server got copied to the
> /var/cfengine/input folder on my client (overwriting my failsafe.cf) :)
>
> bundle server access_rules()
> {
> access:
>
>  "/var/cfengine/masterfiles"
>
>    admit   => { "127.0.0.1", "172.18.160.102" };
>
> }
>
>
>
> ------------------------------
>
> Message: 8
> Date: Wed, 29 Dec 2010 00:55:52 +0100 (CET)
> From: no-re...@cfengine.com
> Subject: Cfengine Help: Re: how do you restart a process only after
>        .conf   update?
> To: help-cfengine@cfengine.org
> Message-ID:
>        <115a4c00b46e1a56d945ab639a322845.cfengineh...@cfengine.com>
> Content-Type: text/plain; charset=UTF-8
>
> Forum: Cfengine Help
> Subject: Re: how do you restart a process only after .conf update?
> Author: Sal
> Link to topic: https://cfengine.com/forum/read.php?3,19969,19971#msg-19971
>
> I think I've come up with my own solution. At least the ntpd process is no
> longer auto restarting every 20 minutes. I still need to change ntp.conf to
> test but here is the new syntax:
>
> files:
>
>        any.!ntp_servers::
>                "$(ntp_conf_dest)"
>                        perms => system("644"),
>                        copy_from =>
> mycopy("$(master_etc)/ntp/$(ntp_conf_source)","$(p_server)"),
>                        classes => satisfied("ntpd_ready");
>
> commands:
>
>        ntpd_ready::
>
>                "/etc/init.d/ntpd restart";
>
> The examples show this is the way to do this.
>
>
>
> ------------------------------
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>
>
> End of Help-cfengine Digest, Vol 58, Issue 67
> *********************************************
>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to