2. Send the cluster address to the region during start-up so that it
can render the preseed with the correct address.
We decided that #1 better divides responsibilities, but that we would
go for option #2 for two reasons: it's a lot less work, and it doesn't
preclude doing #1 at a later date and may be useful to that effort.
I made some notes about what it would take to do #1, included below,
which may be worth tracking as a blueprint (Julian, what is the best
way to propose work like this?).
.. -*- mode: rst -*-
Things needed from the region to render a preseed:
==================================================
- From ``maasserver.compose_preseed``:
- Metadata URL: ``absolute_reverse('metadata')``
- Token: ``NodeKey.objects.get_token_for_node(node)``
- Node status: ``node.status`` (only if commissioning or not)
- From ``maasserver.preseed``:
- Node status: ``node.status`` (only if commissioning or not)
.. _below: `Adding rendering server to the provisioning server:`_
Adding rendering server to the provisioning server:
===================================================
- Resurrect HTTP server in ``provisioningserver.plugin``.
- Move code, as detailed earlier_, to ``provisioningserver``, and
perform some moderate refactoring.
- Add handler to the ``provisioningserver`` HTTP server to query the
view_ detailed above, perhaps query the API for config, and call the
render code.
.. _earlier: `Things needed from the region to render a preseed:`_
.. _view: `Which boils down to:`_
Notes:
======
- The ``pxeconfig`` view calculates the preseed URLs. This calculation
no longer needs to happen, and its responsibility passes to the
provisioning server.
Raphaël and I discussed two options:
1. Render the preseed in the cluster.
2. Send the cluster address to the region during start-up so that it
can render the preseed with the correct address.
We decided that #1 better divides responsibilities, but that we would
go for option #2 for two reasons: it's a lot less work, and it doesn't
preclude doing #1 at a later date and may be useful to that effort.
I made some notes about what it would take to do #1, included below,
which may be worth tracking as a blueprint (Julian, what is the best
way to propose work like this?).
.. -*- mode: rst -*-
Things needed from the region to render a preseed: ======= ======= ======= ======= ======= ======= =
=======
- From ``maasserver. compose_ preseed` `:
- Metadata URL: ``absolute_ reverse( 'metadata' )`` objects. get_token_ for_node( node)``
- Token: ``NodeKey.
- Node status: ``node.status`` (only if commissioning or not)
- From ``maasserver. preseed` `:
- Node status: ``node.status`` (only if commissioning or not)
- Enum ``PRESEED_TYPE``.
⇒ Move to ``provisionings erver`` ?
- Setting ``PRESEED_ TEMPLATE_ LOCATIONS` `.
⇒ Move to ``provisionings erver`` .
- Config:
- ``commissioning _distro_ series` `
- ``main_archive``
- ``ports_archive``
- ``http_proxy``
⇒ Can be obtained via API.
- Server host: ``get_maas_ facing_ server_ host`` (used for?)
⇒ Already known on cluster?
- Server URL: ``absolute_ reverse( 'nodes_ handler' )`` (used for?)
⇒ Already known on cluster?
- Enlistment URL: ``absolute_ reverse( 'enlist' )``
- Disable netboot URL::
absolute_ reverse(
'metadata- node-by- id',
args= ['latest' , node.system_id])
- Enlistment preseed URL::
absolute_ reverse(
'metadata- enlist- preseed' , args=[version],
query= {'op': 'get_enlist_ preseed' })
⇒ Becomes responsibility of ``provisionings erver`` .
- Regular preseed URL::
absolute_ reverse(
'metadata- node-by- id', args=[version, node.system_id],
query= {'op': 'get_preseed'})
⇒ Becomes responsibility of ``provisionings erver`` .
- From ``contrib/ preseeds_ v2/generic` `:
- Node architecture: ``node. architecture` `
Which boils down to: ------- ------
-------
Code moves (see below_) and a view that returns:
- Metadata URL: ``absolute_ reverse( 'metadata' )``
- Token: ``NodeKey. objects. get_token_ for_node( node)``
- Node status: ``node.status`` (only if commissioning or not)
- Node architecture: ``node. architecture` `
- Enlistment URL: ``absolute_ reverse( 'enlist' )``
- Disable netboot URL::
absolute_ reverse(
'metadata- node-by- id', args=['latest', node.system_id])
- *Optional:* return config items (e.g. ``ports_archive``)
.. _below: `Adding rendering server to the provisioning server:`_
Adding rendering server to the provisioning server: ======= ======= ======= ======= ======= ======= ==
=======
- Resurrect HTTP server in ``provisionings erver.plugin` `.
- Move code, as detailed earlier_, to ``provisionings erver`` , and
perform some moderate refactoring.
- Add handler to the ``provisionings erver`` HTTP server to query the
view_ detailed above, perhaps query the API for config, and call the
render code.
.. _earlier: `Things needed from the region to render a preseed:`_
.. _view: `Which boils down to:`_
Notes:
======
- The ``pxeconfig`` view calculates the preseed URLs. This calculation
no longer needs to happen, and its responsibility passes to the
provisioning server.