Even though AD joining is not that critical.
I noticed in lab higher success rates when not specifying the computer
name option in realm join CLI.
But I'm not convident enough to say that this would behave better than
Ubiquity's original implementation, which does use the computer name
option.
It turns out that the `realm --install /target` does a chroot.
So curtin in target command is not necessary for that.
The same doesn't hold for pam-auth-update.
Setting hostnames is still a requirement, because realm calls adcli
under the hood, which doesn't go through chroot.
There is a quite non-straightforward sequencing between the AD
controller and Joiner classes.
A client may do a blocking call to join_result_GET at any moment.
It should only be blocking if the ADModel is set.
Curtin commands are not tested here, though.
AD controller offers the blockign endpoint.
AD Joiner creates a task when the AD Controller join_domain() is called.
Install controller requests that in the end of the post install method.
AD Controller calls itself on dry run for testing purposes
TODO:
- refine tests;
- do the real join.
Network manager can create routes at metric aka priority above 20000.
These can stick around if they are not the best choice, or they may
disappear quickly.
Do not consider one of these routes as a valid default route for
has_network purposes.
The existing event based method of watching for has_network has a flaw.
The incoming route_change events from probert do not distinguish routes
on the same interface but a different metric, so if 2 routes on one
interface appear, we only get one event. Then if one of those routes is
removed, we will inappropriately remove this route from the
default_routes list.
Aside from the code watching the event stream, the set of default routes
is an elaborate boolean value.
Simplify the code by passing around a boolean, and when we get a
route_change event, use that to go looking again at the list of default
routes.
LP: #2004659
`realm discover` without a domain name attempts to find one from DHCP.
This attempts to run it from the controller start method.
Only creates the discover task if there is support
Avoids exception on controller start.
Currently only the realm program is executed by the ad controller.
Thus we only check if its accessible.
Clients should call this endpoint prior to showing the AD screen.
If a specific source ID is set via autoinstall but the source controller
is marked interactive, the UI would select the default source (i.e., the
first one on the list) instead of the one matching the ID specified.
This happens because the matching between the ID and the sources loaded
was done in apply_autoinstall_config ; which is only called in
non-interactive scenarios.
By moving this matching in the start coroutine instead, the right source
is also selected when the source controller is interactive.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
parameterized async tests run into cpython bug gh-101486
We use parameterized.expand, which works by creating new functions and
inserting those into the list of tests. It's a wonder this worked at
all before for the async tests.
Update the function generation to create a coroutine function, if
appropriate.
LP: #2007554
added one more error value to the enum
"ping" relies on realmd, which is part of the minimal layer.
For now not considering it coming from the snap.
The package is not staged at this point.
We got multiple bug reports in the past stating that the installer is
not honoring some part of the apt settings; either supplied by means of
autoinstall (e.g., pinning) or via the subiquity UI (e.g., proxy).
What happens under the hood is that curtin overwrites the APT settings
as part of the curthooks stage ; effectively discarding earlier settings
applied in the apt-config stage.
Curtin does so because we pass debconf_selections directives to
curthooks. In the past, curtin used to handle debconf_selections
separately but nowadays it considers that they are part of the APT
config. As a result, it decides to run apt-config again (but with a
close to empty configuration) as part of the curthooks stage.
We now pass debconf_selections as part of the apt-config stage. This
should hint curtin not to run apt-config again as part of curthooks.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Raising from the POST /mirror handler makes it difficult for the client
to distinguish an internal error from the lack of usable mirror.
We now return an enumeration with the following possible values:
* ok
* no-usable-mirror
It is up to the client to either:
1. adjust the network settings and retry
2. give up on the install
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>