diff --git a/group_vars/all b/group_vars/all index 44be395..b77d100 100644 --- a/group_vars/all +++ b/group_vars/all @@ -111,3 +111,6 @@ fingerprint: False tor: run_on: trusted + +localtime: + run_on: trusted diff --git a/playbook.yml b/playbook.yml index 8b74779..fcd3740 100644 --- a/playbook.yml +++ b/playbook.yml @@ -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" diff --git a/roles/localtime/tasks/main.yml b/roles/localtime/tasks/main.yml new file mode 100644 index 0000000..64e7389 --- /dev/null +++ b/roles/localtime/tasks/main.yml @@ -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"