Files
gitea-pages/admin-guide/deployment/sample.rst
2021-05-05 14:24:27 +02:00

61 lines
1.9 KiB
ReStructuredText

Sample deployment of a new server
=================================
In this section we describe the deployment of a new server from
scratch.
All the operations will be performed using `bob`, the command-line
client for interacting with `sysdb`.
The informations we need are:
- the server name: ``logging-ra.psi.ch``
- the server MAC address: ``23:3d:ef:33:11:22``
- the server role: ``role::logging_server``
- the server environment in puppet: ``production``
- the sysdb environment: ``daas``
On our laptop, where we have a local copy of `bob`, we first setup
some environment variables to have shorter commands: ::
export PSI_BOB_URL=https://boot00-test.psi.ch/sysdb
export PSI_BOB_USER=talamo_i
The $PSI_BOB_USER is needed because our local user is different from
the one on sysdb. It could also be specified on the command line or
let `bob` take the local username.
We then create a deployment environment::
bob env add daas talamo_i daas-admins 'DaaS Cluster'
We add the node to the environment, specifing ``netboot`` as
the boot action ::
bob node add logging-ra.psi.ch daas netboot
We setup its MAC address: ::
bob node add-mac logging-ra.psi.ch 23:3d:ef:33:11:22
And we finally setup the puppet role and puppet environment: ::
bob node set-attr syslog-ra.psi.ch puppet_role=role::log_server
bob node set-attr syslog-ra.psi.ch puppet_env=production
PXE server-side configuration
-----------------------------
In case the node is configured to use legacy BIOS mode (and
not UEFI mode) the following has to be run on the PXE server to make
the node boot the ipxe image: ::
cd /afs/psi.ch/service/linux/tftpboot/pxelinux.cfg/
ln -sf lxprod logging-ra
MAC='the::node::mac::address'
MACFILENAME="01-`echo $MAC|tr 'A-Z' 'a-z'| sed 's/:/-/g'`"
ln -sf logging-ra $MACFILENAME
Otherwise the node will boot with the old pxe configuration. In such
case is possible to boot ipxe typing `lxprod` on the PXE command line.