TMP=/tmp/security.sources.list
grep security /etc/apt/sources.list > $TMP
apt-get upgrade -oDir::Etc::Sourcelist=$TMP "$@"
rm $TMP
Which I would transfer into a playbook like this:
---
- hosts: webservers
tasks:
- name: update apt Cache
apt: update_cache=true
sudo: yes
- name: Set TMP var
command: TMP=/tmp/security.sources.list
- name: grep security sources
command: grep security /etc/apt/sources.list > $TMP
- name: run upgrade
command: apt-get upgrade -oDir::Etc::Sourcelist=$TMP "$@"
sudo: yes
- name: Remove TMP File
command: rm $TMPThanks for your advise!
- Anatol