opnsense-src/libexec/nuageinit/tests
Jesús Daniel Colmenares Oviedo ba5df7a2d0 nuageinit: Improvements for nuageinit
- Fix 'pkg update' usage:
  - The function 'nuage:run_pkg_cmd(...)' adds the flag '-y', which
    does not make sense with some commands such as 'pkg update',
    causing an error when updating the repository catalogs.
- Fix typo 'ssh-authorized-keys -> ssh_authorized_keys' in
  'nuageinit(7)' man page.
- Document 'ssh_authorized_keys' parameter.
- Use device configuration ID when no 'match' rule is specified:
  - This is the default behavior of cloud-init when no match rule is
    specified, so the device is configured anyway (even if it does not
    exist). This greatly simplifies things, since in many cases
    'if_vtnet(4)' is used, so there is no need to perform a comparison
    with the MAC address.
- Document 'network' parameter:
  - Add example to 'EXAMPLES' section.
- Set 'gateway[46]' only when 'addresses' is specified:
  - To comply with the cloud-init specification, 'gateway4' and 'gateway6'
    must only take effect when 'addresses' (or static configuration) is
    specified.
- Use a separate function to check 'match' rules:
  - This way, we can easily add new logic to new types of rules.
- Implement 'network.ethernets.{id}.match.name' parameter:
  - But unlike cloud-init, which works with glob expressions (although it
    depends on the network backend), this implementation takes advantage
    of Lua pattern-matching expressions.

    Also note that previously we were only concerned with one interface
    matching, however, to be cloud-init-compliant, we need to configure
    the matching interfaces (one or more).
- Set default router only once.
- Implement 'network.ethernets.{id}.wakeonlan' parameter.
- Implement 'network.ethernets.{id}.set-name' parameter.
- Implement 'network.ethernets.{id}.match.driver' parameter:
  - Rename 'get_ifaces(...)' function as 'get_ifaces_by_mac(...)'.
  - Add get_ifaces_by_driver(...) function.
- Implement 'network.ethernets.{id}.mtu' parameter.
- Implement 'nameservers' parameter.
- Use 'resolvconf(8)' to manipulate 'resolv.conf(5)'.
- Use 'tzsetup(8)' to set time zone.

Reviewed by:            bapt@
Approved by:            bapt@
Differential Revision:  https://reviews.freebsd.org/D51643
2025-08-22 14:40:36 -04:00
..
addfile.lua nuageinit: implement write_files 2025-06-26 13:47:37 +02:00
addgroup.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00
addsshkey.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00
adduser.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00
adduser_passwd.lua nuageinit: add test about encrypted passwords 2024-11-20 11:02:55 +01:00
dirname.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00
err.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00
Makefile nuageinit: Improvements for nuageinit 2025-08-22 14:40:36 -04:00
Makefile.depend Update Makefile.depend files 2024-10-14 10:26:17 -07:00
nuage.sh nuageinit: Improvements for nuageinit 2025-08-22 14:40:36 -04:00
nuageinit.sh nuageinit: Improvements for nuageinit 2025-08-22 14:40:36 -04:00
sethostname.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00
settimezone.lua nuageinit: Improvements for nuageinit 2025-08-22 14:40:36 -04:00
utils.sh nuageinit: Standardize warning/error messages 2024-09-26 12:59:14 +02:00
warn.lua nuageinit: Lua check and lint files 2024-09-26 12:58:00 +02:00