Implement preos

This commit is contained in:
Darko Poljak 2019-09-20 07:15:37 +02:00
commit 799ec72369
95 changed files with 9997 additions and 4 deletions

View file

@ -11,7 +11,7 @@ SYNOPSIS
::
cdist [-h] [-V] {banner,config,install,inventory,shell} ...
cdist [-h] [-V] {banner,config,install,inventory,preos,shell} ...
cdist banner [-h] [-l LOGLEVEL] [-q] [-v]
@ -59,6 +59,29 @@ SYNOPSIS
[-I INVENTORY_DIR] [-a] [-f HOSTFILE] [-H] [-t]
[host [host ...]]
cdist preos [-h] preos
cdist preos debian [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
[-C] [-c CDIST_PARAMS] [-D DRIVE] [-e REMOTE_EXEC]
[-i MANIFEST] [-k KEYFILE ] [-m MIRROR]
[-P ROOT_PASSWORD] [-p PXE_BOOT_DIR] [-r]
[-S SCRIPT] [-s SUITE] [-y REMOTE_COPY]
target_dir
cdist preos devuan [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
[-C] [-c CDIST_PARAMS] [-D DRIVE] [-e REMOTE_EXEC]
[-i MANIFEST] [-k KEYFILE ] [-m MIRROR]
[-P ROOT_PASSWORD] [-p PXE_BOOT_DIR] [-r]
[-S SCRIPT] [-s SUITE] [-y REMOTE_COPY]
target_dir
cdist preos ubuntu [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
[-C] [-c CDIST_PARAMS] [-D DRIVE] [-e REMOTE_EXEC]
[-i MANIFEST] [-k KEYFILE ] [-m MIRROR]
[-P ROOT_PASSWORD] [-p PXE_BOOT_DIR] [-r]
[-S SCRIPT] [-s SUITE] [-y REMOTE_COPY]
target_dir
cdist shell [-h] [-l LOGLEVEL] [-q] [-v] [-s SHELL]
@ -432,6 +455,135 @@ List inventory database.
all hosts that contain any of specified tags.
PREOS
-----
Create PreOS. Currently, the following PreOS-es are supported:
* debian
* ubuntu
* devuan
PREOS DEBIAN/DEVUAN
-------------------
**target_dir**
target directory where PreOS will be bootstrapped
**-a ARCH, --arch ARCH**
target debootstrap architecture, by default 'amd64'
**-B, --bootstrap**
do bootstrap step
**-b, --beta**
Enable beta functionality.
**-C, --configure**
do configure step
**-c CDIST_PARAMS, --cdist-params CDIST_PARAMS**
parameters that will be passed to cdist config, by
default '-v' is used
**-D DRIVE, --drive-boot DRIVE**
create bootable PreOS on specified drive
**-e REMOTE_EXEC, --remote-exec REMOTE_EXEC**
remote exec that cdist config will use, by default
internal script is used
**-i MANIFEST, --init-manifest MANIFEST**
init manifest that cdist config will use, by default
internal init manifest is used
**-k KEYFILE, --keyfile KEYFILE**
ssh key files that will be added to cdist config;
'``__ssh_authorized_keys root ...``' type is appended to initial manifest
**-m MIRROR, --mirror MIRROR**
use specified mirror for debootstrap
**-P ROOT_PASSWORD, --root-password ROOT_PASSWORD**
Set specified password for root, generated by default
**-p PXE_BOOT_DIR, --pxe-boot-dir PXE_BOOT_DIR**
PXE boot directory
**-r, --rm-bootstrap-dir**
remove target directory after finishing
**-S SCRIPT, --script SCRIPT**
use specified script for debootstrap
**-s SUITE, --suite SUITE**
suite used for debootstrap, by default 'stable'
**-y REMOTE_COPY, --remote-copy REMOTE_COPY**
remote copy that cdist config will use, by default
internal script is used
PREOS UBUNTU
------------
**target_dir**
target directory where PreOS will be bootstrapped
**-a ARCH, --arch ARCH**
target debootstrap architecture, by default 'amd64'
**-B, --bootstrap**
do bootstrap step
**-b, --beta**
Enable beta functionality.
**-C, --configure**
do configure step
**-c CDIST_PARAMS, --cdist-params CDIST_PARAMS**
parameters that will be passed to cdist config, by
default '-v' is used
**-D DRIVE, --drive-boot DRIVE**
create bootable PreOS on specified drive
**-e REMOTE_EXEC, --remote-exec REMOTE_EXEC**
remote exec that cdist config will use, by default
internal script is used
**-i MANIFEST, --init-manifest MANIFEST**
init manifest that cdist config will use, by default
internal init manifest is used
**-k KEYFILE, --keyfile KEYFILE**
ssh key files that will be added to cdist config;
'``__ssh_authorized_keys root ...``' type is appended to initial manifest
**-m MIRROR, --mirror MIRROR**
use specified mirror for debootstrap
**-P ROOT_PASSWORD, --root-password ROOT_PASSWORD**
Set specified password for root, generated by default
**-p PXE_BOOT_DIR, --pxe-boot-dir PXE_BOOT_DIR**
PXE boot directory
**-r, --rm-bootstrap-dir**
remove target directory after finishing
**-S SCRIPT, --script SCRIPT**
use specified script for debootstrap
**-s SUITE, --suite SUITE**
suite used for debootstrap, by default 'xenial'
**-y REMOTE_COPY, --remote-copy REMOTE_COPY**
remote copy that cdist config will use, by default
internal script is used
SHELL
-----
This command allows you to spawn a shell that enables access
@ -540,12 +692,16 @@ FILES
~/.cdist/inventory
The home inventory directory. If ~/.cdist exists it will be used as
default inventory directory.
~/.cdist/preos
PreOS plugins directory, if existing.
cdist/conf
The distribution configuration directory. It contains official types and
explorers. This path is relative to cdist installation directory.
cdist/inventory
The distribution inventory directory.
This path is relative to cdist installation directory.
cdist/preos
The distribution PreOS plugins directory.
/etc/cdist.cfg
Global cdist configuration file, if exists.
~/.cdist.cfg or $XDG_CONFIG_HOME/cdist/cdist.cfg
@ -635,6 +791,20 @@ EXAMPLES
# Configure all hosts from inventory db
$ cdist config -b -A
# Create default debian PreOS in debug mode
$ cdist preos debian /preos/preos-debian -b -vvvv -C \
-k ~/.ssh/id_rsa.pub -p /preos/pxe-debian
# Create ubuntu PreOS
$ cdist preos ubuntu /preos/preos-ubuntu -b -C \
-k ~/.ssh/id_rsa.pub -p /preos/pxe-ubuntu
# Create ubuntu PreOS on drive /dev/sdb
# and set root password to 'password'.
$ cdist preos ubuntu /mnt -b -B -C \
-k ~/.ssh/id_rsa.pub -D /dev/sdb \
-P password
ENVIRONMENT
-----------