CFEngine Help: Re: fileexists() and regular expressions
Forum: CFEngine Help Subject: Re: fileexists() and regular expressions Author: phnakarin Link to topic: https://cfengine.com/forum/read.php?3,27386,27390#msg-27390 :-D Cheers, -- Nakarin ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: Re: Raise a class when class thing1 but not class thing2
Forum: CFEngine Help Subject: Re: Raise a class when class thing1 but not class thing2 Author: FraserCampbell Link to topic: https://cfengine.com/forum/read.php?3,27246,27394#msg-27394 neilhwatson Wrote: --- > How do you undefine a class? I'd also be interested in this. I'm using a module for this (echo -SOMECLASS) but I'd prefer to do it directly in the policy if it's possible. Thanks, Fraser ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: Re: Raise a class when class thing1 but not class thing2
Forum: CFEngine Help Subject: Re: Raise a class when class thing1 but not class thing2 Author: nickanderson Link to topic: https://cfengine.com/forum/read.php?3,27246,27395#msg-27395 FraserCampbell Wrote: --- > neilhwatson Wrote: > -- > - > > How do you undefine a class? > > I'd also be interested in this. I'm using a > module for this (echo -SOMECLASS) but I'd prefer > to do it directly in the policy if it's possible. > > Thanks, > Fraser Sorry I thought I answered to neil. see cancel_kept, cancel_repaired, cancel_notkept in classes body. Ref Manual 6.6.2 classes (body template) ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: service policy not working
Forum: CFEngine Help Subject: service policy not working Author: skel84 Link to topic: https://cfengine.com/forum/read.php?3,27396,27396#msg-27396 HI, i'm having a strange issue with a service policy. Here's the bundle: # body common control { bundlesequence => { "service_catalogue" }; } bundle agent service_catalogue { services: aix|(linux.!log):: "ntp" service_policy => "start"; "nrpe" service_policy => "start"; "ssh" service_policy => "start"; "syslog"service_policy => "start"; nim:: "tftp" service_policy => "start"; "nfs" service_policy => "start"; } bundle agent standard_services(service,state) { vars: linux:: "startcommand" string => "/etc/init.d/ntpd start"; "stopcommand" string => "/etc/init.d/ntpd stop"; "reloadcommand" string => "/etc/init.d/ntpd restart"; "processname" string => "ntpd"; "startcommand" string => "/etc/init.d/nrpe start"; "stopcommand" string => "/etc/init.d/nrpe stop"; "reloadcommand" string=> "/etc/init.d/nrpe restart"; "processname" string => "nrpe"; "startcommand" string => "/etc/init.d/sshd start"; "stopcommand" string => "/etc/init.d/sshd stop"; "reloadcommand" string => "/etc/init.d/sshd restart"; "processname" string => "sshd"; redhat_4|redhat_5:: "startcommand" string => "/etc/init.d/syslog start"; "stopcommand" string=> "/etc/init.d/syslog stop"; "reloadcommand" string => "/etc/init.d/syslog restart"; "processname" string=> "syslogd"; redhat_6:: "startcommand" string => "/etc/init.d/rsyslog start"; "stopcommand" string=> "/etc/init.d/rsyslog stop"; "reloadcommand" string => "/etc/init.d/rsyslog restart"; "processname" string=> "rsyslogd"; aix:: "startcommand" string => "/usr/bin/startsrc -s xntpd"; "stopcommand" string => "/usr/bin/stopsrc -s xntpd"; "reloadcommand" string => "/usr/bin/refresh -s xntpd"; "processname" string => "xntpd"; "startcommand" string => "/usr/bin/startsrc -s sshd"; "stopcommand" string => "/usr/bin/stopsrc -s sshd"; "reloadcommand" string => "/usr/bin/refresh -s sshd"; "processname" string => "sshd"; "startcommand" string => "/usr/bin/startsrc -s syslogd"; "stopcommand" string=> "/usr/bin/stopsrc -s syslogd"; "reloadcommand" string => "/usr/bin/refresh -s syslogd"; "processname" string=> "syslogd"; "startcommand" string => "/mgmt/sys/scripts/nrpe_cmd.sh start"; "stopcommand" string => "/mgmt/sys/scripts/nrpe_cmd.sh stop"; "reloadcommand" string=> "/mgmt/sys/scripts/nrpe_cmd.sh restart"; "processname" string => "nrpe"; nim:: "startcommand" string => "/usr/bin/startsrc -s tftpd"; "stopcommand" string => "/usr/bin/stopsrc -s tftpd"; "reloadcommand" string=> "/usr/bin/refresh -s tftpd"; "processname" string => "tftpd"; "startcommand" string => "/usr/bin/startsrc -s nfsd"; "stopcommand" string => "/usr/bin/stopsrc -s nfsd"; "reloadcommand" string => "/usr/bin/refresh -s nfsd"; "processname" string => "nfsd"; classes: "start" expression => strcmp("start","$(state)"); "stop" expression => strcmp("stop","$(state)"); processes: start:: ".*$(processname[$(service)]).*" handle => "sys_procs_$(service)_start", comment => "Verify that the service appears in the process table", restart_class => "restart_$(service)"; stop:: ".*$(processname[$(service)]).*" handle => "sys_aix_procs_$(service)_stop", comment => "Verify that the service does not appears in the process table", process_stop=> "$(stopcommand[$(service)])", signals => { "term", "kill"}; commands: "$(startcommand[$(service)])" handle => "sys_procs_$(service)_start", comment => "Execute command to start the $(service) service",
CFEngine Help: Re: reporting on existence of files in a directory
Forum: CFEngine Help Subject: Re: reporting on existence of files in a directory Author: sauer Link to topic: https://cfengine.com/forum/read.php?3,27088,27397#msg-27397 Could you use your original promise with the tidy and warn_only, and add a classes body to raise a class for "repair_denied"? Is this where repair_denied works? I suppose I could just test that instead of asking the question... ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: CfEngine installation doubt
Forum: CFEngine Help Subject: CfEngine installation doubt Author: mchavarriae Link to topic: https://cfengine.com/forum/read.php?3,27398,27398#msg-27398 I'm trying to install cfengine nova on SuSE, but in this tutorial (http://cfengine.com/manuals/enterprise-2-2-ownersmanual) about the bootstrap process say this: "The remaining steps apply to all hosts" but, then says "Use the same command on all hosts, i.e. *** do not bootstrap the policy server with a localhost address ***" so, I don't know what to do… I should bootstrap the policy server (this would be use as a client) or not? Thanks ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: Re: CfEngine installation doubt
Forum: CFEngine Help Subject: Re: CfEngine installation doubt Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,27398,27399#msg-27399 Bootstrap the policy server to its own network address or hostname but not 'localhost' or '127.0.0.1'. ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: Re: CfEngine installation doubt
Forum: CFEngine Help Subject: Re: CfEngine installation doubt Author: mchavarriae Link to topic: https://cfengine.com/forum/read.php?3,27398,27400#msg-27400 perfect!!! Thanks!! ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine
CFEngine Help: Trying to write an array of lists to files
Forum: CFEngine Help Subject: Trying to write an array of lists to files Author: btomasini Link to topic: https://cfengine.com/forum/read.php?3,27402,27402#msg-27402 I am working on building out a set of user skeleton directories. My approach is to have a list of keys for each user, and store each list in an array, whose key is the username. I have no problem making this work if I have a single key as a string assigned to the array element. I am not able to get it to work with an slist. Rather than having the key values show up in the files, I am getting the variable name. bundle agent users_skel_keys { vars: # This works "users" string => "key1"; # These don't: "users" slist => {"key1", "key2"}; "users" slist => {"key3", "key4"}; "index" slist => getindices("users"); files: "/var/cfengine/files/users_skel/$(index)/.ssh/." create => "true", perms => m("0700"); "/var/cfengine/files/users_skel/$(index)/.ssh/authorized_keys2" comment => "Edit authorized_keys2 files", create => "true", perms => m("0600"), edit_defaults => empty, edit_line => insert_array_lines("users_skel_keys.users[$(index)]"); } bundle edit_line insert_array_lines(v) { insert_lines: "$($(v))", comment => "Inserting key for value [$(v)]"; } Here is the console output: ubuntu@nd13:~/.cfagent/inputs/test$ sudo cf-agent -KI -f ./test_users.cf -b users_skel_keys sudo: unable to resolve host nd13 !! No commercial license file found - falling back on internal expiry !! Your configuration promises no host_licenses_paid in common control !! By doing this, you confirm that the terms of the contract are legally binding !! Unknown user $(user) in promise !! Your configuration promises no host_licenses_paid in common control !! By doing this, you confirm that the terms of the contract are legally binding >> Using command line specified bundlesequence -> Edited file /var/cfengine/files/users_skel/bob/.ssh/authorized_keys2 -> Edited file /var/cfengine/files/users_skel/joe/.ssh/authorized_keys2 ubuntu@nd13:~/.cfagent/inputs/test$ sudo cat /var/cfengine/files/users_skel/bob/.ssh/authorized_keys2 sudo: unable to resolve host nd13 $(users_skel_keys.users) ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine