autoset timezone via localtime

If you happen to have a VPN in a different timezone that is set as a
trusted network, things may get a little weird.
This commit is contained in:
Pig Monkey 2016-09-03 17:26:39 -07:00
parent e6878d8e08
commit 13fb6f0db4
3 changed files with 29 additions and 0 deletions

View file

@ -111,3 +111,6 @@ fingerprint: False
tor:
run_on: trusted
localtime:
run_on: trusted

View file

@ -58,6 +58,7 @@
- { role: calibre, tags: ['calibre'] }
- { role: aws, tags: ['aws'] }
- { role: parcimonie, tags: ['parcimonie'], when: "tor is defined" }
- { role: localtime, tags: ['localtime'], when: "localtime is defined" }
vars_prompt:
- name: user_password
prompt: "Enter desired user password"

View file

@ -0,0 +1,25 @@
---
- name: Install localtime
aur: name=localtime-git user={{ user.name }}
tags:
- aur
- name: Enable and start localtime
service: name=localtime enabled=yes state=started
when: localtime.run_on == "all"
- name: Remove localtime from trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=absent
line=localtime.service
when: localtime.run_on == "all"
- name: Disable localtime
service: name=localtime enabled=no
when: localtime.run_on == "trusted"
- name: Add localtime to trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=present
line=localtime.service
when: localtime.run_on == "trusted"