diff --git a/playbook/roles/repository/files/99slapos b/playbook/roles/repository/files/99slapos
new file mode 100644
index 0000000000000000000000000000000000000000..b2459a19a1fe34797661eaeacb28005ac32a1f41
--- /dev/null
+++ b/playbook/roles/repository/files/99slapos
@@ -0,0 +1,4 @@
+# This file was included by ansible and it can be overwriten
+APT::Get::AllowUnauthenticated "true";
+APT::Get::AllowWeakRepositories "true";
+APT::Get::AllowInsecureRepositories "true";
diff --git a/playbook/roles/repository/tasks/debian9_aptconf.yml b/playbook/roles/repository/tasks/debian9_aptconf.yml
new file mode 100644
index 0000000000000000000000000000000000000000..ed276721f2642d70aa93a0a731afba7b60f79817
--- /dev/null
+++ b/playbook/roles/repository/tasks/debian9_aptconf.yml
@@ -0,0 +1,9 @@
+
+  - copy: dest=/etc/apt/apt.conf.d/99slapos src=99slapos
+    when: ansible_distribution == "Debian" and ansible_distribution_major_version == "9"
+ 
+  - name: Update repos for debian 9
+    shell: apt update --allow-insecure-repositories
+    when: ansible_distribution == "Debian" and ansible_distribution_major_version == "9"
+
+
diff --git a/playbook/roles/repository/tasks/main.yml b/playbook/roles/repository/tasks/main.yml
index 014f7ce916c352b7c8f8ff180df4c993cd0701ad..1e26b9c696184a57f153ef4388626e5aa885ad0d 100644
--- a/playbook/roles/repository/tasks/main.yml
+++ b/playbook/roles/repository/tasks/main.yml
@@ -14,9 +14,10 @@
   - file: path=/etc/apt/sources.list.d/re6stnet.list state=absent
     when: ansible_distribution == "Debian"
 
+
   - name: Install Debian 9 repository key
     apt_key: url={{ base_open_build_url }}/Debian_9.0/Release.key state=present
-    when: ansible_distribution == "Debian" and ansible_distribution_major_version == "8"
+    when: ansible_distribution == "Debian" and ansible_distribution_major_version == "9"
 
   - name: Install Debian 8 repository key
     apt_key: url={{ base_open_build_url }}/Debian_8.0/Release.key state=present
@@ -31,8 +32,8 @@
     when: ansible_distribution == "Debian" and ansible_distribution_major_version == "6"
 
   - name: Install Debian 9 repository
-    apt_repository: repo='deb {{ base_open_build_url }}/Debian_9.0/ ./' state=present
-    when: ansible_distribution == "Debian" and ansible_distribution_major_version == "8"
+    apt_repository: repo='deb {{ base_open_build_url }}/Debian_9.0/ ./' state=present update_cache=no
+    when: ansible_distribution == "Debian" and ansible_distribution_major_version == "9"
 
   - name: Install Debian 8 repository
     apt_repository: repo='deb {{ base_open_build_url }}/Debian_8.0/ ./' state=present
@@ -93,3 +94,5 @@
   - name: Install CentOS 6 RPM Key
     rpm_key: state=present key=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_CentOS-6/repodata/repomd.xml.key
     when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "6"
+
+  - include: debian9_aptconf.yml