diff --git a/files/ssh_config b/files/ssh_config
deleted file mode 100644
index 8177128350e8fb266fc4af7b826a7092930ac729..0000000000000000000000000000000000000000
--- a/files/ssh_config
+++ /dev/null
@@ -1,3 +0,0 @@
-Host sources.le-filament.com
-    IdentityFile ~root/.ssh/id_ed25519.sources
-    IdentitiesOnly yes
diff --git a/tasks/main.yml b/tasks/main.yml
index e9585449e1c8860394f5374a37ca2471c16593c4..e26159f77abe1348490fe9e10c1097e7f89db5a0 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -55,74 +55,74 @@
     test_instance_need_build
     and test_instance_is_selected
 
-- name: Copy private GitLab ssh keys file
-  ansible.builtin.copy:
-    content: "{{ git_modules_privkey | default('') }}"
-    dest: "/home/docker/{{ odoo_instance.key }}/odoo/id_ed25519.sources"
-    owner: root
-    group: root
-    mode: '0400'
+- name: "Create `dot_ssh` dir in Odoo docker build directories on server in /home/docker/<instance>/odoo/dot_ssh"
+  ansible.builtin.file:
+    name: "/home/docker/{{ odoo_instance.key }}/odoo/dot_ssh"
+    state: directory
+    owner: "root"
+    group: "root"
+    mode: "0500"
   loop: "{{ odoo_instances | dict2items }}"
   loop_control:
     label: "{{ odoo_instance.key }}"
   when: >
     test_instance_need_build
     and test_instance_is_selected
-  register: result
-  notify:
-    - "remove intermediate images"
+    and git_ssh_private_keys is defined
 
-# notify:
-#   - "rebuild odoo image"
-#   - "remove ssh private keys"
-- name: "Add instance to rebuild and remove key lists if files was changed"
-  set_fact:
-    instances_to_rebuild: "{{ instances_to_rebuild + [item.item.key] }}"
-    instances_to_remove_key: "{{ instances_to_remove_key + [item.item.key] }}"
-  loop: "{{ result.results | flatten(levels=1) }}"
-  loop_control:
-    label: "{{ item.item.key }}"
-  when: test_result_item_has_changed
-
-- name: Copy ssh config for connecting to LF Gitlab
+- name: "Copy private SSH keys file"
+  tags:
+    - "git_ssh_keys"
+  vars:
+    item: "{{ item_instance_sshkey.0 }}"
   ansible.builtin.copy:
-    src: ssh_config
-    dest: "/home/docker/{{ odoo_instance.key }}/odoo/ssh_config"
+    content: "{{ item_instance_sshkey.1.value.private_key }}"
+    dest: "/home/docker/{{ item_instance_sshkey.0.key }}/odoo/dot_ssh/{{ item_instance_sshkey.1.key }}"
     owner: root
     group: root
-    mode: '0444'
-  loop: "{{ odoo_instances | dict2items }}"
+    mode: '0400'
+  loop: "{{ odoo_instances | dict2items | product(git_ssh_private_keys | dict2items) }}"
   loop_control:
-    label: "{{ odoo_instance.key }}"
+    label: "{{ item_instance_sshkey.0.key }}: SSH key '{{ item_instance_sshkey.1.key }}'"
+    loop_var: item_instance_sshkey
   when: >
     test_instance_need_build
     and test_instance_is_selected
+    and git_ssh_private_keys is defined
   register: result
+  notify:
+    - "remove intermediate images"
 
 # notify:
 #   - "rebuild odoo image"
-- name: "Add instance to rebuild list if files was changed"
+#   - "remove ssh private keys"
+- name: "Add instance to rebuild and remove key lists if files was changed"
   set_fact:
-    instances_to_rebuild: "{{ instances_to_rebuild + [item.item.key] }}"
+    instances_to_rebuild: "{{ instances_to_rebuild + [item.item_instance_sshkey.0.key] }}"
+    instances_to_remove_key: "{{ instances_to_remove_key + [item.item_instance_sshkey.0.key] }}"
   loop: "{{ result.results | flatten(levels=1) }}"
   loop_control:
-    label: "{{ item.item.key }}"
-  when: test_result_item_has_changed
+    label: "{{ item.item_instance_sshkey.0.key }}"
+  when: item.changed
 
-- name: Copy private Git ssh keys file
-  ansible.builtin.copy:
-    content: "{{ git_private_keys }}"
-    dest: "/home/docker/{{ odoo_instance.key }}/odoo/id_rsa"
-    owner: root
-    group: root
-    mode: '0400'
+- name: "Copy ssh config for connecting to git repositories"
+  tags:
+    - "git_ssh_keys"
+  vars:
+    template_git_ssh_private_keys: "{{ git_ssh_private_keys }}"
+  ansible.builtin.template:
+    src: "ssh_config.j2"
+    dest: "/home/docker/{{ odoo_instance.key }}/odoo/dot_ssh/config"
+    owner: "root"
+    group: "root"
+    mode: "0400"
   loop: "{{ odoo_instances | dict2items }}"
   loop_control:
     label: "{{ odoo_instance.key }}"
   when: >
-    git_private_keys is defined
-    and test_instance_need_build
+    test_instance_need_build
     and test_instance_is_selected
+    and git_ssh_private_keys is defined
   register: result
 
 # notify:
@@ -285,7 +285,7 @@
 
 - name: "Remove instances private keys"
   ansible.builtin.file:
-    path: "/home/docker/{{ odoo_instance.key }}/odoo/id_ed25519.sources"
+    path: "/home/docker/{{ odoo_instance.key }}/odoo/dot_ssh"
     state: absent
   loop: "{{ instances_to_remove_key | unique | sort }}"
   when: >
diff --git a/templates/Dockerfile.j2 b/templates/Dockerfile.j2
index 23fead88a45c9cdae3e83a8eaae7eb8f511d80aa..f46824c8645a5b2aa4fa4358de33d5da53d6964a 100644
--- a/templates/Dockerfile.j2
+++ b/templates/Dockerfile.j2
@@ -10,12 +10,7 @@ LABEL stage=builder
 USER root
 
 # Install GitLab private keys
-COPY ./id_ed25519.sources /root/.ssh/
-COPY ./ssh_config /root/.ssh/config
-{% if git_private_keys is defined %}
-# Install private keys
-COPY ./id_rsa /root/.ssh/
-{% endif %}
+COPY ./dot_ssh/* /root/.ssh
 
 # Add addons.
 ARG SAVE_COMMITS_FILENAME='custom_addons'
diff --git a/templates/ssh_config.j2 b/templates/ssh_config.j2
new file mode 100644
index 0000000000000000000000000000000000000000..f2520e0fd440ce83da5e1485d4a5180510fb285c
--- /dev/null
+++ b/templates/ssh_config.j2
@@ -0,0 +1,5 @@
+{% for template_item in (template_git_ssh_private_keys | dict2items) %}
+Host {{ template_item.value.host }}
+    IdentityFile ~root/.ssh/{{ template_item.key }}
+    IdentitiesOnly yes
+{% endfor %}