community.general.yum_versionlock (3.8.10) — module

Locks / unlocks a installed package(s) from being updated by yum package manager

| "added in version" 2.0.0 of community.general"

Authors: Florian Paul Azim Hoberg (@gyptazy), Amin Vakil (@aminvakil)

Install collection

Install with ansible-galaxy collection install community.general:==3.8.10


Add to requirements.yml

  collections:
    - name: community.general
      version: 3.8.10

Description

This module adds installed packages to yum versionlock to prevent the package(s) from being updated.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Prevent Apache / httpd from being updated
  community.general.yum_versionlock:
    state: present
    name: httpd
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Prevent multiple packages from being updated
  community.general.yum_versionlock:
    state: present
    name:
    - httpd
    - nginx
    - haproxy
    - curl
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove lock from Apache / httpd to be updated again
  community.general.yum_versionlock:
    state: absent
    package: httpd

Inputs

    
name:
    description:
    - Package name or a list of package names with optional wildcards.
    elements: str
    required: true
    type: list

state:
    choices:
    - absent
    - present
    default: present
    description:
    - If state is C(present), package(s) will be added to yum versionlock list.
    - If state is C(absent), package(s) will be removed from yum versionlock list.
    type: str

Outputs

packages:
  description: A list of package(s) in versionlock list.
  elements: str
  returned: success
  sample:
  - httpd
  type: list
state:
  description: State of package(s).
  returned: success
  sample: present
  type: str