Ansible date Struggle

19 views
Skip to first unread message

ns27...@gmail.com

unread,
Feb 6, 2017, 9:41:41 AM2/6/17
to Ansible Project
I am new to ansible .

Issue:- 

I created 2 ec2 instances successfully and  i am able to retrieve the launch_dates using below .

- name: launch time and date of Ec2 
  debug:
  var: item.launch_time
 with_items: "{{ ec2_facts.instances }}".

 I am using below to get ansible date and time 

 - name: ansible date 
    debug:
    var:  ansible_date_time.iso8601_micro.date

What i am not able to do is, how do i subtract and get the difference between two date ? (item.launch_time - ansible_date_time.iso8601_micro.date) and store is to a variable or integer .

Any help is appreciated .

Regards,
NS
Reply all
Reply to author
Forward
0 new messages