Commit 02f7f77a authored by nanahira's avatar nanahira

update sources.list

parent 40f1c091
......@@ -52,36 +52,24 @@
mirror_ubuntu: http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu_security: http://mirrors.tuna.tsinghua.edu.cn
when: china_mirror
- name: set facts for not upgrade
- name: keep old distribution
set_fact:
target_distribution: '{{ ansible_distribution_release }}'
when: not upgrade and ansible_distribution_release != 'sid'
- name: set facts for Ubuntu upgrade
when: not upgrade or ansible_distribution_release == 'sid'
- name: move to focal
set_fact:
target_distribution: 'focal'
when: upgrade and ansible_distribution == 'Ubuntu'
- name: set facts for Debian upgrade
when: ansible_distribution == 'Ubuntu' and upgrade
- name: move to buster
set_fact:
target_distribution: 'buster'
when: (upgrade or ansible_distribution_release == 'sid') and ansible_distribution == 'Debian'
- name: 系统源 (Debian)
when: ansible_distribution == 'Debian' and upgrade and ansible_distribution_release != 'sid'
- name: 系统源 (apt)
become: true
copy:
content: |
deb {{mirror_debian}}/debian {{ target_distribution }} main contrib non-free
deb {{mirror_debian}}/debian {{ target_distribution }}-updates main contrib non-free
deb {{mirror_debian_security}}/debian-security {{ target_distribution }}/updates main contrib non-free
template:
src: sources.list.j2
dest: /etc/apt/sources.list
when: ansible_distribution == 'Debian'
- name: 系统源 (Ubuntu)
become: true
copy:
content: |
deb {{mirror_ubuntu}}/ubuntu/ {{ target_distribution }} main restricted universe multiverse
deb {{mirror_ubuntu_security}}/ubuntu/ {{ target_distribution }}-security main restricted universe multiverse
deb {{mirror_ubuntu}}/ubuntu/ {{ target_distribution }}-updates main restricted universe multiverse
dest: /etc/apt/sources.list
when: ansible_distribution == 'Ubuntu'
when: ansible_os_family == 'Debian'
- name: clean some Debian packages
become: true
apt:
......
{% if ansible_distribution == 'Ubuntu' %}
deb {{mirror_ubuntu}}/ubuntu/ {{ target_distribution }} main restricted universe multiverse
deb {{mirror_ubuntu_security}}/ubuntu/ {{ target_distribution }}-security main restricted universe multiverse
deb {{mirror_ubuntu}}/ubuntu/ {{ target_distribution }}-updates main restricted universe multiverse
{% else %}
deb {{mirror_debian}}/debian {{ target_distribution }} main contrib non-free
{% if target_distribution != 'sid' %}
deb {{mirror_debian}}/debian {{ target_distribution }}-updates main contrib non-free
deb {{mirror_debian_security}}/debian-security {{ target_distribution }}/updates main contrib non-free
{% else %}
deb {{mirror_debian}}/debian experimantal main contrib non-free
{% endif %}
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment