Commit Graph

6 Commits

Author SHA1 Message Date
Baptiste Daroussin
cde6642431 nuageinit: check for both user_data and user-data
openstack, ec2 and other implementation of cloudinit disagrees on the
name of the file "user-data" or "user_data", test both and use the first
found

PR:	279876
2024-06-27 10:32:14 +02:00
Baptiste Daroussin
8d7331e62a nuageinit: fix authorized_key test
After miss reading the cloudinit spec I ended up writting a wrong
test for basic ssh key setup, nuageinit has been fixed, but not
the test, here is the actual fix.

Reported by:	markj
2024-06-05 11:00:54 +02:00
Baptiste Daroussin
fa07b02f6e nuageinit: make addsshkey friendly for testsuite 2024-06-05 11:00:53 +02:00
Baptiste Daroussin
83fcab792c nuageinit: use pw(8) instead of getent(1)
pw(8) allows to seek for users in a custom rootdir, which makes it
easier for a testsuite

MFC After:	3 days
2024-06-05 11:00:53 +02:00
Jeremy Collin
48edad2edf fix (nuageinit): SSH keys are not handled in metadata but in userdata
MFC After: 1 day
2024-05-21 16:52:42 +02:00
Baptiste Daroussin
a42d6f7601 nuageinit: add basic support for cloudinit.
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.

It support nocloud and openstack config-2 config drive mode (iso9660 or
msdosfs)

The following features are currently supported:
- adding users (including a default user named 'freebsd' with password
  'freebsd'
- adding groups
- adding ssh keys
- static ipv4, static ipv6, dynamic ipv4

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
MFC After:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D44141
2024-03-15 09:22:16 +01:00