playbook and rol tzdata

This commit is contained in:
Ruben Blanco 2023-10-27 13:45:02 +02:00
parent d298c8ac97
commit 8e55b6e09e
2 changed files with 32 additions and 0 deletions

12
linux-config-tzdata.yaml Normal file
View File

@ -0,0 +1,12 @@
---
- hosts: "{{ ip_addr }}"
become: yes
become_method: sudo
gather_facts: yes
tasks:
- name: "[CONFIG TZDATA] Set timezone"
import_role:
name: config-tzdata

View File

@ -0,0 +1,20 @@
---
- name: Set the timezone for tzdata package
debconf:
name: tzdata
question: "tzdata/Areas"
vtype: select
value: "Europe" # Replace with the desired region, e.g., "America,Europe.."
state: present
- name: Set the city for tzdata package
debconf:
name: tzdata
question: "tzdata/Zones/Europe"
vtype: select
value: "Madrid" # Replace with the desired city/timezone
state: present
- name: Run dpkg-reconfigure to apply the timezone changes
command: dpkg-reconfigure -f noninteractive tzdata