Hi Marc,
On Thu, 17 Feb 2022 09:30:06 +0100 Marc Haber
wrote:
Package: ansible
Version: 2.10.7+merged+base+2.10.8+dfsg-1
Severity: normal
Hi,
when using a Deb822 style sources file in apt, such as:
$ cat /etc/apt/sources.list.d/docker-stable.sources
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: bullseye
Components: stable
Signed-By: /etc/apt/docker.gpg
$
ansible code like:
- name: configure apt - remove transitional packages
apt:
name: "{{ packages }}"
state: "absent"
vars:
packages:
- iproute
fails with:
fatal: [corte]: FAILED! => {"changed": false, "msg": "E:Malformed stanza 1 in source
list /etc/apt/sources.list.d/docker-stable.sources (type), E:The list of sources could not be read."}
Can you still reproduce this issue on bookworm? I tried with
$ ansible -m apt -a 'update_cache=yes' localhost -K --become
$ ansible -m apt -a 'name=0ad state=absent' localhost -K --become
and both command ran through without issue, despite having several deb822-style
files in /etc/apt/sources.list.d/*.sources
It seems as though the ansible apt module uses python3-apt, and there the
feature was enabled in:
python-apt (2.5.3) unstable; urgency=medium
[ Nick Rosbrook ]
* deb822: allow initializing a Deb822SourceEntry from string
* all: fix PEP8 formatting
* .gitlab-ci.yml: update typing stage to use venv
-- Julian Andres Klode Thu, 23 Feb 2023 21:38:02 +0100
Expected behavior would be the ansible run to succeed.
Greetings
Marc
-- System Information:
Debian Release: bookworm/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'stable-security'), (500,
'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.16.9-zgws1 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages ansible depends on:
ii openssh-client1:8.7p1-4
ii python3 3.9.8-1
ii python3-cryptography 3.4.8-1
ii python3-distutils 3.9.10-1
ii python3-dnspython 2.2.0-2
ii python3-httplib2 0.20.2-2
ii python3-jinja23.0.3-1
ii python3-netaddr 0.8.0-2
ii python3-packaging 21.3-1
ii python3-paramiko 2.8.1-1
ii python3-pycryptodome 3.11.0+dfsg1-3
ii python3-yaml 5.4.1-1+b1
Greets,
Lee