There is a timezone module introduced in Ansible-2.2.x: https://docs.ansible.com/ansible/timezone_module.html can replace the timezone call we did manually.
Since this only will work with 2.2.x, one way to ensure that the playbook is only run with 2.2.x is by doing this:
- hosts: all
tasks:
- name: Get current Ansible version on local host
local_action: command ansible --version
register: local_ansible_version
- assert:
that:
- "'1.5.4' in local_ansible_version.stdout"
There is a timezone module introduced in Ansible-2.2.x: https://docs.ansible.com/ansible/timezone_module.html can replace the timezone call we did manually. Since this only will work with
2.2.x
, one way to ensure that the playbook is only run with2.2.x
is by doing this:From here: https://github.com/ansible/ansible/issues/4357#issuecomment-42447657