Each ansible task runs under it's own connection, so setting TMP in
one will not be inherited by the others.
try this:
- hosts: webservers
vars:
tmpfile: /tmp/security.sources.list
tasks:
- name: update apt Cache
apt: update_cache=true
sudo: yes
- name: grep security sources
command: grep security /etc/apt/sources.list > {{tmpfile}}
- name: run upgrade
command: apt-get upgrade -oDir::Etc::Sourcelist={{tmpfile}} "$@"
sudo: yes
- name: Remove TMP File
file: path={{tmpfile}} state=absent
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kVcCfegmPH-BDU0n6%3Dj5uzw4hJqa-t%3DUeXqARQGJKS5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.