diff --git a/ansible/roles/ssh_host_keys/tasks/main.yml b/ansible/roles/ssh_host_keys/tasks/main.yml
index fa398387ce8a4e20cd8ee72e5766edd33930eceb..59beb02b2d41a98c84683d901ce14c2155faf9f0 100644
--- a/ansible/roles/ssh_host_keys/tasks/main.yml
+++ b/ansible/roles/ssh_host_keys/tasks/main.yml
@@ -22,6 +22,7 @@
     aws_secret_key: "{{ LTS_SECRET_KEY }}"
   vars:
     ansible_python_interpreter: /usr/bin/python3
+  when: SSH_HOST_KEYS_S3_BUCKET | length > 0 and SSH_HOST_KEYS_S3_OBJECT | length > 0
 
 - name: Unpack SSH host keys to /etc/ssh
   ansible.builtin.unarchive:
@@ -31,6 +32,7 @@
     owner: root
     remote_src: yes
   become: true
+  when: SSH_HOST_KEYS_S3_BUCKET | length > 0 and SSH_HOST_KEYS_S3_OBJECT | length > 0
 
 - name: Remove the temporary folder after put in place
   ansible.builtin.file: