bringup: devconfig: fix python3-apt debian issue
A message that is not in the archive (sent off-list or not yet received): CGME20250131210630eucas1p18ab8dba510ee2ddc84ac28a653daf597@eucas1p1.samsung.com
PATCH 1/1 bringup: devconfig: fix python3-apt debian issue
Downgrade python3-apt package to 2.9.6 during bringup to avoid Ansible error with apt module (see below).
Build from source python3-apt using pip, and lock any possible future upgrades of the package to avoid overwriting the build from source deployment.
This is a workaround until python3-apt package in Debian testing is fixed. It will also delay the bringup process considerably depending on the guest.
The latest python3-apt releases 2.9.8 and 2.9.7 produces the following error with Ansible:
Error message:
TASK [create_partition : Install partition creation base tools]
fatal: [4da8c431f681-xfs-reflink-4k]: FAILED! => {
"changed": false
}
MSG:
python3-apt must be installed and visible from /usr/bin/python3.
Tested with Ansible version:
ii ansible 9.5.1+dfsg-1 all ii ansible-core 2.17.1-1
ansible --version
ansible [core 2.17.1]
...
python version = 3.12.6 (main, Sep 7 2024, 14:20:15) [GCC 14.2.0]
(/usr/bin/python3)
jinja version = 3.1.3
libyaml = True
ansible-playbook --version
ansible-playbook [core 2.17.1]
...
executable location = /usr/bin/ansible-playbook
python version = 3.12.6 (main, Sep 7 2024, 14:20:15) [GCC 14.2.0]
(/usr/bin/python3)
jinja version = 3.1.3
libyaml = True
---
Latest versions of python3-apt produces playbook errors when apt or package Ansible modules are used. Replace the current Debian testing package with an older working version of python3-apt.
This workaround fixes the current kdevops CI issue in GitHub [1].
[1] https://github.com/linux-kdevops/kdevops/actions/runs/13040775569/job/36420451428
To: Luis Chamberlain <[email protected]>
Cc: [email protected]
--- .../devconfig/tasks/install-deps/debian/main.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+)
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +42 -0
@@ -1,4 +1,46 @@ --- +- name: Update package lists + become: true + become_method: sudo + ansible.builtin.shell: + cmd: > + DEBIAN_FRONTEND=noninteractive apt + -o Acquire::Check-Valid-Until=false update + when: + - ansible_os_family == "Debian" + tags: vars_simple + register: apt_update_result + retries: 5 + delay: 10 + until: apt_update_result.rc == 0 + +- name: Install required packages + become: true + become_method: sudo + ansible.builtin.shell: + cmd: > + DEBIAN_FRONTEND=noninteractive apt install -y + python3-setuptools libapt-pkg-dev python3-pip git + when: + - ansible_os_family == "Debian" + tags: vars_simple + +- name: Install python-apt from Git with pip3 + become: true + become_method: sudo + ansible.builtin.shell: + cmd: pip3 install git+https://salsa.debian.org/apt-team/[email protected] --break-system-packages + when: + - ansible_os_family == "Debian" + tags: vars_simple + +- name: Hold python3-apt package version + become: yes + ansible.builtin.command: apt-mark hold python3-apt + when: + - ansible_os_family == "Debian" + tags: vars_simple + - name: Remove unattended-upgrades package become: yes become_flags: 'su - -c'
---
base-commit: 4da8c431f681d6b8009518c6766c638267d9c61a
change-id: 20250131-fix-python3-apt-227607641858
Best regards,
Signature · 1 line
Daniel Gomez <[email protected]>
Quoted 103 lines · Daniel Gomez
Downgrade python3-apt package to 2.9.6 during bringup to avoid Ansible error with apt module (see below).
Build from source python3-apt using pip, and lock any possible future upgrades of the package to avoid overwriting the build from source deployment.
This is a workaround until python3-apt package in Debian testing is fixed. It will also delay the bringup process considerably depending on the guest.
The latest python3-apt releases 2.9.8 and 2.9.7 produces the following error with Ansible:
Error message:
TASK [
create_partition: Install partition creation base tools]
fatal: [4da8c431f681-xfs-reflink-4k]: FAILED! => {
"changed": false
}MSG:
python3-apt must be installed and visible from
/usr/bin/python3.Tested with Ansible version:
ii ansible 9.5.1+dfsg-1 all ii ansible-core 2.17.1-1ansible --version
ansible [core 2.17.1]
...
python version = 3.12.6 (main, Sep 7 2024, 14:20:15) [GCC 14.2.0]
(/usr/bin/python3)
jinja version = 3.1.3
libyaml = True
ansible-playbook --version
ansible-playbook [core 2.17.1]
...
executable location =/usr/bin/ansible-playbook
python version = 3.12.6 (main, Sep 7 2024, 14:20:15) [GCC 14.2.0]
(/usr/bin/python3)
jinja version = 3.1.3
libyaml = TrueSigned-off-by Daniel Gomez <[email protected]>---
Latest versions of python3-apt produces playbook errors when apt or package Ansible modules are used. Replace the current Debian testing package with an older working version of python3-apt.This workaround fixes the current kdevops CI issue in GitHub [1].
[1] https://github.com/linux-kdevops/kdevops/actions/runs/13040775569/job/36420451428
To: Luis Chamberlain <[email protected]>
Cc: [email protected]--- .../devconfig/tasks/install-deps/debian/main.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+)playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +35
-0@@ -1,4 +1,46 @@ --- +- name: Update package lists + become: true + become_method: sudo + ansible.builtin.shell: + cmd: > + DEBIAN_FRONTEND=noninteractive apt + -o Acquire::Check-Valid-Until=false update + when: + - ansible_os_family == "Debian" + tags: vars_simple + register: apt_update_result + retries: 5 + delay: 10 + until: apt_update_result.rc == 0 + +- name: Install required packages + become: true + become_method: sudo + ansible.builtin.shell: + cmd: > + DEBIAN_FRONTEND=noninteractive apt install -y + python3-setuptools libapt-pkg-dev python3-pip git + when: + - ansible_os_family == "Debian" + tags: vars_simple + +- name: Install python-apt from Git with pip3 + become: true + become_method: sudo + ansible.builtin.shell: + cmd: pip3 install git+https://salsa.debian.org/apt-team/[email protected] --break-system-packages + when: + - ansible_os_family == "Debian" + tags: vars_simple +
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml line 46
Quoted 10 lines
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +7
-0+- name: Hold python3-apt package version + become: yes + ansible.builtin.command: apt-mark hold python3-apt + when: + - ansible_os_family == "Debian" + tags: vars_simple + - name: Remove unattended-upgrades package become: yes become_flags: 'su - -c'
I'm making this specific to Debian trixie.
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +7 -1
@@ -8,6 +8,7 @@ -o Acquire::Check-Valid-Until=false update when: - ansible_os_family == "Debian" + - ansible_distribution_release == "trixie" tags: vars_simple register: apt_update_result retries: 5
@@ -23,15 +24,20 @@ python3-setuptools libapt-pkg-dev python3-pip git when: - ansible_os_family == "Debian" + - ansible_distribution_release == "trixie" tags: vars_simple - name: Install python-apt from Git with pip3 become: true become_method: sudo ansible.builtin.shell: - cmd: pip3 install git+https://salsa.debian.org/apt-team/[email protected] --break-system-packages + cmd: > + pip3 install + git+https://salsa.debian.org/apt-team/[email protected] + --break-system-packages when: - ansible_os_family == "Debian" + - ansible_distribution_release == "trixie" tags: vars_simple - name: Hold python3-apt package version
Since this is needed to fix CI, I'll push this to let gh continue and see if there's any other errors in the rest of the pipeline. Please, revert if/when proper fix is found.
Quoted 9 lines
---
base-commit:4da8c431f681d6b8009518c6766c638267d9c61a
change-id: 20250131-fix-python3-apt-227607641858Best regards,
Signature · 1 line
Daniel Gomez <[email protected]>