action_utils: Introduce utility for setting debconf answers

Tests:

mldonkey
 - Installs
 - /etc/default/mldonkey-server has LAUNCH_AT_STARTUP=true
 - systemctl status mldonkey-server shows daemon running

ejabberd
 - Installs
 - /etc/ejabberd/ejabberd.yml has domainname properly configured

privoxy
 - Installs
 - /etc/privoxy/config has listen-address set to '[::]:8118'

roundcube
 - Installs and works
 - /etc/roundcube/debian-db.php contains dbtype sqlite3

ttrss
 - Installs and works
 - /etc/ttrss/database.php has dbtype 'pgsql'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-31 08:24:59 -04:00
1 parent 12cf790dcd
commit ca8ea9427c
7 files changed
+34 -35

No files matched your search

+4 -7
View File
@@ -21,7 +21,6 @@ Configuration helper for Roundcube server.
import argparse
import re
import subprocess
from plinth import action_utils
@@ -44,12 +43,10 @@ def parse_arguments():
def subcommand_pre_install(_):
"""Preseed debconf values before packages are installed."""
subprocess.check_output(
['debconf-set-selections'],
input=b'roundcube-core roundcube/dbconfig-install boolean true')
subprocess.check_output(
['debconf-set-selections'],
input=b'roundcube-core roundcube/database-type string sqlite3')
action_utils.debconf_set_selections([
'roundcube-core roundcube/dbconfig-install boolean true',
'roundcube-core roundcube/database-type string sqlite3'
])
def subcommand_setup(_):