Page MenuHomeFreeBSD

nuageinit: add basic support for cloudinit.
ClosedPublic

Authored by bapt on Feb 28 2024, 2:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 4, 6:20 AM
Unknown Object (File)
Sun, Dec 29, 2:16 AM
Unknown Object (File)
Sat, Dec 21, 9:56 AM
Unknown Object (File)
Sun, Dec 8, 10:35 PM
Unknown Object (File)
Dec 5 2024, 5:15 PM
Unknown Object (File)
Dec 4 2024, 10:34 AM
Unknown Object (File)
Nov 30 2024, 12:44 PM
Unknown Object (File)
Nov 30 2024, 8:10 AM

Details

Summary

this is a very early script to support cloudinit, it does not intend to
be a full featured cloudinit client, but will support a good enough
subset to be viable in most case.

The very alpha implementation is able to support cloud-init with a
config drive (iso9660 or msdosfs labeled config-2).

It supports ipv4 (only dhcp so far), ipv6 (only static) adding ssh keys
to the default user (creating the default user as 'freebsd'

With this one is able to use the 'bring your own image feature" out of
box.

It is expected that the script grows the support of other clouds
supporting cloud-init, contributions are welcomed.

It is designed to be only run once via the firstboot mecanism.

Sponsored by: OVHCloud

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bapt requested review of this revision.Feb 28 2024, 2:17 PM
bapt edited the summary of this revision. (Show Details)

I'd recommend doing a linting pass with devel/lua-luacheck- usually the concerns it points out aren't too crazy.

libexec/nuageinit/nuage.lua
29

For cleanliness, these should really be in a nuage table:

local nuage = {}

function nuage.warn(...)
end

which we then return at the end...

51

This should be local

54

This could be more concisely written: ret[#ret + 1] = str

110

These should be local

139

These should be local

libexec/nuageinit/nuageinit
29

This would then follow the standard local nuage = require("nuage") pattern and use exported bits in the nuage table.

36

These should be locals

libexec/nuageinit/nuage.lua
2

Just BSD-2-Clause

brooks added inline comments.
libexec/nuageinit/yaml.lua
2

License?

libexec/nuageinit/nuage.lua
25

Unless you really really want the boilerplate. I'd omit everything after your Copyright.

Add license credit to yaml.lua
Address @kevans comments
Address @imp & @emaste comments
pet luacheck
Remove WIP support for network based cloudinit this is too soon

bapt marked 9 inline comments as done.Mar 1 2024, 9:12 PM

Add a full testsuite
Add ipv4 static network
Support network in \#cloud-confing

This revision was not accepted when it landed; it landed in state Needs Review.Mar 15 2024, 8:23 AM
This revision was automatically updated to reflect the committed changes.