diff --git a/apt/tasks/basics.deb822.yml b/apt/tasks/basics.deb822.yml index 0a342e61..b99a8af4 100644 --- a/apt/tasks/basics.deb822.yml +++ b/apt/tasks/basics.deb822.yml @@ -20,6 +20,22 @@ tags: - apt +- name: Find one-line APT sources + ansible.builtin.find: + paths: /etc/apt + patterns: '*.list' + register: list_files + +- name: Disable one-line-formatted sources + command: "mv --verbose {{ item.path }} {{ item.path }}.bak" + environment: + LC_ALL: C + loop: "{{ list_files.files }}" + register: rename_cmd + changed_when: "'renamed' in rename_cmd.stdout" + tags: + - apt + - name: Apt update apt: update_cache: yes diff --git a/apt/tasks/config.yml b/apt/tasks/config.yml index 7befa375..62155623 100644 --- a/apt/tasks/config.yml +++ b/apt/tasks/config.yml @@ -12,9 +12,9 @@ - { line: "APT::Install-Recommends \"false\";", regexp: 'APT::Install-Recommends' } - { line: "APT::Install-Suggests \"false\";", regexp: 'APT::Install-Suggests' } - { line: "APT::Periodic::Enable \"0\";", regexp: 'APT::Periodic::Enable' } - when: apt_evolinux_config | bool tags: - apt + when: apt_evolinux_config | bool - name: DPkg invoke hooks lineinfile: @@ -28,14 +28,14 @@ - "DPkg::Pre-Invoke { \"df /usr | grep -q /usr && mount -oremount,rw /usr || true\"; };" - "DPkg::Post-Invoke { \"df /tmp | grep -q /tmp && mount -oremount /tmp || true\"; };" - "DPkg::Post-Invoke { \"df /usr | grep -q /usr && mount -oremount /usr || true\"; };" - when: apt_hooks | bool tags: - apt + when: apt_hooks | bool - name: Remove Aptitude apt: name: aptitude state: absent - when: apt_remove_aptitude | bool tags: - apt + when: apt_remove_aptitude | bool diff --git a/apt/tasks/main.yml b/apt/tasks/main.yml index 3459b1b5..b72acb63 100644 --- a/apt/tasks/main.yml +++ b/apt/tasks/main.yml @@ -3,7 +3,7 @@ - name: "Compatibility check" assert: that: - - ansible_distribution = "Debian" + - ansible_distribution == "Debian" - ansible_distribution_major_version is version('8', '>=') msg: Only compatible with Debian >= 8 tags: @@ -17,7 +17,7 @@ - apt when: ansible_distribution_major_version is version('10', '<') -- name: "certificates are installed to https repositories" +- name: "certificates are installed for https repositories" apt: name: - ca-certificates @@ -25,13 +25,13 @@ - apt - name: Custom configuration - include: config.yml + import_tasks: config.yml when: apt_config | bool tags: - apt - name: Install basics repositories (Debian <12) - include: basics.debian-lt-12.yml + import_tasks: basics.oneline.yml tags: - apt when: @@ -39,7 +39,7 @@ - ansible_distribution_major_version is version('12', '<') - name: Install basics repositories (Debian >=12) - include: basics.debian-ge-12.yml + import_tasks: basics.deb822.yml tags: - apt when: @@ -48,7 +48,7 @@ - name: Install backports repositories (Debian <12) - include: backports.debian-lt-12.yml + import_tasks: backports.oneline.yml tags: - apt when: @@ -56,7 +56,7 @@ - ansible_distribution_major_version is version('12', '<') - name: Install backports repositories (Debian >=12) - include: backports.debian-ge-12.yml + import_tasks: backports.deb822.yml tags: - apt when: @@ -65,7 +65,7 @@ - name: Install Evolix Public repositories (Debian <12) - include: evolix_public.debian-lt-12.yml + import_tasks: evolix_public.oneline.yml tags: - apt when: @@ -73,7 +73,7 @@ - ansible_distribution_major_version is version('12', '<') - name: Install Evolix Public repositories (Debian >=12) - include: evolix_public.debian-ge-12.yml + import_tasks: evolix_public.deb822.yml tags: - apt when: @@ -97,7 +97,7 @@ - name: Install check for packages marked hold - include: hold_packages.yml + import_tasks: hold_packages.yml when: apt_install_hold_packages | bool tags: - apt diff --git a/apt/templates/bookworm_backports.sources.j2 b/apt/templates/bookworm_backports.sources.j2 index 20a505a3..5b1b99d1 100644 --- a/apt/templates/bookworm_backports.sources.j2 +++ b/apt/templates/bookworm_backports.sources.j2 @@ -1,7 +1,7 @@ # {{ ansible_managed }} Types: deb -URIs: https://mirror.evolix.org/debian +URIs: http://mirror.evolix.org/debian Suites: bullseye-backports Components: {{ apt_backports_components | mandatory }} Enabled: yes diff --git a/apt/templates/bookworm_basics.sources.j2 b/apt/templates/bookworm_basics.sources.j2 index fbc3034a..247d7ec3 100644 --- a/apt/templates/bookworm_basics.sources.j2 +++ b/apt/templates/bookworm_basics.sources.j2 @@ -1,9 +1,7 @@ # {{ ansible_managed }} Types: deb -URIs: https://mirror.evolix.org/debian +URIs: http://mirror.evolix.org/debian Suites: bookworm bookworm-updates Components: {{ apt_basics_components | mandatory }} -Enabled: yes - -deb http://security.debian.org/debian-security bookworm-security {{ apt_basics_components | mandatory }} +Enabled: yes \ No newline at end of file diff --git a/apt/templates/evolix_public.sources.j2 b/apt/templates/evolix_public.sources.j2 new file mode 100644 index 00000000..defd1282 --- /dev/null +++ b/apt/templates/evolix_public.sources.j2 @@ -0,0 +1,8 @@ +# {{ ansible_managed }} + +Types:deb +URIs: http://pub.evolix.org/evolix +Suites: {{ ansible_distribution_release }} +Components: main +Signed-by: {{ apt_keyring_dir }}/pub_evolix.asc +Enabled: yes