censof / ansible-financio

Ansible playbook to install financio
MIT License
1 stars 0 forks source link

Use the timezone module from ansible-2.2x #9

Open lowks opened 7 years ago

lowks commented 7 years ago

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"

From here: https://github.com/ansible/ansible/issues/4357#issuecomment-42447657