Allow to configure image_size_cap

via the same-named pillar:

  glance:
    server:
      image_size_cap: 2199023255552 # 2TB, twice current default

Related-Issue: PROD-35338
Change-Id: I7722d737466b1cb8550b4a5281776492df43ba37
diff --git a/README.rst b/README.rst
index f15bff7..3db3493 100644
--- a/README.rst
+++ b/README.rst
@@ -184,6 +184,15 @@
           user_storage: 0
         ....
 
+Maximum size of image
+
+.. code-block:: yaml
+
+    glance:
+      server:
+        ....
+        image_size_cap: 2199023255552 # 2TB, twice current default
+
 Configuring TLS communications
 ------------------------------
 
diff --git a/glance/files/pike/glance-api.conf.Debian b/glance/files/pike/glance-api.conf.Debian
index 8689e9e..de401a1 100644
--- a/glance/files/pike/glance-api.conf.Debian
+++ b/glance/files/pike/glance-api.conf.Debian
@@ -385,6 +385,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/pike/glance-cache.conf.Debian b/glance/files/pike/glance-cache.conf.Debian
index 045fdaa..90fb4a2 100644
--- a/glance/files/pike/glance-cache.conf.Debian
+++ b/glance/files/pike/glance-cache.conf.Debian
@@ -257,6 +257,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/pike/glance-registry.conf.Debian b/glance/files/pike/glance-registry.conf.Debian
index 9657420..5bab699 100644
--- a/glance/files/pike/glance-registry.conf.Debian
+++ b/glance/files/pike/glance-registry.conf.Debian
@@ -341,6 +341,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/pike/glance-scrubber.conf.Debian b/glance/files/pike/glance-scrubber.conf.Debian
index 712e0d1..5b8b197 100644
--- a/glance/files/pike/glance-scrubber.conf.Debian
+++ b/glance/files/pike/glance-scrubber.conf.Debian
@@ -257,6 +257,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/queens/glance-api.conf.Debian b/glance/files/queens/glance-api.conf.Debian
index 1ff03d1..46a627a 100644
--- a/glance/files/queens/glance-api.conf.Debian
+++ b/glance/files/queens/glance-api.conf.Debian
@@ -397,6 +397,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/queens/glance-cache.conf.Debian b/glance/files/queens/glance-cache.conf.Debian
index ffa0ed6..54344dd 100644
--- a/glance/files/queens/glance-cache.conf.Debian
+++ b/glance/files/queens/glance-cache.conf.Debian
@@ -270,6 +270,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/queens/glance-registry.conf.Debian b/glance/files/queens/glance-registry.conf.Debian
index ff0668a..fbb677b 100644
--- a/glance/files/queens/glance-registry.conf.Debian
+++ b/glance/files/queens/glance-registry.conf.Debian
@@ -354,6 +354,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/queens/glance-scrubber.conf.Debian b/glance/files/queens/glance-scrubber.conf.Debian
index 30b5154..69bfb50 100644
--- a/glance/files/queens/glance-scrubber.conf.Debian
+++ b/glance/files/queens/glance-scrubber.conf.Debian
@@ -270,6 +270,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/rocky/glance-api.conf.Debian b/glance/files/rocky/glance-api.conf.Debian
index 67d90c7..6f7a4e8 100644
--- a/glance/files/rocky/glance-api.conf.Debian
+++ b/glance/files/rocky/glance-api.conf.Debian
@@ -445,6 +445,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Deploy the v2 OpenStack Images API.
diff --git a/glance/files/rocky/glance-cache.conf.Debian b/glance/files/rocky/glance-cache.conf.Debian
index d9aae37..156e21f 100644
--- a/glance/files/rocky/glance-cache.conf.Debian
+++ b/glance/files/rocky/glance-cache.conf.Debian
@@ -299,6 +299,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/rocky/glance-registry.conf.Debian b/glance/files/rocky/glance-registry.conf.Debian
index e79696e..5c009b4 100644
--- a/glance/files/rocky/glance-registry.conf.Debian
+++ b/glance/files/rocky/glance-registry.conf.Debian
@@ -388,6 +388,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.
diff --git a/glance/files/rocky/glance-scrubber.conf.Debian b/glance/files/rocky/glance-scrubber.conf.Debian
index 103748c..29a1006 100644
--- a/glance/files/rocky/glance-scrubber.conf.Debian
+++ b/glance/files/rocky/glance-scrubber.conf.Debian
@@ -299,6 +299,9 @@
 # Minimum value: 1
 # Maximum value: 9223372036854775808
 #image_size_cap = 1099511627776
+{%- if server.image_size_cap is defined %}
+image_size_cap = {{ server.image_size_cap }}
+{%- endif %}
 
 #
 # Maximum amount of image storage per tenant.