add option for excludes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-02-22 21:26:42 +01:00
parent 262968f944
commit 7bd4c50f8e
3 changed files with 20 additions and 4 deletions

2
defaults/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
update_packages_exclude: []

View File

@ -1,7 +1,20 @@
---
- name: Upgrade packages
apt:
update_cache: yes
upgrade: dist
- block:
- name: Add package lock
dpkg_selections:
name: python
selection: hold
loop: "{{ update_packages_exclude }}"
- name: Upgrade packages
apt:
update_cache: yes
upgrade: dist
- name: Remove package lock
dpkg_selections:
name: python
selection: install
loop: "{{ update_packages_exclude }}"
become: True
become_user: root

View File

@ -3,5 +3,6 @@
yum:
name: "*"
state: latest
exclude: "{{ update_packages_exclude }}"
become: True
become_user: root