Skip to content

Instantly share code, notes, and snippets.

@OdinsHat
Forked from garethrees/gist:5591027
Created June 29, 2015 08:08
Show Gist options
  • Save OdinsHat/909dd565b145e7947aec to your computer and use it in GitHub Desktop.
Save OdinsHat/909dd565b145e7947aec to your computer and use it in GitHub Desktop.
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
copy: content='Europe/London'
dest=/etc/timezone
owner=root
group=root
mode=0644
backup=yes
notify:
- update timezone
handlers:
- name: update timezone
command: dpkg-reconfigure --frontend noninteractive tzdata
vagrant@us:~$ ll /etc/ | grep timezone
-rw-r--r-- 1 root root 20 May 16 06:27 timezone
-rw-r--r-- 1 root root 20 May 16 06:22 timezone.2013-05-16@06:24~
-rw-r--r-- 1 root root 20 May 16 06:24 timezone.2013-05-16@06:27~
vagrant@us:~$ cat /etc/timezone
America/Los_Angeles
vagrant@us:~$ cat /etc/timezone.2013-05-16@06:24~
America/Los_Angeles
vagrant@us:~$ cat /etc/timezone.2013-05-16@06:27~
America/Los_Angeles
vagrant@us:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment