
#
# Package managment
#

body common control
{
bundlesequence => { "packages" };
}

#############################################

bundle agent packages
{
vars:

 # Test the simplest case -- leave everything to the zypper smart manager

 "match_package" slist => { 
                          "apache2", 
                          "apache2-mod_php5",
                          "apache2-prefork",
                          "php5" 
                          };
packages:

  "$(match_package)"

     package_policy => "add",
     package_method => zypper;

}

#############################################

body package_method zypper

{
any::

 package_changes => "bulk";

 package_list_command => "/usr/bin/zypper packages";

 # Remember to escape special characters like |

 package_list_name_regex    => "[^|]+\|[^|]+\|\s+([^\s]+).*";
 package_list_version_regex => "[^|]+\|[^|]+\|[^|]+\|\s+([^\s]+).*";
 package_list_arch_regex    => "[^|]+\|[^|]+\|[^|]+\|[^|]+\|\s+([^\s]+).*";

 package_installed_regex => "i.*";

 package_name_convention => "$(name)";

 # Use these only if not using a separate version/arch string
 # package_version_regex => "";
 # package_name_regex => "";
 # package_arch_regex => "";

package_add_command => "/usr/bin/zypper -non-interactive install";
package_delete_command => "/usr/bin/zypper -non-interactive remove --force-resolution";
package_update_command => "/usr/bin/zypper -non-interactive update";
package_patch_command => "/usr/bin/zypper -non-interactive patch";
package_verify_command => "/usr/bin/zypper -non-interactive verify";
#package_noverify_regex => "";
#package_noverify_returncode => "-1";

}
