Docs
Configurations
Installer

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 the installer/ 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 the source_path folder and symlinked in bin_path. By default, they will be placed in /usr/bin.

An example configuration for a deb-type installer:

.aiop
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.

    installer/deb/control
    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:

    installer/deb/postinst
    #!/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).