[stable/2024.1] Add proxy support (#1536)

This is an automated cherry-pick of #1532
/assign mnaser
diff --git a/roles/glance_image/defaults/main.yml b/roles/glance_image/defaults/main.yml
new file mode 100644
index 0000000..d906e1f
--- /dev/null
+++ b/roles/glance_image/defaults/main.yml
@@ -0,0 +1,17 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+glance_image_http_proxy: "{{ http_proxy | default('') }}"
+glance_image_https_proxy: "{{ https_proxy | default('') }}"
+glance_image_no_proxy: "{{ no_proxy | default('') }}"
diff --git a/roles/glance_image/tasks/main.yml b/roles/glance_image/tasks/main.yml
index d71439b..5f56e55 100644
--- a/roles/glance_image/tasks/main.yml
+++ b/roles/glance_image/tasks/main.yml
@@ -42,6 +42,10 @@
       retries: 3
       delay: "{{ 15 | random + 3 }}"
       until: _get_url is not failed
+      environment:
+        http_proxy: "{{ glance_image_http_proxy }}"
+        https_proxy: "{{ glance_image_https_proxy }}"
+        no_proxy: "{{ glance_image_no_proxy }}"
 
     - name: Get image format
       changed_when: false