bootstrap-vz/bootstrapvz
Manoj Srivastava a56f20657b
[admin_user]: Added support for password and static pubkey auth
This commit adds authentication optionally with passwords or static
ssh pubkeys for the admin user.

There are now three ways to grant access to the admin user:
-  Set a password for the user, or
-  Provide a ssh public key to allow remote ssh login, or
-  Use the EC2 public key (EC2 machines only)

If a password is provided, this plugin sets the admin password. This
also re-enables password login (off by default in Jessie).

If the optional argument pubkey is present (it should be a full path
to a ssh public key), it will ensure that the ssh public key is used
to set up password less remote login for the admin user.

Only one of these options (password, or pubkey) may be specified.

If neither the password not a ssh public key location are specified,
and if the EC2 init scripts are installed, the script for fetching the
SSH authorized keys will be adjust to match the username specified.

Fixes: https://github.com/andsens/bootstrap-vz/issues/248

Signed-off-by: Manoj Srivastava <srivasta@google.com>
2016-02-06 00:39:20 -08:00
..
base enable support for creating kvm images for jessie on arm64 2016-01-08 13:06:57 -06:00
common Only sed in growpart workaround when release is >= jessie 2016-01-13 18:50:41 +00:00
plugins [admin_user]: Added support for password and static pubkey auth 2016-02-06 00:39:20 -08:00
providers Write Jessie growpart workaround script to something other than growpart 2016-01-12 19:12:57 +00:00
remote Implement docker integration test provider and docker tests 2015-12-13 23:12:00 +01:00
__init__.py Bump version number 2015-12-13 20:26:43 +01:00
README.rst Fix #98. External plugin architecture implemented 2015-05-03 13:07:26 +02:00

How bootstrap-vz works
----------------------

Tasks
~~~~~
At its core bootstrap-vz is based on tasks that perform units of work.
By keeping those tasks small and with a solid structure built around
them a high degree of flexibility can be achieved. To ensure that
tasks are executed in the right order, each task is placed in a
dependency graph where directed edges dictate precedence. Each task is
a simple class that defines its predecessor tasks and successor tasks
via attributes. Here is an example:

.. code:: python

	class MapPartitions(Task):
		description = 'Mapping volume partitions'
		phase = phases.volume_preparation
		predecessors = [PartitionVolume]
		successors = [filesystem.Format]

		@classmethod
		def run(cls, info):
			info.volume.partition_map.map(info.volume)

In this case the attributes define that the task at hand should run
after the ``PartitionVolume`` task — i.e. after volume has been
partitioned (``predecessors``) — but before formatting each
partition (``successors``).
It is also placed in the ``volume_preparation`` phase.
Phases are ordered and group tasks together. All tasks in a phase are
run before proceeding with the tasks in the next phase. They are a way
of avoiding the need to list 50 different tasks as predecessors and
successors.

The final task list that will be executed is computed by enumerating
all tasks in the package, placing them in the graph and
`sorting them topologically <http://en.wikipedia.org/wiki/Topological_sort>`_.
Subsequently the list returned is filtered to contain only the tasks the
provider and the plugins added to the taskset.


System abstractions
~~~~~~~~~~~~~~~~~~~
There are several abstractions in bootstrap-vz that make it possible
to generalize things like volume creation, partitioning, mounting and
package installation. As a rule these abstractions are located in the
``base/`` folder, where the manifest parsing and task ordering algorithm
are placed as well.