diff --git a/ansible/group_vars/all/proxy b/ansible/group_vars/all/proxy
index ef1f8963585bc9a0cb3d917f5e8b053e68b6e261..eb791bbefa1589064793753f538dca49c822e944 100644
--- a/ansible/group_vars/all/proxy
+++ b/ansible/group_vars/all/proxy
@@ -11,9 +11,11 @@ http_proxy: ""
 https_proxy: ""
 
 # List of domains, hostnames, IP addresses and networks for which no proxy is
-# used. Defaults to ["127.0.0.1", "localhost", "{{ docker_registry }}"]. This
-# is configured only if either http_proxy or https_proxy is set.
+# used. Defaults to ["127.0.0.1", "localhost", "{{ ('http://' ~
+# docker_registry) | urlsplit('hostname') }}"] if docker_registry is set, or
+# ["127.0.0.1", "localhost"] otherwise. This is configured only if either
+# http_proxy or https_proxy is set.
 no_proxy:
   - "127.0.0.1"
   - "localhost"
-  - "{{ docker_registry }}"
+  - "{{ ('http://' ~ docker_registry) | urlsplit('hostname') if docker_registry else '' }}"
diff --git a/ansible/proxy.yml b/ansible/proxy.yml
index 14c7b72c2a50edfcedf18d9d97b8d40142a07156..e618b9c0d5e0f9724fb613491f161fe44f806413 100644
--- a/ansible/proxy.yml
+++ b/ansible/proxy.yml
@@ -1,5 +1,5 @@
 - name: Configure HTTP(S) proxy settings
-  hosts: seed-hypervisor:seed:overcloud
+  hosts: seed-hypervisor:seed:overcloud:infra-vms
   vars:
     ansible_python_interpreter: /usr/bin/python3
   tags:
@@ -14,7 +14,7 @@
         regexp: "^http_proxy=.*"
         line: "http_proxy={{ http_proxy }}"
       become: True
-      when: http_proxy is defined and http_proxy | length > 0
+      when: http_proxy | length > 0
 
     - name: Add HTTPS proxy configuration to /etc/environment
       lineinfile:
@@ -25,7 +25,7 @@
         regexp: "^https_proxy=.*"
         line: "https_proxy={{ https_proxy }}"
       become: True
-      when: https_proxy is defined and https_proxy | length > 0
+      when: https_proxy | length > 0
 
     - name: Add no_proxy configuration to /etc/environment
       lineinfile:
@@ -38,4 +38,4 @@
       become: True
       when:
         - no_proxy | length > 0
-        - http_proxy is defined and http_proxy | length > 0 or https_proxy is defined and https_proxy | length > 0
+        - http_proxy | length > 0 or https_proxy | length > 0
diff --git a/etc/kayobe/proxy.yml b/etc/kayobe/proxy.yml
index 7d63017d6616ba08ff4275405f854a185a1c753b..714b9dae5c929b70d69fe6e98e4be95740404302 100644
--- a/etc/kayobe/proxy.yml
+++ b/etc/kayobe/proxy.yml
@@ -11,8 +11,10 @@
 #https_proxy:
 
 # List of domains, hostnames, IP addresses and networks for which no proxy is
-# used. Defaults to ["127.0.0.1", "localhost", "{{ docker_registry }}"]. This
-# is configured only if either http_proxy or https_proxy is set.
+# used. Defaults to ["127.0.0.1", "localhost", "{{ ('http://' ~
+# docker_registry) | urlsplit('hostname') }}"] if docker_registry is set, or
+# ["127.0.0.1", "localhost"] otherwise. This is configured only if either
+# http_proxy or https_proxy is set.
 #no_proxy:
 
 ###############################################################################