Well, this does make cloud-config-archive support gzipped blobs, so in one way it fixes an issue that was reported. But the problem really seems to be that:
a.) Hetzner only supports (utf8?) strings in their user-data
b.) "terraform modules for templating cloud init hard depend base64 encoding on enabling gzip compression:"
Another option is just to add transparent decompression on the user-data blob that we get from hetzner. The problem with transparent decompression is you can't turn it off...
- self.userdata_raw = ud
+ # Hetzner cloud does not support binary user-data. So try to
+ # transparently compress what we download. The issue with
+ # doing this is that now /var/lib/cloud-init/cloud-config.txt
+ # woudl have *uncompressed* content in it. A user that was
+ # rightfully expecting it to have exactly the user-data they
+ # provided to Hetzner would be broken.
+ self.userdata_raw = util.decomp_gzip(ud, quiet=True, decode=False) self.metadata_full = md
"""hostname is name provided by user at launch. The API enforces
Well, this does make cloud-config- archive support gzipped blobs, so in one way it fixes an issue that was reported. But the problem really seems to be that:
a.) Hetzner only supports (utf8?) strings in their user-data
b.) "terraform modules for templating cloud init hard depend base64 encoding on enabling gzip compression:"
Another option is just to add transparent decompression on the user-data blob that we get from hetzner. The problem with transparent decompression is you can't turn it off...
That change would look like this:
--- a/cloudinit/ sources/ DataSourceHetzn er.py sources/ DataSourceHetzn er.py er(sources. DataSource) :
self. userdata_ address, timeout= self.timeout,
sec_ between= self.wait_ retry, retries= self.retries)
+++ b/cloudinit/
@@ -59,7 +59,13 @@ class DataSourceHetzn
- self.userdata_raw = ud cloud-init/ cloud-config. txt gzip(ud, quiet=True, decode=False)
self. metadata_ full = md
+ # Hetzner cloud does not support binary user-data. So try to
+ # transparently compress what we download. The issue with
+ # doing this is that now /var/lib/
+ # woudl have *uncompressed* content in it. A user that was
+ # rightfully expecting it to have exactly the user-data they
+ # provided to Hetzner would be broken.
+ self.userdata_raw = util.decomp_