/srv/irclogs.ubuntu.com/2020/03/24/#cloud-init.txt

eggbeanI usually have a bash script for my aws ec2 user script. I have just confugured an instance with EFS file storage, so it has added a load of #cloud-config yaml.  How do I include my bash script to this?03:29
eggbeanI suppose I should just rewrite everything in the bash script to be done in  cloud-init instead?05:38
eggbeanBut is that the only way?05:39
andras-kovacs<Odd_Bloke "andras-kovacs: What behaviour ar"> Hi Odd_Bloke ! If I give an immutable flag for the resolv.conf ( I know it's ugly as hell but I had to :'( ) cloud-init-local will fail whatever I set in the cloud.cfg. I want cloud-init to completely leave alone the /etc/resolv.conf. I can make it only happen by disable cloud-init completely after the first run (with a runcmd).08:01
andras-kovacscloaked1: are you sure in the suid flag on the nfs mount?08:05
=== hjensas_ is now known as hjensas
=== hjensas_ is now known as hjensas
robjoblackboxsw: Odd_Bloke #160 reviewed, just a couple of comments, overall LGTM. Thanks12:50
Odd_Blokeeggbean: You could try moving your shell script to a runcmd stanza: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#runcmd13:38
eggbeanOdd_Bloke: Thanks.  I'll have a read.13:38
Odd_BlokeAlternatively, you could investigate passing multipart user-data to cloud-init, which would allow you to leave the generated YAML completely alone.13:40
Odd_BlokeBut runcmd is definitely easier if it works for you.13:40
eggbeanokay, cheers13:40
Odd_Blokeandras-kovacs: Could you pastebin the traceback you (presumably) get in /var/log/cloud-init.log?  That'd hopefully give me a hint as to what is poking at resolv.conf.13:45
Odd_Blokerobjo: Thanks!13:45
fholmesDoes anyone know how I can make the hostname equal the vm name in vsphere using cloud-init?  I have a template I have setup with govc guestinfo.metadata and guestinfo.userdata strings.14:33
fholmesNot sure if I need to customize those either manually or a custom script or if I can use jinja2 templates in cloud-init to pull this off.  I don't really see any queriable instance-data atttributes I can use for vsphere (esxi or whatever).14:34
Odd_Blokefholmes: I'm not familiar with VMWare products, but you can see the available attributes by running `cloud-init query -a`.14:36
fholmesThanks Odd_Bloke!  I will check that out and see what i can come up with then.14:36
Odd_Bloke:)14:37
Odd_BlokeHeads-up: Travis are having issues: https://www.traviscistatus.com/incidents/ntxbkxt8lrx914:39
fholmesWell ultimately the information is not there that I need, so I guess it is a custom script then.  Thanks again Odd_Bloke, I really appreciate the assistance.14:43
Odd_Blokefholmes: Are you aware of the runcmd: stanza, to execute the script for you as part of cloud-init's run?14:46
fholmesYes, I definitely am14:46
Odd_BlokeOK, good. :)14:54
andras-kovacsfholmes: it sounds interesting. Which name do you want to make static?  (place in /etc/hostname)? The "local" short one or the FQDN? For me, cloud-init prints the FQDN there.14:55
fholmes@andras-kovacs I want to use the name of the vm that shows up in the vcenter client to be the local-hostname of the deployed VM.14:56
fholmesFor instance govc vm.clone -vm ubuntu-1804-kube-v1.17.3 kube-master-1.   I want the hostname to be the kube-master-1 basically.14:57
Odd_Blokemeena: Last call for comments on https://github.com/canonical/cloud-init/pull/16014:57
Odd_Bloke(I'm going to land it in the next couple of hours.)14:58
Odd_Bloke(Of course if you do have any comments after that, I will still listen to you. ;)14:58
andras-kovacs<Odd_Bloke "andras-kovacs: Could you pastebi"> so I have manage_resolv_conf: 0 in my cloud.cfg, there is an immutable flag on the resolv.conf and cloud-init-local.service gets failed on every reboot. Here are the logs from /var/log/cloud-init.log https://pastebin.com/szz2QaB915:01
andras-kovacsI'm wondering... which is better? the FQDN or the local_hostname to store in /etc/hostname? Cloud-init puts the FQDN there in my VMs.15:04
Odd_Blokerharper: ^ sounds very familiar, but I can't find a bug report about it.15:12
fholmesWell this seems to do the trick.  https://pastebin.com/aHVJanmW15:12
Odd_BlokeNice!15:13
fholmesWould be nice to see better support for vsphere, but beggars cant be choosers!  lol.  I know there most likely has to be a better way honestly.  This is my first real foray into cloud-init though so I still have a lot to learn here.15:14
meenasomebody please explain to me how y'all are able to focus on work15:17
fholmesVery easy.  I have worked from home for the past three years at least and this is a normal day for me.  If you look at the facts instead of watching the news there is an overall death rate of ~1%.  China has stopped the spread of the virus in their country so if we all just follow some basic common sense we are going to get through this in one15:24
fholmespiece.15:24
rick_h_heh, little harder than that but someone once said something famous about accepting things I cannot control, taking care of business when I can, and such.15:31
Odd_Blokerharper: Travis had failed to report status on #274, so I've just kicked off one of the sub-jobs again to try and get Travis to report correctly without a full re-run, FYI.15:35
andras-kovacsmeena: :D I've chosen a job which is kind of my hobby also.15:41
andras-kovacsfholmes: my colleague from China told me it's 1-2 weeks from now and they will reopen their office15:42
fholmes@andras-kovac That is definitely good news!  I am truly hoping their lives can get back to normal as quickly as possible.  Along with the rest of the world.15:43
fholmesAnd yes, I was lucky enough to find my passion in computers at 8 years old, about 34 years ago. lol15:44
andras-kovacsbut my other colleague from India told me... it's getting harder to get groceries15:44
andras-kovacsfholmes: you can be still that kid with 34 years of experience15:45
fholmeslol, I am definitely that kid in a candy store when it comes to my daily life.  :) . Learning new technologies is what I live for each day and I am blessed to be in a position where I get paid to do it and share it with others.15:46
andras-kovacsI wish my colleagues would be the same as you with the attitude15:48
fholmesYes, there are no beans and rice anywhere here in Arizona I am sure of it.  Food is still available but the store shelves empty very quickly.  I do have three kids and one of them just finished chemo for cancer and they are concerned it might have spread.  So ultimately I have more pressing things to worry about honestly.  However, he is15:49
fholmesimmunocompromised but I refuse to let the fear of him getting sick enter my mind.  Luckily the county where we live have 0 reports so hopefully everything works out.15:49
fholmesYes, I feel you @andras-kovacs it is painful working with many people in this industry.  I was very lucky to have gotten my current job.  There are no egos to content with on my team and everyone loves what they do.  It is definitely a very refreshing change and extremely rare in this industry.15:51
fholmess/content/contend15:51
andras-kovacsI wish the best for your kid. I hope he will get better soon! My mother had cancer also. It took time but luckily she is well now.  And I wish great power for you!15:54
andras-kovacsyes, the IT industry nowadays like... bunch of people work for the money only while they are hating it. If you are in a different environment... that can be good.15:58
fholmes@andras-kovacs Thank you very much.  I am positive he will be fine.17:24
smosersomeone on my local user group (http://www.mug.org) just linked to https://canonical.com/careers/207575218:13
rick_h_smoser:  yea, I shared it in the old ubuntu-us-mi channel18:15
rick_h_howdy smoser18:15
smosero/ rick_h_18:15
smoserjust make sure people *here* are aware. its a good company to work for and a good team to be on.18:17
rick_h_smoser:  cool yea that's awesome. Hopefully can find some awesome folks for it. Thanks for the plug in here.18:17
Odd_Blokerharper: https://github.com/canonical/cloud-init/pull/275#pullrequestreview-380626877 <-- reviewed19:22
cloaked1I'm curious. I'm trying to set bonds up for interfaces on a couple of machines and for some reason I keep getting the error "All parents must belong to the same VLAN" which doesn't make sense. What does "parents" mean in this context?19:32
cloaked1I found the code: https://github.com/maas/maas/blob/master/src/maasserver/forms/interface.py#L57419:32
cloaked1but that still doesn't make sense. This error is senseless to me.19:32
cloaked1maybe one must put the individual interfaces in the right VLAN before creating the bond in the target VLAN?19:34
cloaked1that's it. That error is horribly ambiguous.19:35
rick_h_cloaked1:  sounds about right. Sanity checking the interfaces can both participate in the bond I'd guess19:36
cloaked1yeah, at the least the error should be better worded.19:36
cloaked1not even a google check was very helpful per se.19:36
rharpercloaked1: generally you want to vlan over a bond.  so the bond will have a list of interfaces, and then the vlan would specify the bondX as it's vlan_link,19:42
cloaked1indeed. I'm aware of that.19:42
cloaked1the issue was that I needed to preset the interfaces to the desired VLAN first and then set the bond19:43
rharperis this a MAAS ui issue then ?19:43
cloaked1that workflow was not understood.19:43
rharperas that confused me coming from the bottom  up at least19:43
cloaked1I tried setting the desired VLAN during the time of bonding; the VLAN of which was different than wat the interfaces were on in the first place.19:44
powersjhmm blackboxsw were we suppose to do a status meeting today :\ are off a week because of the sprint19:44
rharperpowersj: IIRC blackboxsw set it for every day this week19:44
cloaked1rharper: not sure but it doesn't seem right.19:44
rharperso maybe it's a mystery as to which day ?19:44
* blackboxsw checkes oooh right :) cloud-init status roulette now19:45
rharpercloaked1: you point to the form, so I'm guessing UI;  versus some sort of network config error coming from cloud-init or netplan, etc19:45
blackboxswI 'fixed' the invite for status and set it today, and forgot to host it.19:45
blackboxswsooo, shall we hold the cloud-init status meeting now?19:45
rharperI suspect there's some database relation going on, in that a bond may select any of the member interfaces at any time, so guess they want the physical interfaces to be included in the same vlan (maas internal I suspect)19:46
cloaked1yes, correct. It was UI. Should I create a bug?19:46
rharpercloaked1: yeah, confusion is confusion =/19:46
cloaked1ok. I'll create a bug report.19:46
eggbeanI am putting bash script commands into #cloud-config,runcmd, but maybe some things can be done in pure cloud-init?  adding/modifying users, setting timezone, locale, hostname associating elastic IP, modifying hosts file, rebooting... which of these can be done in cloud-init?19:47
powersjblackboxsw, I think we get more folks in the US morning19:47
powersjeggbean, have you looked through some of the cloud-config examples? https://cloudinit.readthedocs.io/en/latest/topics/examples.html19:47
eggbeanpowersj: thanks19:47
powersjeggbean, here are the docs for every module: https://cloudinit.readthedocs.io/en/latest/topics/modules.html19:48
eggbeancheers19:48
rharpereggbean: almost all of those have explicit cloud-config19:48
eggbeancool19:48
rharperthe "hostname associating with elastic IP" is new to me, so maybe not that one19:48
eggbeanrharper: missed a comma after hostname19:49
rharperah;  I don't think we have a module for the elastic ip association;  but I've not done that via command line so not sure what command to use19:49
blackboxswpowersj: rharper Odd_Bloke shall I then shift status meeting to tomorrow (my holiday), Friday or Tuesday next week?19:50
eggbeanaws cli.  Looks like I'll still be using runcmd for that then19:50
rharperyeah19:50
powersjblackboxsw, let's bump to next tuesday19:50
powersjthanks19:50
=== blackboxsw changed the topic of #cloud-init to: pull-requests https://git.io/JeVed | Meeting minutes: https://goo.gl/mrHdaj | Next status meeting March 31 16:15 UTC | 19.4 (Dec 17) drops Py2.7 : origin/stable-19.4 | 20.1 (Feb 18) | https://bugs.launchpad.net/cloud-init/+filebug
blackboxswthx for the uss-tableflip cherry-pick branch review Odd_Bloke/rharper. Wrapping those comments up now.19:57
cloaked1@here https://bugs.launchpad.net/maas/+bug/186886820:01
ubot5Ubuntu bug 1868868 in MAAS "UI: bonding NICs on different VLAN causes ambiguous error" [Undecided,New]20:01
cloaked1hopefully that is worded well enough for your understanding. If it is not, let me know and I can work through it.20:02
andras-kovacsis there a way to use the meta data in the hosts.*.tmpl files?20:08
blackboxswinteresting questions andras-kovacs, generally with the user-data, we allow any keys from 'cloud-init query --all' using a #template: jinja header before #cloud-config and referencing variables like  {{ v1.cloud }} in your template files. Example here https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html#using-instance-data20:13
blackboxswandras-kovacs: what tmpl file are you looking to use substitution on. I can double check quickly20:14
andras-kovacsI've added to this file: /etc/cloud/templates/hosts.redhat.tmpl20:16
andras-kovacsthis line: {{ds.meta_data.local_ipv4}} {{fqdn}} {{hostname}}20:16
andras-kovacsBut it's not working.20:16
andras-kovacstl;dr app team asked for a line with the ip address of eth0 with the FQDN name. cloud-init makes it like: 127.0.0.1 {{fqdn}} {{hostname}}20:18
blackboxswandras-kovacs: it's worth a bug,  I think I may have only turned on that jinja-template handling of instance-data.json variables for cloud-config user-data. It would be worth extending that to other template rendering I think.20:19
andras-kovacsblackboxsw: ok, thank you! I can go with runcmd of course but IMHO it would look more sophisticated with a template20:21
andras-kovacswhere should I raise the bug? in GitHub?20:22
blackboxsw+1 andras-kovacs right. And I assume you've grok'd that runcmd can be a jinja-template too right ?20:22
blackboxsw## template: jinja20:22
blackboxsw#cloud-config20:22
blackboxswruncmd:20:22
blackboxswandras-kovacs: we track bugs in Launchpad https://bugs.launchpad.net/cloud-init/+filebug20:23
blackboxswwe don't use issue tracking in github yet20:23
andras-kovacsyes i saw that but to be honest..  I was using it like: - cloud-init query region20:25
andras-kovacsso I should add the #cloud-config and ## template: jinja lines in the /etc/cloud/cloud.cfg also?20:27
rharpercloaked1: thanks20:28
blackboxswandras-kovacs: nope on that file, it is sources essntially cloud-config yaml anyway. But another interesting application would be to allow jinja templating /etc/cloud/cloud.cfg too on a filesystem.  I don't think that is currently handled either20:29
rharperandras-kovacs: for bugs we track them in launchpad,  https://bugs.launchpad.net/cloud-init/+filebug20:30
rharperah, blackboxsw already mentioned that, sorry;20:30
blackboxswI think we 'could' extend /etc/cloud/cloud.cfg and cloud.cfg.d to support jinja-template files, but I'm not sure the machinery applies there yet20:30
blackboxswno worries rharper thx. And I think it's worth a separate bug/feature request to support jinja-templates in /etc/cloud/cloud.cfg* files20:30
andras-kovacsok "and that's the story how I sold my soul to Canonical" :D20:31
andras-kovacsyes, probably I gave it a try but it printed my variable names so that's why I'm using the query command in cloud.cfg. Thanks, I remember now.20:33
rharperblackboxsw: hrm, well;  it's not clear to me that we can20:33
rharperwe read and source system config (/etc/cloud/*) which sets up things like datasource lists and other things that are unrelated to the instance20:33
rharperso I worry that folks would jinja things that cannot be expanded20:33
rharperexisting template files /etc/cloud/templates/*  I think make sense as they're consumed after we're on a ds and have an instance (including metadata)20:34
* rharper gets some coffee , brb 20:34
andras-kovacsso how people generally use it? I didn't wanted to make a special use-case here20:35
andras-kovacsI mean... I know here we are using chef and ansible most of the time but I like make things easier and if cloud-init can make these things happen from the beginning, I don't want to make it more complicated20:38
=== hjensas_ is now known as hjensas
andras-kovacsIf I could include the basics in my VM templates than everybody would be happy and I could evangelize cloud-init :D20:40
blackboxswahh right rharper, trying to render jinja template before we have instance data (like setting the original datasource_list which ds-identify consumes) would be putting the cart before the horse.20:40
andras-kovacsI got your point but when I run the runcmd commands I have everything.20:43
blackboxswthough it's possible we could support some level of templating in /etc/cloud/cloud.cfg* for certain use-cases I think, especially if the templates were not depending on specific instance-data from 'cloud-init query'.20:43
blackboxswAnd right andras-kovacs at runcmd time, you have everything.20:43
andras-kovacsoh I see sg. else too!20:44
blackboxswat any cloud-config stage after the datasource is detected you'll have instance-data (the metadata variables), (which is either cloud-init-local or cloud-init-netwok stage depending on your cloud)  https://cloudinit.readthedocs.io/en/latest/topics/boot.html20:44
blackboxswI mean "at any cloud-init stage*"   not cloud-config stage20:45
andras-kovacsso should I need to file a bug? I don't want to waste your / anyone else's time20:45
blackboxswandras-kovacs: I think it's worth one bug on trying to use instance-data templates for your hosts.tmpl file20:46
andras-kovacsyes, I got that20:48
blackboxswit's not a waste if we respond and decide it's not worth it for upstream, because it will document that decision for others. but, specifically at host rendering time based on distro, I *think* we are already past accumulating and persisting instance-data20:49
blackboxswso it might be low hanging fruit that we could provide a feature for20:49
blackboxswor something a "cloud-init evangelist in the community" could help with ;)20:49
andras-kovacsI really like the simplicity and the way how cloud-init works I don't want to mess it up with my requests20:50
blackboxswno worries. never a mess up to have feature requests20:50
blackboxswgives us a stream of suggestions to prioritize20:51
andras-kovacslike... it's great you haven't forget to hit a systemctl daemon-reload before mounting with the mount module20:51
rharperandras-kovacs: I'm +1 on allowing instance metadata use in /etc/cloud/templates/*  files ;  we need to think a bit more on the general /etc/cloud/ system config files20:51
rick_h_lol blackboxsw way to slide that in there20:56
blackboxswheh20:59
blackboxswrick_h_: /me likes the instance-data and json schema drum :)21:00
blackboxswit's my favorite song :)21:00
andras-kovacsI would buy that CD than warez download the mp3 version and listen to it only on spotify(on-demand).21:15
powersjlol21:15
blackboxswOdd_Bloke: comment on https://github.com/canonical/cloud-init/pull/27721:15
blackboxswhah!21:16
rharperandras-kovacs: haha, awesome!21:22
* cloaked1 loves IRC.21:25
cloaked1slack is good and all but nothing beats IRC imo.21:26
blackboxswOdd_Bloke: https://github.com/canonical/cloud-init/pull/272#pullrequestreview-380713598 approved, just needs rebase21:34
blackboxswand merge21:34
Odd_BlokeThanks!21:34
blackboxswhttps://github.com/canonical/cloud-init/pull/277 approved for real too Odd_Bloke21:35
Odd_BlokeNice, thank you.21:35
blackboxswcan circle back if needed to point folks at your existing pytest example21:35
rharperhttps://github.com/canonical/cloud-init/pull/275  now has another hefty example of pytest.mark.parametrize21:36
blackboxswrharper: +1 excellent, hadn't seen it yet.21:37
blackboxswrharper: I didn't fully grok your review comment.https://github.com/canonical/cloud-init/pull/267#discussion_r397373585 isn21:43
blackboxswper your comment "We want to allow a local cloud-config file to set the the policy. "   isn't my branch already sourcing the merged config from the 'local cloud-config' on disk and overriding distro defaults?21:43
blackboxswor are you suggesting we shouldn't have distros even define a preferred_renderer_priority and we only do it in distro image default /etc/cloud/config.cfg21:44
andras-kovacs(I like this word now: grok. Thanks!)21:46
blackboxswgrok: "understand (something) intuitively or by empathy"    I'm all about empathy... :)21:48
blackboxswrharper: I'm not seeing where you mention we have a default policy set for network renderers in ubuntu. I know we set it for *bsd but the typical Ubuntu cloud-images aren't adding network: renderers to the /etc/cloud/cloud.cfg that we write in cloud-images.22:09
blackboxswwe *can* and it would make the patch simpler if we dropped the Distro.preferred_renderer_priority() if you don't think we should add it (since we prioritize merged_cfg anyway if present22:10
andras-kovacsoh before I forget here is what I've added to my runcmd:22:34
andras-kovacs - cloud-init query -f "{{ ds.meta_data.local_ipv4 }} {{ ds.meta_data.public_hostname }} {{ v1.local_hostname }}"22:34
andras-kovacs     | tee -a /etc/hosts /etc/cloud/templates/hosts.redhat.tmpl22:34
andras-kovacsand it works just great! thank you guys!22:34
blackboxswnice andras-kovacs, excellent to hear22:35
andras-kovacsthis way I could eliminate some custom shell scripts and systemd units22:35
andras-kovacsVery many thanks! I've added you on linkedin, I hope you don't mind.22:37
blackboxswgood, good andras-kovacs. my linked in is generally stale except when we are hiring :)  per here https://www.linkedin.com/posts/chad-t-smith-b8a5b54_ubuntu-server-software-engineer-activity-6639574095736426496-u5ja22:39
andras-kovacsblackboxsw: thanks!23:12
andras-kovacsCould you tell me what "resize_rootfs_tmp: /dev" does in the cloud.cfg? I see it belongs to the resiztefs module but I can't figure out the meaning of it.23:14

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