[17:51] sweet cloud-init 17.1.25 hit xenial [17:51] ok blog post rework this afternoon [20:23] I see how to set http/s proxy and no_proxy for apt. Is there a way to set proxies for the default environment? Suspecting it's not wise to just blow away /etc/environment (and I can't append). [20:43] jdandrea: there is not. [20:44] you could use boothook to intelligently update /etc/environment (boothooks run every boot) [20:44] but generally speaking its just a pita when you try to set http_proxy globally [20:44] like that [20:44] @smoser Ok. I ask because without that then the apt settings aren't as helpful for us on first boot. [20:44] so i really don't recommend it. [20:44] @smoser Hmm, ok. I wish this lab wasn't behind a proxy. :/ [20:45] so.. why isnt it helpful for you on first boot ? [20:45] basically, static http_proxy and https_proxy fall apart as soon as you try to use an address that isnt proxy-able [20:45] We also set no_proxy tho [20:45] yes, but that is vastly insuffiicent [20:46] Indeed it is. I wish I had a better option. [20:46] gnu tools read it sanely, and allow you to use wildcard and even cidr entries [20:46] In another lab they have proxyless gateways so it's a sinch. [20:46] but python (and other languages) do not. [20:46] s/sinch/cinch [20:46] so they're uselss. [20:46] adn then, you do something like launch a container, and it has its own network that wasnt in your http_proxy and you are foobarred again [20:46] Aye, and in those use cases that's already taken care of with install. I'm really more concerned with bootstrapping things. [20:47] here is what i do: [20:47] http://bazaar.launchpad.net/~smoser/+junk/sstack-proxy/view/head:/sstack-proxy [20:47] so bootstrapping ? as in with maas ? [20:47] Right, I get that. Presuming I have a solid handle on communicating proxy settings down to various bits, I'm left with trying to get things to a happy state during cloud-init. In this case it's just cloud-init stuffs that are kicked off after an OpenStack nova boot. [20:47] Reading... [20:48] This particular lab already has a proxy server, thus I suspect something like tinyproxy wouldn't fly (?). [20:48] ah. ok. i see. [20:49] Basically I wish they didn't have one, but ... hands tied. [20:49] jdandrea: oh. i run the tiny proxy on the host [20:49] and point http_proxy/https_proxy at *it* [20:49] @smoser Ah [20:50] then you dont ever have to change your http_proxy/https_proxy vars [20:50] Ohhhh [20:50] and you can just update tinyproxy and restart [20:50] * jdandrea gets clue [20:50] and then all things get updated [20:50] the issue is its slower than no proxy [20:50] Right, and in this case I'm betting folks won't like that. But hey, if I can get it to work sanely... [20:51] So it requires at least one reboot, ya? [20:51] (Not necessarily a bad thing.) [20:51] well, a new session after /etc/environmetn is wrtten, yeah. [20:51] and daemons restarted possibly. [20:51] Ok [20:51] I will study this. Thank you! [20:51] actually , daemons do not read /etc/environment enerally speaking [20:51] you can make similar change to systemd config... [20:52] Right. This is there purely so that the one-time scripts that are running at boot time can do their thing, and then they will communicate proxy settings to whatever services need them from that point on. [20:52] i dont think we added an 'environment' config to cloud-init [20:52] but i have wanted to. [20:52] I think I can replace /etc/environment but I suspect that is a Very Bad Idea(tm). :D [20:52] ie, cloud-init would read your settings in 'environment:' and update its environ. [20:52] mhm mhm that's what I was looking for, like for apt. [20:53] jdandrea: i'm surprised at the amount of peole that write proxy data into e/tc/environment [20:53] Well, honestly? I'd rather not do that. [20:53] it seems without a solution like tinyproxy to be copmetely a broken idea to me. [20:53] so yeah, i'd stay out of taht. [20:53] But it *looks* to me (and I could be wrong)... like Ubuntu needs to know about proxies early on in cloud-init. I may be wrong. [20:53] what is it that you ahve to do before then ? [20:53] what is "ubuntu" ? [20:54] in this case... what uses ? [20:54] Because there are some things it's trying to get and it can't reach some servers. Ubuntu meaning Ubuntu 14.04 or 16.04. [20:54] apt will do the right thing. [20:54] Lemme try and make a minimal paste to show... [20:54] I could also just be wrong. :) [20:55] my 'sstack-proxy' came from usage of a cloud that was simliarly configured. [20:55] in that you can't get to the interwebs without proxy [20:55] but i only did things that *needed* access after cloud-init was up and hadn run that [20:56] @smoser So this is early on in cloud-init. The IPv6 I'd ignore. But the pollinate stuff overall... connecting to entropy: https://hastebin.com/ucaviyajuq.rb [20:56] http://paste.ubuntu.com/25969929/ [20:56] This is before any user scripts are run, methinks. [20:56] thats my user-data that i run [20:56] for use case of general system i want to go to. [20:57] *nod*... [20:57] you can probably ignore the pollinate. [20:57] they shouldnt cause trouble generally.. failure shoudl not cause issue [20:57] Ok, then in that case I don't need to touch environment. [20:57] Whew. [20:57] timeouts suck though [20:57] Yeah. And y'know it may have absolutely nothing to do with proxies. Could also be noisy neighbors. [20:57] (Now seeing 1 minute downloads take 45. Um...) [20:57] you can also i think tell cloud-init to disable pollinate. if you dont like its warnings. [20:58] TIL: can disable pollinate. Thanks! Good to know [20:58] Hopefully we don't need the entropy. XD [20:59] Appreciate the insight. I will look at both of these pastes. [20:59] actually i'm wrong. you can't disable pollinate. [20:59] ewll, you can, but not through cloud-init. [20:59] (you could with a bootcmd: [20:59] Hehe. But... it's not a total disaster if it doesn't do its thing. [20:59] ? [20:59] Ah, ok. [21:00] ln -sf /bin/true /usr/bin/pollinate [21:00] jdandrea: its supposed to be seeding random data. [21:00] so it reads some random information off of a remote web service and writes it to /dev/random [21:00] to help with entropy [21:00] *nodnod* [21:00] entropy quality in a vm is a complicated topic [21:00] But if it can't reach it... "because proxy"... yeah. [21:01] Oh yes, I can imagine. [21:01] people suggest that not having enough entropy when your ssh host keys are generated could leave you at risk of attack [21:02] Right. Threat models and all that. So... yeah. Something to ponder. [21:02] oh. [21:02] you're runnign 14.04 there [21:02] 16.04 i dont think will spew error to console [21:03] Yup. BUT... 16.04 in some cases. [21:03] Ok. [21:03] basically your complaint was "fixed"' by siliently failing :) [21:03] Bwahahaha! [21:03] * jdandrea applauds [21:03] https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1554152 [21:03] Launchpad bug 1554152 in pollinate (Ubuntu) "pollinate fails in many circumstances, cloud-init reports that failure, maas reports node failed deployment" [Critical,Fix released] [21:03] Let me just turn down that baby monitor... :p [21:04] actually, openstack [21:04] will provid eyou with some blob of random data from the server [21:04] in metadata [21:04] (soo does azure) [21:04] and cloud-init will use that [21:05] so that provides locally to the cloud the value that pollinate would provide. [21:07] Ok, then we're good. [21:07] But really, beyond pollinate, I can set the proxies within a user script and it's fine. [21:07] And it's temporary. After that the service/VNF that comes up does the right thing. [21:07] I'm just glad I don't need to touch /etc/environment. [21:19] yeah./bu13 [21:39] Perhaps a silly question but why is touching /etc/environment considered such a bad thing? Reading through https://help.ubuntu.com/community/EnvironmentVariables there is nothing saying “OMG this is super bad don’t touch.” [22:15] smoser: rharper just pushed a cut at sourcing logfile paths from the cloud-init cfg to https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/333513 [22:15] blkadder: I suspect in general, system wide variables can cause problems in places that may be unexpected; I would think per-application settings are generally preferred; reading the wiki page; it sounds like that's the line on /etc/environment; which is (IMO) sane policy [22:16] Definitely preferable to do per app but if this indeed was intended to be have a global, persistent effect that would seem to be the place to do it. [22:17] Totally off-topic for here just found the earluer convo interesting… [22:17] earlier... [22:17] Understood about side-effects though. [22:23] blkadder: yeah, not that off topic for system initiazation