Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
cdist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
41
Issues
41
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ungleich-public
cdist
Commits
4f21bf53
Commit
4f21bf53
authored
Dec 05, 2019
by
Evil Ham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] PreOS: English nitpicking.
parent
b3012b99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
37 deletions
+37
-37
cdist/argparse.py
cdist/argparse.py
+1
-1
docs/src/cdist-preos.rst
docs/src/cdist-preos.rst
+36
-36
No files found.
cdist/argparse.py
View file @
4f21bf53
...
...
@@ -424,7 +424,7 @@ def get_parsers():
parser
[
'inventory'
].
set_defaults
(
func
=
cdist
.
inventory
.
Inventory
.
commandline
)
# PreO
s
# PreO
S
parser
[
'preos'
]
=
parser
[
'sub'
].
add_parser
(
'preos'
,
add_help
=
False
)
# Shell
...
...
docs/src/cdist-preos.rst
View file @
4f21bf53
...
...
@@ -4,9 +4,9 @@ PreOS
Description
-----------
With cdist you can install and configure new machines. You can use cdist to
create PreOS, minimal OS wh
ich purpose is to boot
new machine.
After PreOS is booted
machine is ready for installing
desired OS and
then
it is ready for configuration.
create PreOS, minimal OS wh
ose purpose is to boot a
new machine.
After PreOS is booted
, the machine is ready for installing the
desired OS and
afterwards
it is ready for configuration.
PreOS creation
--------------
...
...
@@ -15,62 +15,62 @@ Currently supported PreOS-es include:
* debian
* ubuntu
* devuan
.
* devuan
PreOS is created using
cdist preos command. preos command has subcommands that
creat
e the desired PreOS.
PreOS is created using
the ``cdist preos`` command.
This command has subcommands that determin
e the desired PreOS.
For example, to create ubuntu PreOS:
For example, to create
an
ubuntu PreOS:
.. code-block:: sh
$ cdist preos ubuntu /preos/preos-ubuntu -B -C \
-k ~/.ssh/id_rsa.pub -p /preos/pxe-ubuntu
For more info about
available options se
e cdist manual page.
For more info about
the available options see th
e cdist manual page.
This will bootstrap (``-B``) ubuntu PreOS in
``/preos/preos-ubuntu`` directory, it
will be configured (``-C``) using default built-in initial manifest and with
specified ssh authorized key (``-k``).
After bootstrapping and configuration
PXE
boot directory will be
created (``-p``) in ``/preos/pxe-ubuntu``.
This will bootstrap (``-B``) ubuntu PreOS in
the ``/preos/preos-ubuntu``
directory, it will be configured (``-C``) using default the built-in initial
manifest and with
specified ssh authorized key (``-k``).
After bootstrapping and configuration
, the PXE boot directory will be
created (``-p``) in ``/preos/pxe-ubuntu``.
After PreOS is created
new machines can be booted using created PXE (after
proper dhcp, tftp setting
).
After PreOS is created
, new machines can be booted using the created PXE
(after proper dhcp and tftp settings
).
Since PreOS is configured with ssh authorized key it can be accessed thro
gu
h
Since PreOS is configured with ssh authorized key it can be accessed thro
ug
h
ssh, i.e. it can be further installed and configured with cdist.
Implementing new PreOS sub-command
----------------------------------
Implementing
a
new PreOS sub-command
----------------------------------
--
preos command is implemented as a plugin system. This plugin system scans for
preos subcommands in ``cdist/preos/`` distribution directory and also in
preos subcommands in
the
``cdist/preos/`` distribution directory and also in
``~/.cdist/preos/`` directory if it exists.
preos subcommand is a module or a class that satisfies the following:
* it has attribute ``_cdist_preos`` set to ``True``
* it
has
function/method ``commandline``.
* it has
the
attribute ``_cdist_preos`` set to ``True``
* it
defines a
function/method ``commandline``.
For a module
based preos subcommand ``commandline`` function accepts a module
object as its first argument and the list of command line
For a module
-based preos subcommand, the ``commandline`` function accepts a
module
object as its first argument and the list of command line
arguments (``sys.argv[2:]``).
For a class
preos subcommand ``commandline`` method should be staticmethod and
it accepts a class object as its first argument and the list of command lin
e
arguments
(``sys.argv[2:]``).
For a class
-based preos subcommand ``commandline`` method should be
static-method and must accept a class as its first argument and th
e
list of command line arguments
(``sys.argv[2:]``).
If preos scanning finds a module/class that has ``_cdist_preos`` set
to ``True`` and
it has
function/method ``commandline`` then this module/class is
to ``True`` and
a
function/method ``commandline`` then this module/class is
registered to preos subcommands. The name of the command is set to ``_preos_name``
attribute if
it exists, otherwise it is set to the module/class name,
lowercase.
When
registered preos subcommand is specified as preos command then
``commandline``
will be called with
first argument set to module/class object and second argument
set to ``sys.argv[2:]``.
Example writing new dummy preos sub-command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module
based preos:
attribute if
defined in the module/class, defaulting to the module/class name in
lowercase.
When
a registered preos subcommand is specified,
``commandline``
will be called with
the first argument set to module/class and the second
argument
set to ``sys.argv[2:]``.
Example
of
writing new dummy preos sub-command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
Module
-
based preos:
^^^^^^^^^^^^^^^^^^^
#. Create directory ``~/.cdist/preos/`` if it does not exist
...
...
@@ -134,4 +134,4 @@ When you try to run this new preos you will get:
FreeBSD dummy preos: []
In the ``commandline`` function/method you have all the freedom to actually create
PreOS.
a
PreOS.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment