Commit 3413c0bc authored by Rene Hadler's avatar Rene Hadler

Add puppet client support

parent d5c44239
......@@ -88,7 +88,7 @@ def gui_password_box(title, text):
return run_cmd_stderr(["whiptail", "--backtitle", TITLE, "--passwordbox", text.encode('UTF-8'), "8", str(GUI_WIN_WIDTH), "--title", title.encode('UTF-8')])
def gui_menu_box(title, text, menu):
return run_cmd_stderr(["whiptail", "--backtitle", TITLE, "--menu", text, "--title", title, "24", str(GUI_WIN_WIDTH), "18"] + menu)
return run_cmd_stderr(["whiptail", "--backtitle", TITLE, "--menu", text, "--title", title, "26", str(GUI_WIN_WIDTH), "20"] + menu)
def gui_checklist_box(title, text, checklist):
ret = run_cmd_stderr(["whiptail", "--backtitle", TITLE, "--checklist", text, "--title", title, "24", str(GUI_WIN_WIDTH), "14"] + checklist)
......@@ -212,6 +212,7 @@ class Installer():
self.share_clients = []
self.proxy = True
self.desktop = "kein"
self.puppet = "kein"
# Installer Variablen
self.MACHINE_VENDORS = {"hp": "HP < Gen 10", "hp10": "HP Gen 10", "dell": "Dell iDRAC < 9", "dell9": "Dell iDRAC 9", "other": "Andere"}
......@@ -220,26 +221,31 @@ class Installer():
self.MONITORINGS = {"nagios": "Nagios NRPE", "checkmk": "CheckMK Agent"}
self.FILESYSTEMS = {"standard": "Standard (ext3/4, reiserfs, xfs)", "zfs": "ZFS"}
self.DESKTOPS = {
"kein": "Nein",
"plasma": "KDE5-Plasma",
"plasma-light": "KDE5-Plasma Light",
"plasma-light-win": "KDE5-Plasma Light Windows Workstation",
"i3": "i3-WM (testing)"
}
"kein": "Nein",
"plasma": "KDE5-Plasma",
"plasma-light": "KDE5-Plasma Light",
"plasma-light-win": "KDE5-Plasma Light Windows Workstation",
"i3": "i3-WM (testing)"
}
self.VM_IMPORTS = {
"139": {"name": "Windows 7 Pro", "template": True},
"138": {"name": "Windows 10 Pro EDBS Update static", "template": True},
"166": {"name": "Windows 10 Pro", "template": True},
"117": {"name": "Windows Server 2008 r2", "template": True},
"120": {"name": "Windows Server 2012 r2", "template": True},
"162": {"name": "Windows Server 2016", "template": True},
"169": {"name": "Windows Server 2019", "template": True},
"131": {"name": "CentOS Server Standard", "template": True},
"152": {"name": "CentOS Server StyrionLDAP", "template": True},
"145": {"name": "CentOS Mailserver", "template": True},
"129": {"name": "Ubuntu Server Standard", "template": True},
"101": {"name": "Ubuntu Server StyrionLDAP", "template": True}
}
"139": {"name": "Windows 7 Pro", "template": True},
"138": {"name": "Windows 10 Pro EDBS Update static", "template": True},
"166": {"name": "Windows 10 Pro", "template": True},
"117": {"name": "Windows Server 2008 r2", "template": True},
"120": {"name": "Windows Server 2012 r2", "template": True},
"162": {"name": "Windows Server 2016", "template": True},
"169": {"name": "Windows Server 2019", "template": True},
"131": {"name": "CentOS Server Standard", "template": True},
"152": {"name": "CentOS Server StyrionLDAP", "template": True},
"145": {"name": "CentOS Mailserver", "template": True},
"129": {"name": "Ubuntu Server Standard", "template": True},
"101": {"name": "Ubuntu Server StyrionLDAP", "template": True}
}
self.PUPPETS = {
"kein": "Nein",
"generic": "Generische Installation",
"proxmox-desktop": "Proxmox Desktop"
}
def start(self):
gui_message_box("Installer", "Willkommen beim iteas Proxmox Installer!")
......@@ -267,6 +273,7 @@ class Installer():
"apt-Proxy", "Nein" if self.proxy == False else "Ja",
"Desktop", self.DESKTOPS[self.desktop],
"Monitoring-Agent", self.MONITORINGS[self.monitoring],
"Puppet", self.PUPPETS[self.puppet],
" ", " ",
"Weiter", "Installation fortsetzen"])
......@@ -315,6 +322,9 @@ class Installer():
elif step1_val[1] == "Weiter":
self.step2()
elif step1_val[1] == "Puppet":
self.step1_puppet()
else:
self.step1()
......@@ -463,6 +473,20 @@ class Installer():
self.share_clients = retval[1].split(" ")
self.step1()
def step1_puppet(self):
list = []
for key, val in self.PUPPETS.items():
list += [key, val, "ON" if self.puppet == key else "OFF"]
retval = gui_radiolist_box("Schritt 1: Puppet", "Waehlen sie eine Puppet Installationsart", list)
# Abbrechen
if retval[0] == 1 or retval[0] == 255:
self.step1()
return
self.puppet = retval[1]
self.step1()
def step2(self):
# Set locales
file_replace_line("/etc/locale.gen", "# de_AT.UTF-8 UTF-8", "de_AT.UTF-8 UTF-8")
......@@ -881,6 +905,14 @@ class Installer():
elif self.desktop == "i3":
pass
# Install puppet
if self.puppet == "generic":
run_cmd('wget -O /tmp/install_puppet.sh https://git.styrion.net/iteas/iteas-tools/raw/master/puppet/proxmox_mit_puppet.sh && chmod +x /tmp/install_puppet.sh', argShell=True)
run_cmd('echo "\n" | /tmp/install_puppet.sh', argShell=True)
elif self.puppet == "proxmox-desktop":
run_cmd('wget -O /tmp/install_puppet.sh https://git.styrion.net/iteas/iteas-tools/raw/master/puppet/proxmox_mit_puppet.sh && chmod +x /tmp/install_puppet.sh', argShell=True)
run_cmd('echo "\n" | /tmp/install_puppet.sh', argShell=True)
run_cmd('apt-get install -f; apt autoremove --purge -y;')
if self.proxy == True:
run_cmd('rm /etc/apt/apt.conf.d/01proxy')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment