saltstack / kitchen-salt

SaltStack provisioner for test-kitchen
MIT License
199 stars 112 forks source link

Support for Debian bullseye: is there any way to specify the distribution for Salt apt installation? #338

Open daks opened 3 years ago

daks commented 3 years ago

For now, saltproject apt repository does not support Debian Bullseye (Debian 11) but you can still use the Buster (Debian 10) repository, with an URL like

https://repo.saltproject.io/py3/debian/10/amd64/latest buster main

(the same URL with bullseye does not work)

I have the following in my Kitchen config file:

  salt_install: apt
  salt_version: 3003.3
  salt_apt_repo: https://repo.saltproject.io/py3/debian/10/amd64/archive
  salt_apt_repo_key: https://repo.saltproject.io/py3/debian/10/amd64/archive/3003.3/salt-archive-keyring.gpg

As you can see the salt_apt_repo does not contain the 'distribution' target and its value is calculated by kitchen-salt as you can see on the log extract below:

Ign:4 https://repo.saltproject.io/py3/debian/10/amd64/archive/3003.3 bullseye InRelease
Err:5 https://repo.saltproject.io/py3/debian/10/amd64/archive/3003.3 bullseye Release
         404  Not Found [IP: 172.16.30.254 3142]
Reading package lists... Done
       E: The repository 'https://repo.saltproject.io/py3/debian/10/amd64/archive/3003.3 bullseye Release' does not have a Release file.
       N: Updating from such a repository can't be done securely, and is therefore disabled by default.
       N: See apt-secure(8) manpage for repository creation and user configuration details.
-----> Installing salt-minion (3003.3)

I found the apt_repo_add function/method here https://github.com/saltstack/kitchen-salt/blob/master/lib/kitchen/provisioner/repository-setup.sh but I didn't found where its dist parameter is coming from.

Is there any way to specify/override the dist parameter, or could this functionality be added?

daks commented 3 years ago

Looks like the problem is coming from this file https://github.com/saltstack/kitchen-salt/blob/master/lib/kitchen/provisioner/install.erb#L56 and dist value comes from lsb_release

bryceml commented 3 years ago

wanted to put down that the tiamat daily build repos, such as https://repo.saltproject.io/salt-dev/py3/debian/10/amd64/ are using stable for the dist value on all debian repos, so we should accommodate those as well.