From eb981284120dc4e28062dcb9cae7d2924b1df5a7 Mon Sep 17 00:00:00 2001 From: Jose Date: Sun, 15 Feb 2026 08:20:04 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20default=20languages?= =?UTF-8?q?=20for=20APT=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds default languages for APT translations by updating the `defaults/main.yml` file and adding new tasks in `tasks/apt.yml` to configure APT translations and force IPv4. Additionally, a task to configure apt has been added. --- defaults/main.yml | 6 ++++++ tasks/apt.yml | 31 +++++++++++++++++++++++++++++++ tasks/main.yml | 3 +++ 3 files changed, 40 insertions(+) create mode 100644 tasks/apt.yml diff --git a/defaults/main.yml b/defaults/main.yml index 390e6ac..4196c5a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,3 +25,9 @@ proxmox_logrotate_notifempty: true # Destination override file proxmox_logrotate_file: /etc/logrotate.d/99-proxmox-custom + +# Default languages for APT translations +proxmox_apt_languages: + - "en" + - "es" + - "it" \ No newline at end of file diff --git a/tasks/apt.yml b/tasks/apt.yml new file mode 100644 index 0000000..03d4d1a --- /dev/null +++ b/tasks/apt.yml @@ -0,0 +1,31 @@ +--- +# ------------------------------------------------- +# Reduce apt translation downloads (use defaults) +# ------------------------------------------------- +- name: Configure APT translations using default languages + ansible.builtin.copy: + dest: /etc/apt/apt.conf.d/99-languages + content: | + Acquire::Languages { + {% for lang in proxmox_apt_languages %} + "{{ lang }}"; + {% endfor %} + }; + owner: root + group: root + mode: '0644' + +# ------------------------------------------------- +# Force APT to use IPv4 +# ------------------------------------------------- +- name: Force APT to use IPv4 + ansible.builtin.copy: + dest: /etc/apt/apt.conf.d/99force-ipv4 + content: 'Acquire::ForceIPv4 "true";' + owner: root + group: root + mode: '0644' + +- name: Update apt cache + ansible.builtin.apt: + update_cache: yes diff --git a/tasks/main.yml b/tasks/main.yml index 02fb3fc..b00e094 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,6 +16,9 @@ # Other tasks # =================== +- name: Configure apt + ansible.builtin.import_tasks: apt.yml + - name: Disable enterprise repo, enable no-subscription ansible.builtin.import_tasks: repos.yml