/srv/irclogs.ubuntu.com/2021/12/01/#cloud-init.txt

diadatpIs it possible to install i386 versions of packages via the packages: config key? I using Ubuntu 20.04 and have tried specifying the primary archive mirror with both amd64 and i386 architectures. The logs state that the apt command failed as it was unable to locate the package.09:51
diadatpI've resorted to using `dpkg --add-architecture i386 apt ...` in the runcmd section. 09:51
eggbeanI have the locale module failing for en_GB. I think it is because it is executing before the packages module attempts to install locales-all. How do I make it do that before the locale module runs?14:18
eggbeanNone of the packages are installing.14:18
minimaleggbean: I believe that is governed by the ordering of the modules listed in /etc/cloud/cloud.cfg14:24
eggbeanminimal: Right, but I can't change that can I?14:25
eggbeanHow are you supposed to change locales?14:25
minimallooking on a VM here, I see "locale" defined in the cloud_config_modules section and "package-update-upgrade-install" defined in the cloud_final_modules section14:27
minimalyou could edit that fi eif you are building your own OS images14:27
minimalI guess the assumption is that the base OS has the locale files present14:28
minimalalternatively you could use a "run_cmd" to setup the locales after the package install has run14:28
minimalwhich Linux (or other OS) distro are you using?14:29
=== meena1 is now known as meena
eggbeanDebian14:36
eggbeanminimal: If this is the case, the locale module is pretty useless then? 14:37
eggbeanThis is not exactly some obscure edge case 14:38
minimaleggbean: so it seems you have 3 options, (1) Ask Debian to add the locales to their cloud image, (2) modify the Debian image yourself to add the locale package, or (3) use "run_cmd" instead to configure the locales14:38
minimaleggbean: the locale module is not useless if the locale files are present - I suggest you ask the Debian Cloud Team why the locales package is not pre-installed. I make my own VM/Cloud images for Alpine Linux and specifically ensure that Alpine's locale package is preinstalled in the image for this very reason14:39
eggbeanI suppose 3 then. I was actually doing that intially, having converted my previous userdata bootstrap script to run_cmd commands, but trying to migrate that to cloud-init modules has led to all sorts of  problems14:40
minimalperhaps the Debian Cloud team have never tested setting the locale via the cloud-init module? That would seem unlikely however14:41
eggbeanI'll just use run_cmd for now. cheers14:43
=== gschanuel27 is now known as gschanuel2
holmanb@blackboxsw: I addressed the nits in https://github.com/canonical/cloud-init/pull/1101 - Assuming travis passes this last (minor) change I don't plan on any more changes.20:33
blackboxsw@holmanb should have this reviewed within the hour20:41
blackboxswthanks!20:41
blackboxswman, I really want to get onto some flag-day typing and mypy work with cloud-init.20:42
blackboxswSomething to do over Christmas break :)20:42
holmanbIndeed :)20:42
blackboxswholmanb: on first blush cloudinit.config.schema.get_jsonschema_validator docstring doesn't match return type20:45
holmanblooking20:45
blackboxswnot sure the intent of the Non in the 3-tuple returned20:45
blackboxswnot sure the intent of the None in the 3-tuple returned20:45
holmanbAh, I remember (though I'm not sure it's the best reason in retrospect)20:49
holmanbthat's what validate_cloudconfig_metaschema() returns - it makes the return types match20:51
holmanbwhich really isn't necessary, but allows the tuple assignment in cloudinit/config/schema.py:15720:52
blackboxswthanks holmanb I'm grappling with why we are conflating the actual validation of metaschema with the the get_jsonschema_validator call in that initial try. I think I might suggest one more changeset, so, probably will wait until tomorrow for this :/21:16
blackboxswholmanb: also, if we invoke: validate_cloudconfig_schema(strict_metaschema=True) doesn't the  cloudinitValidator we return of validate_cloudconfig_metaschema have the META_SCHEMA["additionalProperties"] = False set so that all subsequent validation becomes strict a non-permissive of additionalProperties?21:19
holmanbIt can wait, no rush.21:21
holmanb@blackboxsw - yes, that's the potential future use case - strict meta datavalidation. That isn't currently used21:22
holmanb- yes, that's the potential future use case - strict metadata validation at runtime. That isn't currently used but I plummed through the flag in case we decide we want to turn it on in the future.21:23
holmanbcan't type today I guess21:24
blackboxswahh " Return strict Validator and FormatChecker for use in validation"21:24
blackboxswmy position was that metaschema itself would be strict if validating, but module schema would be permissive21:25
blackboxswevent if we happen to also be validating metaschema.21:25
blackboxswBut, this pespective can wait until we actually attempt to validate metaschema at runtime, if at all.21:26
holmanb@blackboxsw: That makes sense. You make a good point; I wrote it that way to reuse the Validator and FormatChecker produced by validate_cloudconfig_metaschema() rather than a duplicate call to get_jsonschema_validator(), but doing that makes it less obvious what is happening there.21:33
blackboxswholmanb: no worries , I'm trying to write up the opinion on this and we can sort tomorrow if the suggestion makes sense or not. it feels like we've added a complexity in function return values and different error handling to reuse that one schema validator. And I think even if validate_meta is True, we probably should retain the original META_SCHEMA["additionalProperties"] definition was even when we return from 21:36
blackboxswvalidate_cloudconfig_metaschema. 21:36
blackboxswwe might be able to still call get_jsonschema_validator once before validate_cloudconfig_metaschema and pass the validator into validate_cloudconfig_metaschema21:37
blackboxswthen we don't have to have the implicit indirection 21:37
holmanbI like the simplicity of that.21:38
blackboxswand we'd also avoid trying to shoe-horn common 3-tuple return values into validate_cloudconfig_metaschema21:38
blackboxsw+1 will try to form a solid suggestion on that front and see if that holds water21:39
holmanbsounds good, thanks21:41

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