From dfd9761f1bb30ef6da155a320fd483f113ac5f6b Mon Sep 17 00:00:00 2001 From: Ronggo Radityo Date: Tue, 7 Sep 2021 17:00:11 +0700 Subject: [PATCH] Gabungkan repo iix dan repo magelang dalam satu roles --- defaults/main.yml | 4 +++- tasks/main.yml | 14 +++++++++++--- .../apt/{sources.list.j2 => sources.list-iix.j2} | 6 +++++- templates/etc/apt/sources.list-mgl.j2 | 4 ++++ 4 files changed, 23 insertions(+), 5 deletions(-) rename templates/etc/apt/{sources.list.j2 => sources.list-iix.j2} (83%) create mode 100644 templates/etc/apt/sources.list-mgl.j2 diff --git a/defaults/main.yml b/defaults/main.yml index c1024fe..3e66e51 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,4 @@ --- -# defaults file for roles/aptsrc \ No newline at end of file +# defaults file for roles/aptsrc +release: bullseye +repo: iix \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 97c7a49..65d9a9a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,16 @@ --- -# tasks file for roles/aptsrc +# tasks file for roles/aptsrc iix - name: Change apt/source.list to repo Indonesia Kartolo template: - src: templates/etc/apt/sources.list.j2 + src: templates/etc/apt/sources.list-iix.j2 dest: /etc/apt/sources.list mode: 0644 - when: ansible_os_family == 'Debian' \ No newline at end of file + when: ansible_os_family == 'Debian' and repo == 'iix' + +# tasks file for roles/aptsrc iix +- name: Change apt/source.list to repo Magelang + template: + src: templates/etc/apt/sources.list-mgl.j2 + dest: /etc/apt/sources.list + mode: 0644 + when: ansible_os_family == 'Debian' and repo == 'magelang' \ No newline at end of file diff --git a/templates/etc/apt/sources.list.j2 b/templates/etc/apt/sources.list-iix.j2 similarity index 83% rename from templates/etc/apt/sources.list.j2 rename to templates/etc/apt/sources.list-iix.j2 index f67c76a..f46be45 100644 --- a/templates/etc/apt/sources.list.j2 +++ b/templates/etc/apt/sources.list-iix.j2 @@ -1,6 +1,10 @@ +{%- if release=="bullseye" %} +deb http://security.debian.org/debian-security {{ release }}-security main contrib non-free +# deb-src http://security.debian.org/debian-security {{ release }}-security main contrib non-free +{% else %} deb http://security.debian.org/debian-security {{ release }}/updates main contrib non-free # deb-src http://security.debian.org/debian-security {{ release }}/updates main contrib non-free - +{% endif %} deb http://kartolo.sby.datautama.net.id/debian/ {{ release }} main non-free contrib deb http://kartolo.sby.datautama.net.id/debian/ {{ release }}-updates main contrib non-free deb http://kartolo.sby.datautama.net.id/debian/ {{ release }}-backports main contrib non-free diff --git a/templates/etc/apt/sources.list-mgl.j2 b/templates/etc/apt/sources.list-mgl.j2 new file mode 100644 index 0000000..c3588de --- /dev/null +++ b/templates/etc/apt/sources.list-mgl.j2 @@ -0,0 +1,4 @@ +deb http://gethuk.magelangkota.go.id/repo/debian {{ release }} main non-free contrib +deb http://gethuk.magelangkota.go.id/repo/debian-security {{ release }}{%- if release=="bullseye" %}-security{% else %}/updates{% endif %} main non-free contrib +deb http://gethuk.magelangkota.go.id/repo/debian {{ release }}-updates main non-free contrib +deb http://gethuk.magelangkota.go.id/repo/debian {{ release }}-backports main non-free contrib