base: Manage /etc/apt/sources.list
authornicoo <nicoo@realraum.at>
Fri, 7 Feb 2020 12:25:19 +0000 (13:25 +0100)
committernicoo <nicoo@realraum.at>
Fri, 7 Feb 2020 12:25:19 +0000 (13:25 +0100)
ansible/group_vars/all/main.yml
ansible/host_vars/vex/main.yml
ansible/roles/base/tasks/02debian.yml
ansible/roles/base/templates/sources.list.j2 [new file with mode: 0644]

index 2d6e172..43d9b42 100644 (file)
@@ -12,3 +12,7 @@ root_password: "{{ vault_root_password }}"
 ## SSH keys for root, default to NOC's
 
 ssh_users_root: "{{ user_groups.noc }}"
+
+base_debian_mirrors:
+  - https://deb.realraum.at
+  - https://debian.ffgraz.net
index d75df90..31b335a 100644 (file)
@@ -4,3 +4,7 @@ sshd_allowusers_host:
   - www
   - www-data
   - acme
+
+base_debian_mirrors:
+  - https://debian.ffgraz.net
+  - https://deb.realraum.at
index 7aef268..dbeefeb 100644 (file)
@@ -5,6 +5,17 @@
     dest: /etc/apt/apt.conf.d/
     mode: 0644
 
+- name: Install apt-transport-https
+  apt:
+    name: apt-transport-https
+    state: present
+
+- name: Template sources.list
+  template:
+    dest: /etc/apt/sources.list
+    src: sources.list.j2
+    mode: 0644
+
 - name: install basic packages
   apt:
     name:
diff --git a/ansible/roles/base/templates/sources.list.j2 b/ansible/roles/base/templates/sources.list.j2
new file mode 100644 (file)
index 0000000..5c6b8cc
--- /dev/null
@@ -0,0 +1,17 @@
+{% macro deb(path, suite) -%}
+{% for type in ['deb', 'deb-src'] %}
+{% for mirror in base_debian_mirrors %}
+{{ type }}     {{ mirror }}/{{ path }} main
+{% endfor %}
+{% endfor %}
+{%- endmacro %}
+{{ ansible_managed | comment }}
+
+# Main Debian archive
+{{ deb('debian', ansible_distribution_release) }}
+
+# Security updates
+{{ deb('debian-security', ansible_distribution_release + '/updates') }}
+
+# {{ ansible_distribution_release }}-updates, previously known as 'volatile'
+{{ deb('debian', ansible_distribution_release + '-updates') }}