On May 15, Hartmut Goebel wrote:
I try to install a backport from strech-backport, but this does not
work
as I expected. While the preferences are set, I did not find an "apt
update" (or such) task to be performed. What am I missing?
role defaults:
ejabberd__apt_preferences__dependent_list:
- packages: ['ejabberd', "erlang-*"]
backports: [ 'stretch' ]
reason: 'Version parity with Debian Buster'
by_role: 'debops.ejabberd'
playbook:
- role: debops.apt_preferences
tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
apt_preferences__dependent_list:
- '{{ ejabberd__apt_preferences__dependent_list }}'
- role: debops.ejabberd
tags: [ 'role::ejabberd', 'skip::ejabberd' ]
tasks:
- name: Install required packages
package:
name: '{{ item }}'
state: 'present'
with_flattened:
- '{{ ejabberd__base_packages }}'
- '{{ ejabberd__packages }}'
The role defaults and playbook look fine. I would check if you have the
stretch-backports repository enabled on the host (debops.apt role should set
that up), and see what's the APT preference for the ejabberd package. For
example without a pin, mine looks like:
#v+
drybjed@host:~$ apt-cache policy ejabberd
ejabberd:
Installed: (none)
Candidate: 16.09-4
Version table:
18.12.1-2~bpo9+1 100
100
http://ftp.pl.debian.org/debian stretch-backports/main amd64 Packages
100
http://deb.debian.org/debian stretch-backports/main amd64 Packages
16.09-4 500
500
http://ftp.pl.debian.org/debian stretch/main amd64 Packages
500
http://deb.debian.org/debian stretch/main amd64 Packages
#v-
Yours should point to 18.12 version, I imagine. If not, check if the pin was
written correctly in /etc/apt/preferences.d/.
You could also try and install ejabberd package manually after setting up the
pin, but before installing it via Ansible. See what APT is up to, maybe some
other package not pinned to stretch-backports prevents installation of the
backported ejabberd package?
Cheers,
Maciej