package promises

22 views
Skip to first unread message

Stefan Skoglund

unread,
May 23, 2017, 5:12:16 PM5/23/17
to help-c...@googlegroups.com
dns_service.cf
---
vars:
"bind_packages"
slist => { "bind9-host", "dnsutils", "bind9utils", "bind9",
"bind9-doc" };

packages:
debian.default:DNS_service::
"$(bind_packages)"
handle => "ns_$(this.namespace)_install_$(this.promiser)",
policy => "present",
package_module => default:apt_get,
classes => lokeldarn:package_installed,
comment => "installationsstanza för $(this.promiser) paketet",
meta => {"lokeldarn", "DNS"};
---


---
[sudo root@LOKELDARN@hpdc7k:/etc/apt]# cat apt.conf.d/75prefer_jessie
// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
//DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
APT
{
Architectures { "amd64"; };
Default-Release "jessie";
GET
{
Show-Versions "true";
};
};
---

My trouble is that the installation of bind9-host downgrades one of its
dependencies, which is then later on upgraded by the installation of
bind9 (and thru dependencies triggers upgrade of bind9-host.)

Which basically means that bind9 is removed every 10 minutes and then
reinstalled....

Hilfe...


Neil H. Watson

unread,
May 23, 2017, 5:49:59 PM5/23/17
to help-c...@googlegroups.com
Isn't that a Debian problem rather than CFengine? Check Debian for package
dependency bugs.

As a work around you might be able to do apt pinning to pin the package
versions.

--
Neil H Watson @neil_h_watson
CFEngine reporting: https://github.com/neilhwatson/delta_reporting
CFEngine policy: https://github.com/neilhwatson/evolve_cfengine_freelib
CFEngine and vim: https://github.com/neilhwatson/vim_cf3

Marco Marongiu

unread,
May 24, 2017, 5:00:19 AM5/24/17
to help-c...@googlegroups.com


On 23/05/17 23:49, Neil H. Watson wrote:
> Isn't that a Debian problem rather than CFengine? Check Debian for package
> dependency bugs.
> As a work around you might be able to do apt pinning to pin the package
> versions.

I agree with Neil. You seem to have some dependency problems that are
outside of CFEngine's reach. I second his suggestions to use pins. Or,
if you know you are installing packages from different "releases" (e.g.
from jessie and jessie-backports) you should not mix them in the same
promise. But that gets messy quickly, pins are the definitive solution
for dependency problems.

-- M

Alex Georgopoulos

unread,
May 24, 2017, 7:10:11 PM5/24/17
to help-cfengine
what does apt-cache policy bind9-host and apt-cache policy bind9 say?  That will prob tell you where there a problem.

Stefan Skoglund

unread,
May 26, 2017, 5:43:41 PM5/26/17
to help-c...@googlegroups.com
I found the culprit and it was me (i had two different package promises
at the same time, one of the referenced the old version ...)


Stefan Skoglund

unread,
May 26, 2017, 6:04:05 PM5/26/17
to help-c...@googlegroups.com
tis 2017-05-23 klockan 23:12 +0200 skrev Stefan Skoglund:
> dns_service.cf
> ---
> vars:
> "bind_packages"
> slist => { "bind9-host", "dnsutils", "bind9utils", "bind9",
> "bind9-doc" };
>
> packages:
> debian.default:DNS_service::
> "$(bind_packages)"
> handle => "ns_$(this.namespace)_install_$(this.promiser)",
> policy => "present",
> package_module => default:apt_get,
> classes => lokeldarn:package_installed,
> comment => "installationsstanza för $(this.promiser) paketet",
> meta => {"lokeldarn", "DNS"};
> ---

I have a question:
what is the recommended methods for storing and distribution promised
package versions (for example bind9) ?

Or is it recommended to avoid to use the 'version' field in packages
promises ?

I encode now a json file which packages is promised to be installed
example:
----
{
"_Time-stamp": "Time-stamp: <2017-05-26 23:48:40 stefan>",
"comment": "versioner av önskade bind9:paket inklusive 'host', 'dig' och 'nslookup'",

"packages":
{
"debian_7":
{
"bind9": "1:9.8.4.dfsg.P1-6+nmu2+deb7u15",
"bind9-host": "1:9.8.4.dfsg.P1-6+nmu2+deb7u15",
"bind9utils": "1:9.8.4.dfsg.P1-6+nmu2+deb7u15",
"bind9-doc": "1:9.8.4.dfsg.P1-6+nmu2+deb7u15"
},
"debian_8":
{
"bind9": "1:9.9.5.dfsg-9+deb8u11",
"bind9-host": "1:9.9.5.dfsg-9+deb8u11",
"bind9utils": "1:9.9.5.dfsg-9+deb8u11",
"bind9-doc": "1:9.9.5.dfsg-9+deb8u11",
"dnsutils": "1:9.9.5.dfsg-9+deb8u11",
"libbind-dev":"1:9.9.5.dfsg-9+deb8u11",

}
}
}
----

----
"package_version_data_in_buffer"
handle => "ns$(this.namespace)_package_version_data_in_buffer",
data => readdata("$(this.promise_dirname)/packages-version.json", "JSON"),
meta => { "lokeldarn", "network"};
"package_version_data"
depends_on => { "ns$(this.namespace)_package_version_data_in_buffer" },
data => mergedata("package_version_data_in_buffer"),
meta => { "lokeldarn", "network"};
----

install stanza:
---
packages:
"bind9"
policy => "present",
version => "$(package_version_data[packages][$(default:sys.flavour)][$(this.promiser)])",
package_module => default:apt_get,
meta => {"lokeldarn", "network"};
---

Im beginning to think that it is better to promise only a selected
number of packages (bind9, bind9utils, make), distribute promised
package versions in a special json file whose only usage is describing
promised versions of program packages and let the system figure the
dependencies or should i avoid hardcoding package versions at all cost ?

Reply all
Reply to author
Forward
0 new messages