Centos9 support and removed centos7 support

This commit is contained in:
Spitap
2022-10-14 20:10:39 +02:00
parent b84abbbacc
commit b13cdbf0ba
8 changed files with 10 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
# Impacted versions # Impacted versions
* Distribution: Debian / Ubuntu / Centos * Distribution: Debian / Ubuntu / Centos
* Codename: Jessie / Trusty / Centos 7 / ... * Codename: Jessie / Trusty / Centos 9 Stream / ...
* Arch: 32 Bits / 64 Bits * Arch: 32 Bits / 64 Bits
* Database: PostgreSQL / MySQL * Database: PostgreSQL / MySQL

View File

@@ -11,11 +11,12 @@ An installer which deploy a complete mail server based on Modoboa.
* Debian Buster (10) / Bullseye (11) * Debian Buster (10) / Bullseye (11)
* Ubuntu Bionic Beaver (18.04) and upper * Ubuntu Bionic Beaver (18.04) and upper
* CentOS 7 * CentOS 9 Stream
.. warning:: .. warning::
``/tmp`` partition must be mounted without the ``noexec`` option. ``/tmp`` partition must be mounted without the ``noexec`` option.
Centos 7 support has been depreceated since modoboa requires python 3.7>=.
.. note:: .. note::

View File

@@ -42,7 +42,7 @@ class PostgreSQL(Database):
default_port = 5432 default_port = 5432
packages = { packages = {
"deb": ["postgresql", "postgresql-server-dev-all"], "deb": ["postgresql", "postgresql-server-dev-all"],
"rpm": ["postgresql-server", "postgresql-devel"] "rpm": ["postgresql-server", "postgresql-server-devel", "postgresql"]
} }
service = "postgresql" service = "postgresql"
@@ -54,20 +54,8 @@ class PostgreSQL(Database):
"""Install database if required.""" """Install database if required."""
name, version = utils.dist_info() name, version = utils.dist_info()
if "CentOS" in name: if "CentOS" in name:
if version.startswith("7"): initdb_cmd = "postgresql-setup initdb"
# Install newer version of postgres in this case cfgfile = "/var/lib/pgsql/data/pg_hba.conf"
package.backend.install(
"https://download.postgresql.org/pub/repos/yum/"
"reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
)
self.packages["rpm"] = [
"postgresql10-server", "postgresql10-devel"]
self.service = "postgresql-10"
initdb_cmd = "/usr/pgsql-10/bin/postgresql-10-setup initdb"
cfgfile = "/var/lib/pgsql/10/data/pg_hba.conf"
else:
initdb_cmd = "postgresql-setup initdb"
cfgfile = "/var/lib/pgsql/data/pg_hba.conf"
package.backend.install_many(self.packages[package.backend.FORMAT]) package.backend.install_many(self.packages[package.backend.FORMAT])
utils.exec_cmd(initdb_cmd) utils.exec_cmd(initdb_cmd)
pattern = "s/^host(.+)ident$/host$1md5/" pattern = "s/^host(.+)ident$/host$1md5/"

View File

@@ -22,7 +22,7 @@ class Amavis(base.Installer):
"unrar-free", "unrar-free",
], ],
"rpm": [ "rpm": [
"amavisd-new", "arj", "lz4", "lzop", "p7zip", "amavis", "arj", "lz4", "lzop", "p7zip",
], ],
} }
with_db = True with_db = True

View File

@@ -15,7 +15,7 @@ class Clamav(base.Installer):
packages = { packages = {
"deb": ["clamav-daemon"], "deb": ["clamav-daemon"],
"rpm": [ "rpm": [
"clamav", "clamav-update", "clamav-server", "clamav-server-systemd" "clamav", "clamav-update", "clamd"
], ],
} }

View File

@@ -34,17 +34,6 @@ class Postfix(base.Installer):
def install_packages(self): def install_packages(self):
"""Preconfigure postfix package installation.""" """Preconfigure postfix package installation."""
if "centos" in utils.dist_name():
config = configparser.ConfigParser()
with open("/etc/yum.repos.d/CentOS-Base.repo") as fp:
config.read_file(fp)
config.set("centosplus", "enabled", "1")
config.set("centosplus", "includepkgs", "postfix-*")
config.set("base", "exclude", "postfix-*")
config.set("updates", "exclude", "postfix-*")
with open("/etc/yum.repos.d/CentOS-Base.repo", "w") as fp:
config.write(fp)
package.backend.preconfigure( package.backend.preconfigure(
"postfix", "main_mailer_type", "select", "No configuration") "postfix", "main_mailer_type", "select", "No configuration")
super(Postfix, self).install_packages() super(Postfix, self).install_packages()

View File

@@ -17,7 +17,7 @@ class Uwsgi(base.Installer):
appname = "uwsgi" appname = "uwsgi"
packages = { packages = {
"deb": ["uwsgi", "uwsgi-plugin-python3"], "deb": ["uwsgi", "uwsgi-plugin-python3"],
"rpm": ["uwsgi", "uwsgi-plugin-python36"], "rpm": ["uwsgi", "uwsgi-plugin-python3"],
} }
def get_socket_path(self, app): def get_socket_path(self, app):

View File

@@ -97,7 +97,7 @@ class LetsEncryptCertificate(CertificateBackend):
self.config.has_option("nginx", "enabled") and self.config.has_option("nginx", "enabled") and
self.config.getboolean("nginx", "enabled") self.config.getboolean("nginx", "enabled")
): ):
if name == "ubuntu" or name.startswith("debian"): if name == "ubuntu" or name.startswith("debian") or ("Centos" in name and version.startswith("9")):
package.backend.install("python3-certbot-nginx") package.backend.install("python3-certbot-nginx")
def generate_cert(self): def generate_cert(self):