浏览代码

Choosing the closest ubuntu mirror before anything else

Aleksandr Bogdanov 10 年前
父节点
当前提交
a849948e8d
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 3
    0
      roles/common/tasks/main.yml
  2. 5
    0
      roles/common/templates/apt_sources.list.j2

+ 3
- 0
roles/common/tasks/main.yml 查看文件

@@ -1,5 +1,8 @@
1 1
 ---
2 2
 # Defines tasks applicable across all machines in the infrastructure.
3
+- name: Set up closest mirror autoselect (ubuntu-only)
4
+  template: src=apt_sources.list.j2 dest=/etc/apt/sources.list
5
+  when: ansible_distribution == 'Ubuntu'
3 6
 
4 7
 - name: Update apt cache
5 8
   apt: update_cache=yes

+ 5
- 0
roles/common/templates/apt_sources.list.j2 查看文件

@@ -0,0 +1,5 @@
1
+# This file is generated by Sovereign
2
+deb mirror://mirrors.ubuntu.com/mirrors.txt {{ ansible_distribution_release }} main restricted universe multiverse
3
+deb mirror://mirrors.ubuntu.com/mirrors.txt {{ ansible_distribution_release }}-updates main restricted universe multiverse
4
+deb mirror://mirrors.ubuntu.com/mirrors.txt {{ ansible_distribution_release }}-backports main restricted universe multiverse
5
+deb mirror://mirrors.ubuntu.com/mirrors.txt {{ ansible_distribution_release }}-security main restricted universe multiverse

正在加载...
取消
保存