Closed f-michaut closed 2 years ago
Hi,
seems to be an issue with older facter versions:
$ facter --version
2.5.6
$ facter os
{"name"=>"Debian", "family"=>"Debian", "release"=>{"major"=>"10", "minor"=>"5", "full"=>"10.5"}, "lsb"=>{"distcodename"=>"buster", "distid"=>"Debian", "distdescription"=>"Debian GNU/Linux 10 (buster)", "distrelease"=>"10", "majdistrelease"=>"10"}}
$ facter --version
3.14.12 (commit 70d26da13c9fee27973c1eb22200871e21445d97)
$ facter os.distro
{
codename => "buster",
description => "Debian GNU/Linux 10 (buster)",
id => "Debian",
release => {
full => "10.5",
major => "10",
minor => "5"
}
}
In the older version facts['os']['distro']['codename']}
is not not present. The change was introduced in this refactor: https://github.com/puppetlabs/puppetlabs-docker/commit/915bf8ac1f66a3e1ccdba858c88351f4ec0e2fd9#diff-2f383a197b1a428561b364755701d60eL146
An update to a newer (3.*) facter version did fix the problem in my tests.
I have reproduced the same error:
$facter -v 2.4.6
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /etc/puppetlabs/code/environments/production/modules/docker/manifests/params.pp, line: 139, column: 51) on node server
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.
Describe the Bug
I don't know if this is a puppetlabs-docker or a facter problem, but in params.pp:141 of the docker puppet module, the fact os.distro.codename used to determine the default package release does not exist on my machine.
Here is the output of
puppet facts show
:Expected Behavior
Instead of the following error message :
Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at modules/docker/manifests/params.pp:141:51
I expected to be able to use the docker module on debian 9.12Steps to Reproduce
sudo apt install puppet Install puppetlabs-docker 3.10.1 Just add
require 'docker'
in your scriptEnvironment
Debian 9.12 puppet 4.8.2