[ansible-project] Re: How to use vars to work with to_datetime

2019-05-19 Thread Dan Linder
You're using the "debug:" module to set the "msg" variable so the date value isn't in the "{{ msg }}" variable, rather it's in the "{{ msg.msg }}" variable. Try these lines in stead: - name: FIXED - age of file in days stored in msg set_fact: msg: "{{ (ansible_date_time.epoch|int -

[ansible-project] Re: How to use vars to work with to_datetime

2019-05-02 Thread Andy Magana
So I have resolved my issue thanks to others advice what worked is to 1. stat the file get its mtime and 2. register and 3. assign it to a variable and the same for the current date and 4. put both variables and include to convert them to an INT into a jinja subtraction arithmetic and divide