Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mbussolotto:branches:systemsmanagement:Uyuni:Master
proxy-tftpd-image
uyuni-configure.py
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File uyuni-configure.py of Package proxy-tftpd-image
#!/usr/bin/python3 import logging import os import yaml import sys config_path = "/etc/uyuni/" # read from file with open(config_path + "config.yaml") as source: config = yaml.safe_load(source) # log_level is the value for rhn.conf and should be a positive integer log_level = logging.WARNING if config.get("log_level") == 1 else logging.DEBUG logging.getLogger().setLevel(log_level) # store SSL CA certificate os.mkdir("/usr/share/uyuni/") with open("/usr/share/uyuni/ca.crt", "w") as file: file.write(config.get("ca_crt")) tftp_config = "/etc/sysconfig/tftp" tftp_root = "/srv/tftpboot" with open(tftp_config, "w") as file: file.write(f'''# Automatically generated Uyuni Proxy Server configuration file. TFTP_USER="tftp" TFTP_OPTIONS="{config.get('tftp_options', '')} " TFTP_DIRECTORY="{tftp_root}"''') os.system(f"chmod 640 {tftp_config}") # Make sure we can read if not os.access(tftp_root, os.R_OK | os.X_OK): logging.critical("TFTP root directory does not have correct permissions.") sys.exit(1) sys.exit(0)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor