Forum: Cfengine Help
Subject: hp-ux SD package management
Author: santa
Link to topic: https://cfengine.com/forum/read.php?3,21261,21261#msg-21261

Hello,

I have a new question about cfengine 3.1.4 .
I try to implement SD-UX package installation on HP-UX 11.23 from a remote 
server into cfengine .
I try to add then delete logrotate from a remote depot server.
With package_policy add, swinstall works. But when I launch again cf-execd  , 
it tries to install once again the package !
Furthermore, my delete policy doesn't work, 'swremove logrotate' is never 
launched !


body package_method hpux(sdserver,repo)
{
package_changes => "individual";

package_list_command => "/usr/sbin/swlist -v -l product -a 
software_spec|/usr/bin/grep ^software_spec";
package_list_name_regex    => "software_spec\s*([^,]+),.*";
package_list_version_regex    => "software_spec\s*[^,]+,l=[^,]+,r=([^,]+),a=.*";

package_installed_regex => "software_spec.*"; # all reported are installed
package_add_command => "/usr/sbin/swinstall -s $(sdserver):$(repo)";
package_update_command => "/usr/sbin/swinstall -s $(sdserver):$(repo)";
package_delete_command => "/usr/sbin/swremove";
}

bundle agent hpux_common {
        packages:
                "logrotate"
                        package_policy                  => "delete",
                        package_method                  => 
hpux("mySDserver.world.fr","/myDEPOTS"),
                        comment                         => "delete package 
logrotate";
}



FYI here is the result of :
# /usr/sbin/swlist -v -l product -a software_spec|/usr/bin/grep ^software_spec
...
software_spec          tar,l=/usr/local,r=1.15.1,a=HP-UX_B.11.23_64
software_spec          logrotate,l=/usr/local,r=3.7.9,a=HP-UX_B.11.23_64

Without the grep I have these lines in the first lines of swlist output :

# Initializing...
# Contacting target "va2034"...
#
# swlist   Installed Software Table of Contents
#
# For host:  va2034:/
#
# Date:  Fri Mar 25 12:08:34 2011
#

  tusc
product
software_spec          tusc,l=/usr/local,r=7.8,a=HP-UX_B.11.23_64

  unzip
product
software_spec          unzip,l=/usr/local,r=5.52,a=HP-UX_B.11.23_64


Do you have any idea about these problems => several installation of the same 
package with add, and no delete ?
Maybe my pcre expression are badly written.

Thank you.

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to