Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt module upgrade resets apt-hold values #71036

Closed
joshuaboniface opened this issue Aug 1, 2020 · 4 comments
Closed

apt module upgrade resets apt-hold values #71036

joshuaboniface opened this issue Aug 1, 2020 · 4 comments
Assignees
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@joshuaboniface
Copy link

joshuaboniface commented Aug 1, 2020

SUMMARY

Running an apt with upgrade: safe while packages are held results in the package holds being cleared. This should not occur.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

apt

ANSIBLE VERSION
ansible 2.7.7
  config file = /var/home/joshua/blse2/ansible.cfg
  configured module search path = ['/var/home/joshua/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]
CONFIGURATION
CACHE_PLUGIN(/var/home/joshua/blse2/config/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/var/home/joshua/blse2/config/ansible.cfg) = $HOME/.ansible/cache
CACHE_PLUGIN_TIMEOUT(/var/home/joshua/blse2/config/ansible.cfg) = 2592000
DEFAULT_ACTION_PLUGIN_PATH(/var/home/joshua/blse2/config/ansible.cfg) = ['/usr/share/ansible_plugins/action_plugins']
DEFAULT_CALLBACK_PLUGIN_PATH(/var/home/joshua/blse2/config/ansible.cfg) = ['/usr/share/ansible_plugins/callback_plugins']
DEFAULT_CALLBACK_WHITELIST(/var/home/joshua/blse2/config/ansible.cfg) = ['profile_tasks']
DEFAULT_CONNECTION_PLUGIN_PATH(/var/home/joshua/blse2/config/ansible.cfg) = ['/usr/share/ansible_plugins/connection_plugins']
DEFAULT_FILTER_PLUGIN_PATH(/var/home/joshua/blse2/config/ansible.cfg) = ['/usr/share/ansible_plugins/filter_plugins']
DEFAULT_FORKS(/var/home/joshua/blse2/config/ansible.cfg) = 30
DEFAULT_GATHERING(/var/home/joshua/blse2/config/ansible.cfg) = smart
DEFAULT_HOST_LIST(/var/home/joshua/blse2/config/ansible.cfg) = ['/var/home/joshua/blse2/ansible/hosts', '/var/home/joshua/blse2/ansible/constructor.yml']
DEFAULT_LOOKUP_PLUGIN_PATH(/var/home/joshua/blse2/config/ansible.cfg) = ['/usr/share/ansible_plugins/lookup_plugins']
DEFAULT_MANAGED_STR(/var/home/joshua/blse2/config/ansible.cfg) = Ansible managed - last modified on %Y-%m-%d %H:%M:%S
DEFAULT_POLL_INTERVAL(/var/home/joshua/blse2/config/ansible.cfg) = 15
DEFAULT_REMOTE_USER(/var/home/joshua/blse2/config/ansible.cfg) = deploy
DEFAULT_SCP_IF_SSH(/var/home/joshua/blse2/config/ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/var/home/joshua/blse2/config/ansible.cfg) = debug
DEFAULT_TIMEOUT(/var/home/joshua/blse2/config/ansible.cfg) = 10
DEFAULT_TRANSPORT(/var/home/joshua/blse2/config/ansible.cfg) = smart
DEFAULT_VARS_PLUGIN_PATH(/var/home/joshua/blse2/config/ansible.cfg) = ['/usr/share/ansible_plugins/vars_plugins']
INVENTORY_ENABLED(/var/home/joshua/blse2/config/ansible.cfg) = ['auto', 'yaml', 'ini', 'constructed']
RETRY_FILES_ENABLED(/var/home/joshua/blse2/config/ansible.cfg) = False
OS / ENVIRONMENT

Debian 10.X

STEPS TO REPRODUCE
  1. Manually run apt-hold mark <package> against several packages:
root@tor1:~# apt-mark showhold
grub-common
grub-pc
grub-pc-bin
grub2-common
root@tor1:~# dpkg -l | grep grub
hi  grub-common                      2.02+dfsg1-20              amd64        GRand Unified Bootloader (common files)
hi  grub-pc                          2.02+dfsg1-20              amd64        GRand Unified Bootloader, version 2 (PC/BIOS version)                                                                                                            
hi  grub-pc-bin                      2.02+dfsg1-20              amd64        GRand Unified Bootloader, version 2 (PC/BIOS modules)                                                                                                            
hi  grub2-common                     2.02+dfsg1-20              amd64        GRand Unified Bootloader (common files for version 2)     
  1. Run the following task:
- name: aptitude safe upgrade
  apt:
    update_cache: yes 
    upgrade: safe        
  1. Observe that the holds are now gone, and the held packages have been upgraded:
root@tor1:~# apt-mark showhold
root@tor1:~# dpkg -l | grep grub
ii  grub-common                      2.02+dfsg1-20+deb10u2        amd64        GRand Unified Bootloader (common files)
ii  grub-pc                          2.02+dfsg1-20+deb10u2        amd64        GRand Unified Bootloader, version 2 (PC/BIOS version)                                                                                                          
ii  grub-pc-bin                      2.02+dfsg1-20+deb10u2        amd64        GRand Unified Bootloader, version 2 (PC/BIOS modules)                                                                                                          
ii  grub2-common                     2.02+dfsg1-20+deb10u2        amd64        GRand Unified Bootloader (common files for version 2)     
EXPECTED RESULTS

The apt module should both not clear these holds and respect them (I'm not certain which issue comes first). Held packages should not be touched under any circumstances by this module as it entirely defeats the purpose of holding them.

ACTUAL RESULTS

See reproduction steps above. The output of the command even with multiple -v flags shows nothing abnormal, it's as if the hold is not respected at all.

@ansibot
Copy link
Contributor

ansibot commented Aug 1, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. packaging Packaging category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 1, 2020
@samdoran samdoran added needs_verified This issue needs to be verified/reproduced by maintainer P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Aug 4, 2020
@Akasurde
Copy link
Member

Akasurde commented Mar 6, 2024

I am unable to reproduce this issue -

root@d0ce3181cfee:/# apt-mark showhold
passwd
tar
root@d0ce3181cfee:/# dpkg -l |grep passwd
ii  base-passwd                 3.5.52build1                            amd64        Debian base system master password and group files
hi  passwd                      1:4.8.1-2ubuntu2.1                      amd64        change and administer password and group data
root@d0ce3181cfee:/# ansible-playbook main.yml -v
[WARNING]: You are running the development version of Ansible. You should only run
Ansible from "devel" if you are modifying the Ansible engine, or trying out features
under development. This is a rapidly changing source of code and can become unstable at
any point.
No config file found; using defaults
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the
implicit localhost does not match 'all'

PLAY [localhost] ************************************************************************

TASK [Gathering Facts] ******************************************************************
ok: [localhost]

TASK [apt] ******************************************************************************
ok: [localhost] => {"changed": false, "msg": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nCalculating upgrade...\nThe following packages have been kept back:\n  passwd\n0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.\n", "stderr": "", "stderr_lines": [], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nCalculating upgrade...\nThe following packages have been kept back:\n  passwd\n0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Calculating upgrade...", "The following packages have been kept back:", "  passwd", "0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded."]}

PLAY RECAP ******************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

root@d0ce3181cfee:/# apt-mark showhold
passwd
tar
root@d0ce3181cfee:/# dpkg -l |grep passwd
ii  base-passwd                 3.5.52build1                            amd64        Debian base system master password and group files
hi  passwd                      1:4.8.1-2ubuntu2.1                      amd64        change and administer password and group data

@Akasurde Akasurde added the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 6, 2024
@joshuaboniface
Copy link
Author

It's probably fine to close then, this was so long ago and with such an ancient Ansible version I'm not even sure it affects us anymore.

@Akasurde Akasurde removed needs_info This issue requires further information. Please answer any outstanding questions. needs_verified This issue needs to be verified/reproduced by maintainer labels Mar 6, 2024
@Akasurde
Copy link
Member

Akasurde commented Mar 6, 2024

@joshuaboniface Thanks for providing this additional information. Please feel free to open a new issue if the problem persists. Thanks.

@Akasurde Akasurde self-assigned this Mar 6, 2024
@ansible ansible locked and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

4 participants