]> git.phdru.name Git - ansible.git/commitdiff
Feat(debian-init-system): Configure `apt`
authorOleg Broytman <phd@phdru.name>
Mon, 15 Jul 2019 23:25:26 +0000 (02:25 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 16 Jul 2019 18:28:41 +0000 (21:28 +0300)
Setup `/etc/apt/sources.list` from a template.

hosts
playbooks/roles/debian-init-system/README.txt
playbooks/roles/debian-init-system/tasks/main.yml
playbooks/roles/debian-init-system/templates/sources.list [new file with mode: 0644]
vbox-inventory

diff --git a/hosts b/hosts
index 7c5f1851ec4fda5728ace6a02775cecce776158f..0e3f9ed2f2f0778509d20aaa9bd80a55bb657035 100644 (file)
--- a/hosts
+++ b/hosts
@@ -7,4 +7,8 @@ iskra-aviel.phdru.name
 [servers]
 iskra-aviel.phdru.name
 oper.med.ru
-phdru.name
+phdru.name debian_mirror=http://debian.mirror.cambrium.nl/debian
+
+[all:vars]
+debian_distr=stretch
+debian_mirror=http://mirror.yandex.ru/debian
index 57a5b0a002ad61d6f06c1190c62879907121ae30..1f7eced9310be47405659392de3f6d8ecbbb9829 100644 (file)
@@ -1 +1 @@
-Init new Debian system: install minimal list of packages.
+Init new Debian system: configure apt, install minimal list of packages.
index 76a06fe117201189a05fb4327973d68a5fb4fd70..39c1900b0df69c075a80623578879a76e4f9fc11 100644 (file)
@@ -1,3 +1,12 @@
+- name: Configure apt
+  become: true
+  template:
+    src: sources.list
+    dest: /etc/apt/sources.list
+    owner: root
+    group: root
+    mode: '0640'
+
 - name: Install minimal software packages
   become: true
   apt:
     purge: yes
     state: latest
     update_cache: yes
+
+- name: Configure apt key for deb-multimedia
+  become: true
+  apt_key:
+    keyserver: keyserver.ubuntu.com
+    id: 5C808C2B65558117
+  when: "inventory_hostname in ('localhost', 'iskra-aviel.phdru.name')"
diff --git a/playbooks/roles/debian-init-system/templates/sources.list b/playbooks/roles/debian-init-system/templates/sources.list
new file mode 100644 (file)
index 0000000..a235526
--- /dev/null
@@ -0,0 +1,13 @@
+deb {{ debian_mirror }} {{ debian_distr }} main non-free contrib
+deb {{ debian_mirror }} {{ debian_distr }}-updates main non-free contrib
+
+deb {{ debian_mirror }}-security {{ debian_distr }}/updates main non-free contrib
+#deb {{ debian_mirror }} {{ debian_distr }}-backports main non-free contrib
+{% if inventory_hostname in ('localhost', 'iskra-aviel.phdru.name') %}
+
+deb {{ debian_mirror }}-multimedia {{ debian_distr }} main non-free
+#deb {{ debian_mirror }}-multimedia {{ debian_distr }}-backports main non-free
+
+#deb https://deb.opera.com/opera/ stable non-free
+#deb https://download.virtualbox.org/virtualbox/debian {{ debian_distr }} contrib non-free
+{% endif %}
index e52e57968f5dfe5262806de3b62a8539d8e33c38..a478ee186c54a446d9c285cff957f9e853bcc10d 100644 (file)
@@ -1,2 +1,6 @@
 [servers]
-vbox ansible_host=localhost ansible_port=2022
+vbox ansible_host=localhost ansible_port=2022 debian_distr=buster
+
+[all:vars]
+debian_distr=stretch
+debian_mirror=https://mirror.yandex.ru/debian