Skip to content

Instantly share code, notes, and snippets.

@mcrosson
Created March 4, 2015 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcrosson/9364a0d0013367c10c0f to your computer and use it in GitHub Desktop.
Save mcrosson/9364a0d0013367c10c0f to your computer and use it in GitHub Desktop.
---
- hosts: ec2
vars:
timestamp: "{{ lookup('pipe', 'date +%Y%m%d\\ %H%M%S') }}"
roles:
- include: includes/common_roles.yml
pre_tasks:
- local_action:
module: ec2_snapshot
region: "{{ ec2_region }}"
instance_id: "{{ ec2_id }}"
device_name: "{{ ec2_root_device_name }}"
description: "ansible run on {{ timestamp }}"
tasks:
- debug: msg="ansible run on {{ timestamp }}"
- debug: msg="System {{ inventory_hostname }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment