This is a script written with PyInfra, that automates the task of configuring and setting up freshly installed Arch Linux Server.
The scripts requires specific packages and/or software (See Prerequisites for more information).
This tool uses Python 3 and the following python packages:
- pyinfra v3 (To use this script with pyInfra v2, you are required to change
ssh_port
variable ininventory.py
from typeint
tostring
)
To easily install them on a system that allows installing packages using pip, you can use the following command:
pip install -r requirements.txt
# or
pip install pyinfra
In case you encounter the following output: error: externally-managed-environment
, it means that your OS does not allow installation of python packages using pip.
If that's the case you can eliminate this problem by either:
- Crating an instance of python virtual environment
venv
and use the script from there, - Install the required packages using your OS package manager.
This script parameters (i.e. target hosts and their settings) can be change by modifying inventory
(defines list of host accessed by pyInfra) or/and server_config
(defines script options that can be different depending on the desired outcome) blocks in inventory.py
.
This file is structured as described in the pyInfra documentation, which can be found here. Your changes must be structured and available with the pyInfra schema.
For other PyInfra runtime configuration that can be accessed from the CLI:
pyinfra --help
Sample configuration is provided in the repository under the name: inventory.py.sample
.
Variable Name | Description |
---|---|
ssh_hostname |
Sets the host ip address or hostname |
ssh_port |
Sets the ssh port used when connecting to target host |
ssh_user |
Sets the ssh user used during configuration |
ssh_password |
Sets the ssh user's password used during configuration |
More configurations options and/or different ways of connecting with the target hosts can be found here.
Variable Name | Description |
---|---|
MIRROR_REGION |
Sets the desired pacman mirror region |
ZEROTIER_NETWORK_ID |
Sets the Zerotier network id used when configuring zerotier service |
SWAPFILE_SIZE |
Sets the size of the system swap file (Default: 4G) |
LC_TIME_LOCALE |
Sets the value of the LC_TIME locale variable (Default: en_US.UTF-8) |
To run this script you need to issue the following commands:
pyinfra inventory.py deploy.py <additional_pyinfra_options>
List of all users which contributed to this script: