Need yesterday's date in a playbook

I have a need to run a playbook using yesterday’s date as a variable in the playbook…

I had a thought to have two scheduled jobs…one to set a fact with the date the job is running, then use that on the next scheduled job, but I’m not entirely sure if that’s the best way when really I just need to have a way to find yesterday’s date in an ansible playbook.

first off this Google Group is about discussing AWX/Tower - not Ansible.

having said that - how about using the shell module to run the date command and registering the output?

  • name: Get timestamp from the system
    shell: “date --date=‘1 days ago’”
    register: tstamp

might need to change the command a bit to get the kind of date format you need. for wherever you’ll use it.

Thanks Patrick,

I apologize for hijacking the group, but appreciate the pointers.

Regards,

Kaleb