From 8e55b6e09e708fe4c9d7361bf710c8c06c00abd4 Mon Sep 17 00:00:00 2001 From: rubenb Date: Fri, 27 Oct 2023 13:45:02 +0200 Subject: [PATCH] playbook and rol tzdata --- linux-config-tzdata.yaml | 12 ++++++++++++ roles/config-tzdata/tasks/main.yaml | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 linux-config-tzdata.yaml create mode 100644 roles/config-tzdata/tasks/main.yaml diff --git a/linux-config-tzdata.yaml b/linux-config-tzdata.yaml new file mode 100644 index 0000000..9c6be4d --- /dev/null +++ b/linux-config-tzdata.yaml @@ -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 \ No newline at end of file diff --git a/roles/config-tzdata/tasks/main.yaml b/roles/config-tzdata/tasks/main.yaml new file mode 100644 index 0000000..1227cc2 --- /dev/null +++ b/roles/config-tzdata/tasks/main.yaml @@ -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 \ No newline at end of file