Configuring the Installer
In the .aiop
folder of your playbook, you can configure the installers you want to generate. These folders are only used when you want to generate an installer with the command aiop build --installer deb
[Learn more].
Installer configuration is optional and should, in most cases, allow you to generate an installer without complexity. This page is intended for those who want to customize the generation of installers.
Configuration
In the playbook configuration file .aiop
, add the installer
field. Under installer
, add the type of installer and its following sub-arguments.
Currently, installer generation is limited to deb
. However, other types such as exe
and rpm
are under development.
name
: Name of the installer.config_folder
: Installer configuration folder relative to the root of the playbook. This folder contains the configuration files for the installer generator. By default, they will be retrieved in theinstaller/
folder.source_path
: Absolute path of the package source files where they will be installed on the host machine. By default, they will be placed in/usr/share/mysrc
.bin_path
: Absolute path of the package binaries where they will be installed on the host machine. These binaries will be stored in thesource_path
folder and symlinked inbin_path
. By default, they will be placed in/usr/bin
.
An example configuration for a deb-type installer:
playbook:
installer:
deb:
name: installer-deb
config_folder: installer/deb
source_path: /usr/share/mysrc
bin_path: /usr/bin
Configuration of the deb
Installer
Using the previous example, we can see that the configuration files are placed in the installer/deb
folder.
Place the specific configuration files for this installer in this sub-folder:
- ...
- control
- postinst
To customize the configuration of a deb
installer for Debian Linux machines, you can create all the configuration files related to the deb
installer in the deb
folder within the installer
folder.
For example, we want to modify the control
configuration file to add a dependency on the python
package.
Package: ${package_name}
Priority: extra
Maintainer: Valentin Rudloff <valentin.rudloff.perso@gmail.com>
Version: ${version}
Homepage: https://aiop.io
Architecture: all
Depends: python
Description: This is my description
You will notice that we have added the line Depends: python
to add a dependency on the python
package.
You do not need to put the package name and version in the control
file; AIOP will replace the ${package_name}
and ${version}
variables in this file with those of the package. The version corresponds to the tag on your git repo.
We could go further and add a post-installation script in the postinst
file:
#!/bin/bash
echo "I am executed after the package installation"
In this script, we simply display a message in the console after the package installation.
For more information on configuring deb
installers, you can refer to the official Debian documentation here (opens in a new tab) or here (opens in a new tab).