5.3.2. Managing plugins¶
Warning
This feature is currently in alpha.
Once you’ve created your plugin, you’ll need to enable it and manage it within the Ngenea Worker system.
5.3.2.1. Enabling your plugin¶
To make your plugin work, you need to enable it in the system settings.
Go to the configuration file
/etc/ngenea/ngenea-worker.conf
file.In this file, look for the line that says
enable_plugins
. By default, it is set tofalse
, which means plugins are disabled. Change it to:
enable_plugins=true
Once you’ve made this change, save the file.
By enabling this setting, you’re telling Ngenea Worker that you want to use the custom plugins you’ve created.
5.3.2.2. Installing your plugin¶
To install plugins on Ngenea Worker, you can follow these steps:
Install All Plugins: If you want to install all the plugins that are in the /var/lib/ngenea-worker/plugins
folder, use the following command:
ngenea-worker plugins install
This will install all the plugin packages in the plugins
directory. Keep in mind that Ngenea Worker will only update the plugins if their version number has changed in the setup.py
file.
Install a Single Plugin: If you want to install just one specific plugin, use the command below, replacing PACKAGE_NAME
with the name of the plugin you want to install:
ngenea-worker plugins install PACKAGE_NAME
Restart the Ngenea Worker Service: After installing plugins, you’ll need to restart the Ngenea Worker service to apply the changes:
systemctl restart ngenea-worker
5.3.2.3. Uninstalling your plugin¶
Uninstalling any of the plugins can be done through the uninstall script:
Warning
Be cautious when uninstalling plugins, as removing modules that aren’t directly in /var/lib/ngenea-worker/plugins
might cause Ngenea Worker to stop working properly.
Uninstall a Specific Plugin: If you want to uninstall a single plugin, use this command, replacing PACKAGE_NAME with the name of the plugin:
ngenea-worker plugins uninstall <PACKAGE_NAME>
Uninstall All Plugins in the Directory: If you want to uninstall all plugins in the plugin directory at once, run the following commands:
pushd /var/lib/ngenea-worker/plugins/
ngenea-worker plugins uninstall * -y
popd
This will uninstall all plugins in the /var/lib/ngenea-worker/plugins/
directory.
5.3.2.4. Listing your plugin¶
Listing your plugin involves two distinct sections:
Listing Installed Plugins: Displays only the plugins that are currently installed with versions.
Listing All Plugins: Displays all plugins available in the plugins directory with versions, located at
/var/lib/ngenea-worker/plugins
regardless of whether they are installed or not.
To list plugins, use the following command:
ngenea-worker plugins list