.
This commit is contained in:
parent
8ecb1687b3
commit
cac777ffeb
BIN
salt/states/atftp/files/opensuse.png
Normal file
BIN
salt/states/atftp/files/opensuse.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 673 KiB |
71
salt/states/atftp/files/pxelinux.cfg/default
Normal file
71
salt/states/atftp/files/pxelinux.cfg/default
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
#DEFAULT vesamenu.c32
|
||||||
|
#PROMPT 0
|
||||||
|
UI vesamenu.c32
|
||||||
|
TIMEOUT 150
|
||||||
|
ONTIMEOUT local
|
||||||
|
|
||||||
|
|
||||||
|
MENU TITLE Transportable Lab Unit PXE Menu
|
||||||
|
MENU RESOLUTION 1024 768
|
||||||
|
MENU BACKGROUND opensuse.png
|
||||||
|
|
||||||
|
# color codes in #AARRGGBB notation, where AA RR GG BB are hexadecimal digits for
|
||||||
|
# alpha (opacity), red, green and blue, respectively. #00000000 represents fully
|
||||||
|
# transparent, and #ffffffff represents opaque white.
|
||||||
|
#MENU COLOR element ansi foreground background shadow
|
||||||
|
|
||||||
|
MENU COLOR screen 0 #80ffffff #00000000 std # background colour not covered by the splash image
|
||||||
|
MENU COLOR border 0 #ffffffff #ee000000 std # The wire-frame border
|
||||||
|
MENU COLOR title 0 #ff30ba78 #ee000000 std # Menu title text
|
||||||
|
MENU COLOR sel 0 #ff7ad4aa #ee000000 std # Selected menu option
|
||||||
|
MENU COLOR hotsel 0 #ffff8e77 #ee000000 std # The selected hotkey (set with ^ in MENU LABEL)
|
||||||
|
MENU COLOR unsel 0 #ffffffff #ee000000 std # Unselected menu options
|
||||||
|
MENU COLOR hotkey 0 #ffff8e77 #ee000000 std # Unselected hotkeys (set with ^ in MENU LABEL)
|
||||||
|
MENU COLOR tabmsg 0 #c07ad4aa #00000000 std # Tab text
|
||||||
|
MENU COLOR timeout_msg 0 #807ad4aa #00000000 std # Timout text
|
||||||
|
MENU COLOR timeout 0 #c0ff6a52 #00000000 std # Timout counter
|
||||||
|
MENU COLOR disabled 0 #807f7f7f #ee000000 std # Disabled menu options, including SEPARATORs
|
||||||
|
MENU COLOR cmdmark 0 #c000ffff #ee000000 std # Command line marker - The '> ' on the left when editing an option
|
||||||
|
MENU COLOR cmdline 0 #c0ffffff #ee000000 std # Command line - The text being edited
|
||||||
|
# Options below haven't been tested, descriptions may be lacking.
|
||||||
|
MENU COLOR scrollbar 0 #40000000 #00000000 std # Scroll bar
|
||||||
|
MENU COLOR pwdborder 0 #80ffffff #20ffffff std # Password box wire-frame border
|
||||||
|
MENU COLOR pwdheader 0 #80ff8080 #20ffffff std # Password box header
|
||||||
|
MENU COLOR pwdentry 0 #80ffffff #20ffffff std # Password entry field
|
||||||
|
MENU COLOR help 0 #c0ffffff #00000000 std # Help text, if set via 'TEXT HELP ... ENDTEXT'
|
||||||
|
|
||||||
|
LABEL local
|
||||||
|
MENU LABEL Boot local
|
||||||
|
localboot
|
||||||
|
|
||||||
|
MENU BEGIN opensuse
|
||||||
|
MENU TITLE openSUSE Installs
|
||||||
|
LABEL Previous
|
||||||
|
MENU LABEL ^Previous Menu
|
||||||
|
MENU EXIT
|
||||||
|
MENU SEPARATOR
|
||||||
|
MENU INCLUDE pxelinux.cfg/opensuse.menu
|
||||||
|
MENU END
|
||||||
|
|
||||||
|
MENU BEGIN home_servers
|
||||||
|
MENU TITLE Servers at Home
|
||||||
|
LABEL Previous
|
||||||
|
MENU LABEL ^Previous Menu
|
||||||
|
MENU EXIT
|
||||||
|
MENU SEPARATOR
|
||||||
|
MENU INCLUDE pxelinux.cfg/home_servers.menu
|
||||||
|
MENU END
|
||||||
|
|
||||||
|
MENU BEGIN tools
|
||||||
|
MENU TITLE Tools
|
||||||
|
LABEL Previous
|
||||||
|
MENU LABEL ^Previous Menu
|
||||||
|
MENU EXIT
|
||||||
|
MENU SEPARATOR
|
||||||
|
MENU INCLUDE pxelinux.cfg/tools.menu
|
||||||
|
MENU END
|
||||||
|
|
||||||
|
LABEL poweroff
|
||||||
|
MENU LABEL Power Off
|
||||||
|
COMBOOT poweroff.com
|
||||||
|
|
27
salt/states/atftp/init.sls
Normal file
27
salt/states/atftp/init.sls
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
Install syslinux:
|
||||||
|
pkg.installed:
|
||||||
|
- name: syslinux
|
||||||
|
|
||||||
|
Install atftp:
|
||||||
|
pkg.installed:
|
||||||
|
- name: atftp
|
||||||
|
|
||||||
|
|
||||||
|
{% set files = ['memdisk', 'poweroff.com', 'pxelinux.0', 'vesamenu.c32'] -%}
|
||||||
|
{% for file in files -%}
|
||||||
|
Linking {{ file }}:
|
||||||
|
file.symlink:
|
||||||
|
- name: /srv/tftpboot/{{ file }}
|
||||||
|
- target: /usr/share/syslinux/{{ file }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
Add files to tftpboot:
|
||||||
|
file.recurse:
|
||||||
|
- name: /srv/tftpboot
|
||||||
|
- source: salt://atftp/files
|
||||||
|
- include_empty: True
|
||||||
|
|
||||||
|
Start the atftpd.socket:
|
||||||
|
service.running:
|
||||||
|
- name: atftpd.socket
|
||||||
|
- enable: True
|
@ -5,6 +5,7 @@ gi.require_version("Gtk", "3.0")
|
|||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from gi.repository import Gio
|
from gi.repository import Gio
|
||||||
|
from gi.repository import GLib
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
@ -80,24 +81,22 @@ class Main:
|
|||||||
"rmt-server-sync.timer",
|
"rmt-server-sync.timer",
|
||||||
"rmt-server-mirror.timer",
|
"rmt-server-mirror.timer",
|
||||||
"rmt-server-systems-scc-sync.timer",
|
"rmt-server-systems-scc-sync.timer",
|
||||||
"atftp.socket",
|
"atftpd.socket",
|
||||||
"mariadb"
|
"mariadb"
|
||||||
]
|
]
|
||||||
|
|
||||||
self.update()
|
timer_thread = threading.Thread(target=self.update)
|
||||||
|
|
||||||
|
|
||||||
def update(self):
|
|
||||||
logging.debug("Update triggered")
|
|
||||||
self.check_service()
|
|
||||||
self.check_ip()
|
|
||||||
timer_thread = threading.Thread(target=self.sleep)
|
|
||||||
timer_thread.daemon = True
|
timer_thread.daemon = True
|
||||||
timer_thread.start()
|
timer_thread.start()
|
||||||
|
|
||||||
def sleep(self):
|
|
||||||
|
def update(self):
|
||||||
|
while True:
|
||||||
|
logging.debug("Update triggered")
|
||||||
|
GLib.idle_add(self.check_service)
|
||||||
|
GLib.idle_add(self.check_ip)
|
||||||
time.sleep(SLEEPTIMER)
|
time.sleep(SLEEPTIMER)
|
||||||
self.update()
|
|
||||||
|
|
||||||
def check_service(self):
|
def check_service(self):
|
||||||
for service in self.service_checks:
|
for service in self.service_checks:
|
||||||
@ -106,10 +105,10 @@ class Main:
|
|||||||
result = subprocess.run(["systemctl", "is-active", service, "--quiet"])
|
result = subprocess.run(["systemctl", "is-active", service, "--quiet"])
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
logging.debug("%s is running", service)
|
logging.debug("%s is running", service)
|
||||||
image.set_from_gicon(self.icon_ok, Gtk.IconSize.DIALOG)
|
image.set_from_gicon(self.icon_ok, Gtk.IconSize.BUTTON)
|
||||||
else:
|
else:
|
||||||
logging.debug("%s is not running, exit code %i",service, result.returncode)
|
logging.debug("%s is not running, exit code %i",service, result.returncode)
|
||||||
image.set_from_gicon(self.icon_not_ok, Gtk.IconSize.DIALOG)
|
image.set_from_gicon(self.icon_not_ok, Gtk.IconSize.BUTTON)
|
||||||
|
|
||||||
def check_ip(self):
|
def check_ip(self):
|
||||||
#checking LAN network
|
#checking LAN network
|
||||||
|
Loading…
Reference in New Issue
Block a user