/srv/irclogs.ubuntu.com/2024/03/28/#cloud-init.txt

zathrasI run Debian stable. I do not understand why cloud-init adds certain hostname alternatves as I do not see how this is caused by the debian template. Also cloud-init makes that Postfix sees a hostname and not a fqdn which creates trouble.17:16
zathrasAny pointers regarding docs or how to analyse this?17:16
zathras(My host has many aliases, so why a selection is made and linked to 127.1.0.1 although it has DNS entries puzzles me)17:17
Quarkzathras: clean up your config, and do `cat <your_config> | nc termbin.com 9999` so people can take a look?17:28
zathrasQuark, which config(file) would that be?17:29
zathrascloud.cfg in /etc/cloud?17:30
Quarkzathras: the one you are using for cloud-init (user-data, meta-data, etc.).17:30
zathrasI did not actually install it. It came with the install of Debian when I selected it as OS for my Hetzner VPS. So it has Debian and Hetzner config stuff. Nothing I added, set or changed17:32
zathrasso I am not entirely sure17:32
QuarkOh, I see.17:32
QuarkHmm.17:32
zathrasconf.d hsa 1 debian and 2 Hetzner files17:33
zathrascloud.cfg.d sorry17:33
minimalzathras: as Quark mentioned you'd need to provide details of the configuration used by cloud-init in order for anyone to help20:45
zathrasMost of my troubles seem to originate from the Debian template. However it mentions that manage_etc_hosts is set. Setting it to false will help I assume. However I cannot find it in /etc/cloud but I do find it in /var/lib/cloud/instances/<id>/ in vendor-data.txt vendor-data.txt.1 and vendor-cloud-config.txt20:53
zathrasWill setting this to false help or is it just there for creation and no (re)booting purposes? If so: where should I do that?20:54
zathras*and not20:54
zathrasThe docs say: I should change the setting in /etc/cloud/cloud.cfg or cloud-config from user data. The setting can not be found in the first. And the second? I have no idea where that is.20:57
zathrascould not find something in /root20:57
minimalzathras: what exactly is your "trouble" with the Debian template?21:00
zathrasminimal, sorry for the delay. The Debian template sets /etc/hosts with 127.0.1.1 {{fqdn}} {{hostname}21:58
zathrasThe problem with this is that {{fqdn}} now no longer points to my external IP obviously21:59
zathrasso Postfix complains as it is also configured to use dkim/dmarc and thinks the IP-address is spoofed22:00
zathrasIn its log I get SMTP error 553 5.7.1 sender address rejected. Due to the unmatched IP/hostname as the later is set to 127.0.1.122:02
zathrasrelated to ehlo22:03
minimalthat sounds like a Postfix configuration-related issue22:04
minimalby "external IP" I assume you're referring to a NAT'ed IP (i.e. not an actual IP address configured on an interface of the VM)22:05
zathrasno. The actual internet v4 address22:06
zathrasPostfix takes the hostname or you can set it in the config of Postfix itself22:07
zathrasHowever then this hostname no longer matches to the IP in DNS as it gets fubar-ed by the 127.1.1.0 setting enforced by cloud-init22:07
zathrasSo I have 2 questions: 1.  has 'managed_etc_hosts' impact on booting or was it just useful during the initial setup of the server? 2. If useful during boot, where can/should I (re)configure it?22:09
zathrasHowever I just read that cloud_init_modules update_etc_hosts can be commented out to fix it too22:18
zathrasis this the way to go?22:18
zathrasbasically: https://serverfault.com/questions/1108760/how-to-disable-etc-hosts-from-resetting-after-reboot22:19
meenazathras: did you read https://cloudinit.readthedocs.io/en/latest/reference/modules.html#update-etc-hosts && https://cloudinit.readthedocs.io/en/latest/reference/modules.html#update-hostname ?22:21
zathrasI did read some docs, but missed these. I just read them. I missed on *where* (which file/location) to define that setting22:25
zathrasIt is nice that an example is provided, but it does not specify in which file/location22:26
minimalin user-data of course...22:31
zathrasok. Thank you. But where is that? Not in /etc/cloud and I did not spot it somewhere in /root22:33
minimalit's whereever your cloud provider lets you specify it22:33
minimalwhen you create the VM22:33
zathrassee 1.40 up where I specify what I found on my system22:33
minimal?22:34
zathras1 hour 40 mins ago I specified my layout and where I did grep/found manage_etc_hosts22:35
zathrasIt looks like genereated files in /var/lib/cloud where I found it 3 times. But I did not find it in /etc/cloud22:36
zathrasThe VPS provider is Hetzner22:37
minimalso figure out where in Hetzner's GUI for creating VMs they let you specify user-data22:38
minimaluser-data is specified at the time a VM is created22:41
zathrasI did find: etc/cloud/cloud.cfg.d/90-hetznercloud.cfg with a setting: preserve_hostname22:46
zathrasseems like a solution to me. Stil no clue about where the user-data is stored though22:47
minimalyou provide the user-data when you create the VM22:47
minimalhow exactly did you create the VM?22:48
zathrasuhm. The VM is created through a webinterface. I never specified a thing. I also did not choose to install cloud-init22:48
minimalso then you did not provide any user-data22:48
zathrasonly things like: user-account, size of disk, name of server. That is about it iirc22:49
minimalhttps://docs.hetzner.com/cloud/servers/faq/#can-i-use-cloud-init-when-creating-servers22:50
zathrasI also see definitions in hat cfg file for: cloud_dir: /var/lib/cloud/   && templates_dir: /etc/cloud/templates/22:50
minimal"While creating your server, you can inject cloud-init user data"22:50
zathrasyes. I just read that. However I never did.22:51
zathrasmaybe as a background process initiated by the Hetzner Web-gui. But not intentionally22:52
zathrasBut am I right that preserve_host: True is the fix I am looking for?22:53
minimaland it was suggested that you DO "inject" user-data if you want to set such things as "manage_etc_hosts" or "preserve_hostname" etc22:53
zathrasfine by me if I knew where to do that22:54
minimalthat would be a question best addressed to Hetzner support22:55
zathrasI will search the web-gui22:55
zathrascould not find it. Filed a support request. Probably an answer tomorrow23:05

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!