/srv/irclogs.ubuntu.com/2024/07/16/#cloud-init.txt

Guest1337I am using vmware and ubuntu 24.04. I am trying to create a user and set a clearetext password, but its failing at failed to set passwords with chpasswd for my_adm. Here is my vendor-data file https://pastebin.com/Lhe0vjRc08:34
acibaHi Guest1337, can you log in with the default user? if so can you share the contents of /var/log/cloud-init.log ?08:36
Guest1337aciba thanks for quick response. I have one user defined in user-data, and one user defined in vendor-data, where I also use chpasswd. the user defined in user-data is created and I can login with it. The user in vendor-data is never created. Here is log: https://pastebin.com/adsdpqMH after I ran cloud-init clean, init and modules --mode-config08:54
Guest1337Mind you, this is the first time I am using cloud-init, so I dont know if I am doing stuff in the best practise way08:55
acibaI see, you are running on OVH. There is one error while the datasource is fetching the metadata from the cloud, I am not sure if related to your isse09:27
aciba* issue09:27
acibathen there is no mention to adding the my_adm user in the logs09:27
acibathe cc_users_groups module tries to add the olof user:09:28
aciba2024-07-16 08:42:46,079 - distros[INFO]: User olof already exists, skipping.09:29
acibait looks like your user-data is not correctly pulled by cloud-init09:29
Guest1337When I put all users in vendor-data or all users in user-data, I get the desired result. Maybe some errors with merging.09:29
acibaGuest1337: what's the output of cloud-init query userdata ?09:29
Guest1337I also tried to add merge_how:09:30
Guest1337  users: "list(append)" in the user-data file, that worked, but it broke other directives in user-data - eg it didnt add my hostname09:30
aciba`cloud-init query combined_cloud_config` gives you the fully merged cloud-config09:32
acibaand `cloud-init query vendordata` the vendor-data09:32
acibais your users config within any of those?09:32
acibaI see, you can also add a `users:\n -default` followed by your new user to either userdata or vendordata09:40
acibasee https://docs.cloud-init.io/en/latest/reference/modules.html#users-and-groups09:40
acibaGuest1337: I mean using this: https://pastebin.ubuntu.com/p/MTXtMjNjy5/ as either vendor or user data. Does that solves your issue?09:48
Guest1337if I clean, init and query, then if I am using users both in vendor-data and user-data, there seem to be some merge conflict, and nothing from user-data is applied. It does not help to use merge_how.09:48
Guest1337If I put both users in user-data, or both users in vendor data, everything works as expected.09:48
Guest1337aciba: yes that will work.09:49
acibaAbout the merge_how, the merging strategies acts upon multiple configs of the same cathegory, that is, it specifies how to merge multiple instances of user-data or vendor-data together09:52
acibaexample: merging user-data1 with user-data2 with merge_how x09:52
acibabut user-data + vendor-data will always be plainly merged09:53
Guest1337So if I called my user directive in both files something else, such as vendorusers and localusers, I could merge them as users?09:54
acibait is not about the name, it's about if they are user or vendor data09:54
acibaGuest1337: this same issue happend here: https://github.com/canonical/cloud-init/issues/511209:57
-ubottu:#cloud-init- Issue 5112 in canonical/cloud-init "merging user data sections not work" [Open]09:57
aciba5112 is kept to improve the documentation regarding merge09:57
Guest1337Okay, Ill just use either one of them.10:28
Guest1337Now, my next problem is that my network configuration is never applied / read. https://pastebin.com/0a7KuTCX ens192 is the name of my only network card.10:29
minimalGuest1337: you're embedding network configuration in metadata file? only ENI (legacy) format is supported for this12:36
Guest1337minimal: yes. Is this the wrong approach? Whats the best approach to apply network config to an ubuntu vm? (using vcenter ova wizard)12:38
minimalI'm not familiar with OVA/VMware, normally I'd supply a separate network-config file in either v1 or v2 format (for NoCloud)12:39
minimals/OVA/OVF/12:40
minimalhmm, seems that v1/v2 *may* indeed be supported for VMware DataSource: https://vdc-repo.vmware.com/vmwb-repository/dcr-public/c9e49fd1-322b-4c80-97ce-9c2a4f51d5ea/f5135739-7dca-4c6b-bc4e-c926b3d11ae8/GUID-316F0C90-B206-45CF-A5CF-4B51746F3F66.html12:43
minimalGuest1337: BTW you have noticed that your logfile shows errors when cloud-init tries to run vmware-rpctool and vmtoolsd, right?12:44
Guest1337Im going to be honest and say that Im in deep waters here, as its first time I try to look into all of this :) Can you give me an example of how youre supplying an separate network-config file?12:49
minimalwell I'm not using OVF datasource12:50
minimalhow metadata, network config etc are provided is datasource-specific12:51
Steve37holmanb I'm back! finally got around to trying a fake optional interface in network-config and amazingly it works.16:26
holmanbSteve37: looks like you're gone again but maybe you'll see this in the logs18:51
holmanbSteve37: thanks for reporting your results on the issue on github18:52

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