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 ?