gzipped and base64 encoded user-data leads to failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Issue is here as well: https:/
In /var/log/
2020-06-18 12:16:59,413 - __init_
I can even pull the file from the created VM and it can be extracted and shows to be proper formatting and everything:
curl -L http://
Content-Type: multipart/mixed; boundary=
MIME-Version: 1.0
--MIMEBOUNDARY
Content-
Content-Type: text/cloud-config
Mime-Version: 1.0
#cloud-config
# set locale
locale: en_GB.UTF-8
# ensure time sync between all nodes
ntp:
enabled: true
ntp_client: chrony
# hides ssh keys in console
ssh_fp_
ssh_key_
# upgrade all packages and install necessary ones
package_upgrade: true
package_
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-
- build-essential
- libssl-dev
- make
# set random root password and disable password login for ssh
chpasswd:
expire: false
list: |
root:RANDOM
ssh_pwauth: no
# create sre user with sudo privs and set autrhorized key
users:
- name: sre
groups: sudo
lock_passwd: true
ssh_authorize
- censored
sudo: ['ALL=(ALL) NOPASSWD:ALL']
shell: /bin/bash
--MIMEBOUNDARY
Content-
Content-Type: text/cloud-config
Mime-Version: 1.0
#cloud-config
# Configure Floating IP (Ubuntu 20.04 LTS)
# Not required when using https:/
#write_files:
# - content: |
# network:
# version: 2
# ethernets:
# eth0:
# addresses:
# - ${floating_ip}/32
# path: /etc/netplan/
# Install Keepalived
runcmd:
- cd /root/
- wget http://
- tar xvf keepalived-
- cd keepalived-2.1.2
- ./configure
- make
- sudo make install
final_message: "The system is finally up, after $UPTIME seconds"
When I use the exact same userdata as above but extracted and passed as plain text it works without issue.
Changed in cloud-init: | |
status: | Incomplete → Fix Committed |
Thank you for taking the time to file a bug on cloud-init.
Is there a reason you base64 encoded the content? Was their documentation
to lead you to believe you should? Some clouds (ec2) require the user of
the API to base64 user-data when posted to their API.
Cloud-init should correctly treat the user-data on Hetzner cloud as binary
content and uncompress it if it is gzipped data. You should not need to
base64 encode it.
If you need to make it some text-friendly format, you could try one of the archive and mime
other formats described in [1]. Both cloud-config-
multipart are text friendly formats.
[1] https:/ /cloudinit. readthedocs. io/en/latest/ topics/ format. html?highlight= include% 20file# id2
If you think I've mis-diagnosed this, please feel free to put more
information in and set the Status back to New.