Hi List,

I'm trying to create a playbook to create ec2 snapshots. That part woks:

---
> - hosts: tag_snapshot_yes
>   gather_facts: true
>   tasks:
>   
>   # Get a list of volume-id's attached to the instance and put that list 
> in 
>   # The variable named vollist
>   - name: List volumes
>     ec2_vol:
>       instance: "{{ ec2_id }}"
>       region: "{{ ec2_region }}"
>       state: list
>     register: vollist
>     delegate_to: localhost 

  # Simple snapshot of volume using volume_id from the vollist variable
>   - name: Create snapshot
>     ec2_snapshot:
>       region: "{{ ec2_region }}"
>       volume_id: "{{ item.id }}"
>       description: "snapshot of {{ item.id }} from {{ ansible_hostname}}"
>       snapshot_tags:
>         Name: "{{ ansible_hostname}}"
>     with_items: vollist.volumes
>     delegate_to: localhost


This part works wonderfully!

But I don't how to even start to manage the deletion of older snapshots.

Does anyone have suggestions? Or am i simply going about it the wrong way 
with Ansible?

Mark

-- 
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/29656210-4aba-436c-a370-e80876d41b9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to