Skip to content

Commit

Permalink
Add yum versionlock plugin install task (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Jan 10, 2024
1 parent 494a3bf commit 5b598dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 1 addition & 6 deletions tasks/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@

- name: Configure yum package locks
community.general.yum_versionlock:
name: "{{ item.split('=') | first }}"
name: "{{ [docker_packages] | flatten }}"
state: "{{ 'absent' if _lock_state == 'install' else 'present' }}"
vars:
_version_regex: ".*=.*"
_package_versions: "{{ [docker_packages] | flatten | map('regex_search', _version_regex) }}"
_package_holds: "{{ _package_versions | select('string') }}"
loop: "{{ _package_holds }}"
when: ansible_os_family == "RedHat"
changed_when: false
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
when: docker_remove_packages is defined
tags: install

- name: Install package prerequisites for RedHat systems
ansible.builtin.package:
name: yum-plugin-versionlock
state: present
when: ansible_os_family == "RedHat"

- name: Release package holds
ansible.builtin.include_tasks: lock.yml
vars:
Expand Down

0 comments on commit 5b598dc

Please sign in to comment.