Forum: CFEngine Help
Subject: Re: RE: CFEngine Help: Utilising debian backports
Author: simonblake
Link to topic: https://cfengine.com/forum/read.php?3,23727,23777#msg-23777
simonblake Wrote:
> It has occurred to me that I could take a copy of
> "body package_method apt" from cfengine_stdlib.cf,
> rename it and add a "-t squeeze-backports" to the
> relevant apt-get and aptitude calls, then change
> the package_method to point at my changed body.
> That might be quite a tidy way to route around the
> problem.
I did get around to trying this, and it worked perfectly. Should anybody else
need to do the same sort of thing, I ended up with:
vars:
"backport_package" slist =>
{"pacemaker", "corosync", "ocfs2-tools", "cman", "dlm-pcmk" };
packages:
debian::
"$(backport_package)"
package_policy => "addupdate",
package_method => apt_bpo;
body package_method apt_bpo
{
package_changes => "bulk";
package_list_command => "/usr/bin/dpkg -l";
package_list_name_regex => "ii\s+([^\s]+).*";
package_list_version_regex => "ii\s+[^\s]+\s+([^\s]+).*";
package_installed_regex => ".*"; # all reported are installed
package_name_convention => "$(name)";
package_list_update_ifelapsed => "240"; # 4 hours
have_aptitude::
package_add_command => "/usr/bin/aptitude -t squeeze-backports --assume-yes
install";
package_list_update_command => "/usr/bin/aptitude update";
package_delete_command => "/usr/bin/aptitude -t squeeze-backports
--assume-yes remove";
package_update_command => "/usr/bin/aptitude -t squeeze-backports
--assume-yes install";
package_verify_command => "/usr/bin/aptitude show";
package_noverify_regex => "(State: not installed|E: Unable to locate package
.*)";
!have_aptitude::
package_add_command => "/usr/bin/apt-get -t squeeze-backports --yes install";
package_list_update_command => "/usr/bin/apt-get update";
package_delete_command => "/usr/bin/apt-get -t squeeze-backports --yes
remove";
package_update_command => "/usr/bin/apt-get -t squeeze-backports --yes
install";
package_verify_command => "/usr/bin/dpkg -s";
package_noverify_returncode => "1";
}
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine