diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml
index 53c1d9cfc3..a7bb3d0a36 100644
--- a/ansible/roles/keystone/tasks/config.yml
+++ b/ansible/roles/keystone/tasks/config.yml
@@ -200,6 +200,7 @@
     -n {{ (groups['keystone'] | length) }}
   changed_when: false
   register: cron_jobs_json
+  connection: local
   delegate_to: localhost
 
 - name: Set fact with the generated cron jobs for building the crontab later
diff --git a/releasenotes/notes/bug-2004224-0e600c99f8e5b83f.yaml b/releasenotes/notes/bug-2004224-0e600c99f8e5b83f.yaml
new file mode 100644
index 0000000000..16fee5a895
--- /dev/null
+++ b/releasenotes/notes/bug-2004224-0e600c99f8e5b83f.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Fixes keystone's task which is connecting via ssh instead
+    locally.
+    `LP#2004224 <https://launchpad.net/bugs/2004224>`__