Rex::Co...PkgConf(3)
π Rex::Commands::PkgConf β Configure packages π
okay bestie, welcome to the User Contributed Perl Documentation page for Rex::Commands::PkgConf, and honestly? it's giving "small but mighty" π
β¨ NAME β¨
Rex::Commands::PkgConf β Configure packages π
πΈ DESCRIPTION πΈ
So this module lets you configure packages. rn it only supports Debian (using debconf), but it's designed to be extendable β main character energy, it's gonna grow π¦
π¦ SYNOPSIS π¦
here's the whole vibe, copy these exactly bestie:
my %options = get_pkgconf('postfix');
say $options{'postfix/relayhost'}->{value};
# Only obtain one value
my %options = get_pkgconf('postfix', 'postfix/relayhost');
say $options{'postfix/relayhost'}->{value};
# Set options
set_pkgconf("postfix", [
{question => 'chattr', type => 'boolean', value => 'false'},
{question => 'relayhost', type => 'string', value => 'relay.example.com'},
]);
# Don't update if it's already set
set_pkgconf("mysql-server-5.5", [
{question => 'mysql-server/root_password', type => 'string', value => 'mysecret'},
{question => 'mysql-server/root_password_again', type => 'string', value => 'mysecret'},
], no_update => 1);
π EXPORTED FUNCTIONS π
β get_pkgconf($package, [$question]) β
use this to query the package configs that already exist β like a little vibe check on what's already set π
- no question specified? it returns all the options for that package as a hash π
- question specified? it returns just that one option, slay
each question comes back with the question itself as the key, and the value is a hashref π that hashref has these keys: question, value and already_set. and already_set is true if the question has already been answered β iykyk β
# Only obtain one value
my %options = get_pkgconf('postfix', 'postfix/relayhost');
say $options{'postfix/relayhost'}->{question};
say $options{'postfix/relayhost'}->{value};
say $options{'postfix/relayhost'}->{already_set};
β set_pkgconf($package, $values, [%options]) β
use this one to set package configs, periodt π
you gotta specify at least the package name and the values. the values must be an array ref, and each item in it holds a hashref with the attributes that are required by the package configuration program π«Ά
for example, for debconf, this must be the question, the type and the answer π and in that case, the types can be any acceptable debconf type: string, boolean, select, multiselect, note, text, password.
optionally the option "no_update" may be true β in which case the question will not be updated if it has already been set π
heads up bestie: if you pass no_update, it really does skip the update when the thing's already set. no cap.
see the synopsis for the examples, they're right up there β¬οΈβ¨
and that's the whole page, bestie! π go forth and configure those packages π
mwah π β signed off with perl v5.42.3, dated 2023-08-05, from the Rex::Co...PkgConf(3) girlies π§
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms