/srv/irclogs.ubuntu.com/2023/04/16/#cloud-init.txt

minimalLvl4Sword: you mean the user-data?01:34
Lvl4Swordminimal, ?. I mean without a machine. Such as a website like regex101 or something to verify.01:47
minimalLvl4Sword: to verify what exactly? the user-data YAML you are providing?02:35
holmanbLVL4Sword: It's not clear what you are talking about: user configurations, code, or documentation. We use static analyzers (black, pylint, flake, mypy) which would catch code typos in Python. We have some spell checkers for the documentation. We have some tooling that validates user user-data cloud-config. We have some code tests that catch a variety of things. To which of these do you refer?02:42
minimalholmanb: I assume he's referring to user-data he had hasn't been clear. For user-data beyond using "cloud-init schema" there's no real solutions, right?02:45
minimals/had /just /02:45
holmanbYeah I think you're right.02:51
holmanbI mean a script could be statically validated by external checkers (shellcheck, for example), but since scripts are freeform that would have to be validated with something external. I guess we could maybe add something for Jinja, to see if the template is valid (just a basic load with a try/except would be all it would take).02:54
minimalI meant more than the likes of yamllint will indicate if a user-data YAML file is valid YAML, but doesn't check that it is valid user-data02:57
minimals/than/that/02:57
NaaaaI understand how cloud-init works on initial boot of a system, but is cloud-init supposed to be applied every time a system reboots?14:26
=== dbungert is now known as Guest7975
meenaNaaaa: there are modules that run on every boot14:52
meenaand depending on the cloud provider, this could be divergent parts: Azure for instance wants the network configured every boot, while most other clouds do that once per instance14:53
meenaevery module's documentation tells you when it runs14:54
anatoly79hello15:40
anatoly79I'd like to test my user-data file by running cloud-init in a temp direcory or docker and apply only "apt" section15:40
anatoly79how can  do it? what is a command line?15:41
anatoly79the distro is ubuntu 22.0415:42
minimaltest the syntax of your user-data or test performing actions/commands based on the user-data?15:42
anatoly79I want to see mofification to the root fs15:43
anatoly79I know I can do it with VM, but using docker (or tmp dir0 is faster15:43
minimalyou'd have to run cloud-init to see the results15:44
minimalwhere is your user-data coming from? a cidata ISO?15:45
anatoly79a local file15:45
minimaldon't think you can test that then - where cloud-init gets the user-data from depends on the particular DataSource used15:46
anatoly79I tried this: 1) run ubuntu 22.04 in a docker 2) install cloud-init 3) run cloud-init --file user-data.yml init15:46
anatoly79but this command tries to modify disk (run udevadm)15:47
anatoly79I'd like to run only "apt" section15:47
minimaldoes your user-data have only a apt section?15:47
anatoly79yes, I have a version with only "apt" section. cloud-init still tries to do the other things15:48
minimalwell cloud-init doesn't just handle user-data15:48
minimalit sets up network etc15:49
minimalso it is not clear what exactly you are trying to achieve15:49
anatoly79can I tell it to do only "apt" stuff?15:49
minimalwell if it doesn't setup network then how can it "do" only apt stuff (which likely involves a network connection)?15:50
minimalcloud-init is not really designed for runnning in a docker "application" container, though it can run in a LXC "OS" container15:51
anatoly79it can just assume that current configuration works, and start from "apt", I guess15:52
minimalyou said you want to do this as it is quicker than using a VM, but you could have used a VM by now and finished your test...15:52
anatoly79:-)15:53
minimalbasically I think you're trying to use cloud-init in a way it is not designed to be used15:54
minimalalso what are you doing in a "apt:" section that is so complicated that you need to test it?15:57
anatoly79I'd like to create an ISO with build-in pool of debs for offline (no internet) install. For that I'd like to apply "apt" section  in some isolated env, and download debs15:59
anatoly79I can do it with my particulat configuration, but I want to do it generic, so applying "apt" section whatever it might be sounded as a good idea15:59
anatoly79livefs-editor project just uses main mirror16:02
anatoly79I thought by applying custom apt I can get more options for download16:02

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