Browse Source

Choosing the closest ubuntu mirror before anything else

Aleksandr Bogdanov 10 years ago
parent
commit
a849948e8d
2 changed files with 8 additions and 0 deletions
  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 View File

@@ -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 View File

@@ -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

Loading…
Cancel
Save