Skip to content

Commit

Permalink
Add an inherit_timezone role to copy timezone from host
Browse files Browse the repository at this point in the history
  • Loading branch information
wbclark authored and ekohl committed Sep 2, 2022
1 parent d6e3556 commit 12c6385
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions roles/inherit_timezone/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: "Obtain Timezone from host machine"
ansible.builtin.command: timedatectl show --property=Timezone --value
delegate_to: localhost
register: localhost_timezone

- name: "Set Timezone on guest machine"
community.general.timezone:
name: "{{ localhost_timezone.stdout }}"

0 comments on commit 12c6385

Please sign in to comment.