You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.8 KiB

"""EasyEngine core variable module"""
import platform
import socket
import configparser
import os
10 years ago
import sys
class EEVariables():
"""Intialization of core variables"""
config = configparser.ConfigParser()
config.read(os.path.expanduser("~")+'/.gitconfig')
# EasyEngine core variables
ee_platform_distro = platform.linux_distribution()[0]
ee_platform_version = platform.linux_distribution()[1]
ee_platform_codename = platform.linux_distribution()[2]
# Get FQDN of system
ee_fqdn = socket.getfqdn()
# Get git user name and EMail
10 years ago
try:
ee_user = config['user']['name']
ee_email = config['user']['email']
except KeyError as e:
print("Unable to find GIT user name and Email")
sys.exit(1)
# EasyEngine stack installation varibales
# Nginx repo and packages
if ee_platform_distro == 'Ubuntu':
ee_nginx_repo = "ppa:rtcamp/nginx"
elif ee_platform_distro == 'Debian':
ee_nginx_repo = ("deb http://packages.dotdeb.org {codename} all"
.format(codename=ee_platform_codename))
ee_nginx = ["nginx-custom"]
# PHP repo and packages
10 years ago
if ee_platform_distro == 'Ubuntu':
ee_php_repo = "ppa:ondrej/php5"
elif ee_platform_codename == 'squeeze':
ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php54 all"
.format(codename=ee_platform_codename))
elif ee_platform_codename == 'wheezy':
ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php55 all"
.format(codename=ee_platform_codename))
ee_php = ["php5-curl", "php5-gd", "php5-cli", "php5-fpm", "php5-imap",
"php5-mcrypt", "php5-xdebug"]
# MySQL repo and packages
ee_mysql_repo = ("deb http://repo.percona.com/apt {codename} main"
.format(codename=ee_platform_codename))
10 years ago
ee_mysql = ["percona-server-server-5.6"]
# Postfix repo and packages
ee_postfix_repo = ""
ee_postfix = ["postfix"]
10 years ago
# Mail repo and packages
ee_mail_repo = ("deb http://http.debian.net/debian-backports {codename}"
"-backports main".format(codename=ee_platform_codename))
ee_mail = ["dovecot-core", "dovecot-imapd", "dovecot-pop3d",
"dovecot-lmtpd", "dovecot-mysql", "dovecot-sieve",
"dovecot-managesieved", "postfix-mysql", "php5-cgi",
"php5-json", "php-gettext"]
10 years ago
# Mailscanner repo and packages
ee_mailscanner_repo = ()
ee_mailscanner = ["amavisd-new", "spamassassin", "clamav", "clamav-daemon",
"arj", "zoo", "nomarch", "cpio", "lzop",
"cabextract", "p7zip", "rpm", "unrar-free"]
# Repo path
10 years ago
ee_repo_file = "ee-repo.list"
10 years ago
ee_repo_file_path = ("/etc/apt/sources.list.d/" + ee_repo_file)
10 years ago
def __init__(self):
pass