Script - Setting Timezone

To update a server’s (or server group) timezone add this to a yml script file.

---
- hosts: linuxservers proxmoxservers
remote_user: ansible
become: yes
tasks:
    - name: 'Set timezone to Buenos Aires'
    timezone:
        name: America/Argentina/Buenos_Aires
    - name: Ansible date fact example
    debug:
        msg="{{ lookup('pipe','date +%Y-%m-%d-%H-%M-%S')}}"

And execute it on the console

$ ansible-playbook timezone.yml -K