diff --git a/examples/autoinstall/reset-only.yaml b/examples/autoinstall/reset-only.yaml index cb4eedf5d..f45ae52db 100644 --- a/examples/autoinstall/reset-only.yaml +++ b/examples/autoinstall/reset-only.yaml @@ -1,9 +1,4 @@ version: 1 -identity: - realname: '' - username: ubuntu - password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1' - hostname: ubuntu storage: layout: name: direct diff --git a/subiquity/server/controllers/identity.py b/subiquity/server/controllers/identity.py index d32e3754b..759c03b25 100644 --- a/subiquity/server/controllers/identity.py +++ b/subiquity/server/controllers/identity.py @@ -85,9 +85,13 @@ def load_autoinstall_data(self, data): @with_context() async def apply_autoinstall_config(self, context=None): - if not self.model.user: - if 'user-data' not in self.app.autoinstall_config: - raise Exception("no identity data provided") + if self.model.user: + return + if 'user-data' in self.app.autoinstall_config: + return + if self.app.base_model.target is None: + return + raise Exception("no identity data provided") def make_autoinstall(self): if self.model.user is None: