Hi there,

I´m starting learning ansible and I can say I´m getting addicted! Great 
Software!

May one look at my first try for a playbook and tell me if this is the way 
to go:

Given is following bash code to run only security upgrades on a linux box

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 $TMP


Thanks for your advise!

- Anatol

-- 
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/f1c7e3d7-efb0-4161-be3d-f7df0007a468%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to