Automate the creation of Juju environments on MAAS

Mark Shuttleworth mark at ubuntu.com
Fri Aug 12 21:03:57 UTC 2016


On 12/08/16 12:25, Merlijn Sebrechts wrote:
> So I've tried out some stuff and it seems I'm stuck. Creating new
> users and creating new keys for the currently logged in user works but
> there is no way to create keys for other users.
>
> Creating an api key requires being logged in but to login you have to
> have an api key... Any ideas how to solve this?
>
> PS: I'm currently using MAAS 1 but we're planning to move to MAAS and
> Juju 2.0 when they release.

The MAAS API is one thing I'd like to clean up! But in the push for 2.0
that fell off the list, so I can well believe there's a gap there.

If you're motivated to patch it in, I would follow the same pattern as
Juju, where the logged-in admin user can create the account with a
one-time token that gets passed to the user who registers using that
token. Something like:

  $ maas add-user bob
  Tell bob to 'maas register 172.50.12.43/MAAS
hifwe8f7hwifuhkjwh3riuwhhfwdfkjh'

And Bob then does:

  $ maas register 172.50.12.43/MAAS hifwe8f7hwifuhkjwh3riuwhhfwdfkjh
  Set your password: ************
  Verify the password: ************
  Logged in as 'bob' on canonimetal/london

Mark




More information about the Juju mailing list