Skip to content

Instantly share code, notes, and snippets.

@r1w1s1
Forked from halberom/output
Created January 10, 2017 19:07
Show Gist options
  • Save r1w1s1/b5d1aed10e3bf37c37b452b47ca30703 to your computer and use it in GitHub Desktop.
Save r1w1s1/b5d1aed10e3bf37c37b452b47ca30703 to your computer and use it in GitHub Desktop.
ansible - using lookup to get a date timestamp into a variable
...
TASK: [debug var=mydate] ******************************************************
ok: [localhost] => {
"mydate": "20140605101824"
}
...
---
- hosts: all
tasks:
- set_fact: mydate="{{lookup('pipe','date +%Y%m%d%H%M%S')}}"
- debug: var=mydate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment