gyptazy

DevOps

Developer

IT Consultant

gyptazy

DevOps

Developer

IT Consultant

Blog Post

Ansible: New Module yum_versionlock

2021-12-21 Ansible, Coding
Ansible: New Module yum_versionlock

Ansible upstream has now integrated my new module yum_versionlock.

yum_versionlock allows you to lock or unlock a single or multiple packages from being updated by YUM and to keep a specific version installed on your target systems. This comes handy when you need to pin a specific version of a YUM or DNF package.

Example usage:

- name: Prevent Apache / httpd from being updated
  community.general.yum_versionlock:
    state: present
    name: httpd

- name: Prevent multiple packages from being updated
  community.general.yum_versionlock:
    state: present
    name:
    - httpd
    - nginx
    - haproxy
    - curl

- name: Remove lock from Apache / httpd to be updated again
  community.general.yum_versionlock:
    state: absent
    package: httpd

GitHub: initial upload of yum_versionlock #41778
Documentation: Ansible documentation (official)