-
-
Save dshamanthreddy/82c8938aee3f430886b904e404448737 to your computer and use it in GitHub Desktop.
ansible - using lookup to get a date timestamp into a variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
TASK: [debug var=mydate] ****************************************************** | |
ok: [localhost] => { | |
"mydate": "20140605101824" | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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