self.scp_to(local_file, remote_file)
+ # -------------------------------------------------------------------------
+ def ensure_root_authkeys(self):
+
+ bname = 'auth_keys_pp_betrieb'
+ local_file = self.base_dir / 'keys' / bname
+ remote_file = self.config.cobbler_ws_docroot / self.config.cobbler_ws_rel_filesdir / bname
+
+ self.ensure_remote_file(local_file, remote_file)
+
# -------------------------------------------------------------------------
def ensure_profile_ks(self):
from .xlate import XLATOR
-__version__ = '1.4.3'
+__version__ = '1.5.0'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
'pixelpark.com',
'pixelpark.de',
]
+ default_cobbler_ws_base_url = 'http://cobbler.pixelpark.com'
+ default_cobbler_ws_docroot = Path('/var/www/html')
+ default_cobbler_ws_rel_filesdir = Path('custom/vmware-template-files')
ssh_privkey = 'id_rsa_cr_vmw_tpl'
self.cobbler_profile_repos = copy.copy(self.default_cobbler_profile_repos)
self.cobbler_nameservers = copy.copy(self.default_cobbler_nameservers)
self.cobbler_dns_search = copy.copy(self.default_cobbler_dns_search)
+ self.cobbler_ws_base_url = self.default_cobbler_ws_base_url
+ self.cobbler_ws_docroot = self.default_cobbler_ws_docroot
+ self.cobbler_ws_rel_filesdir = self.default_cobbler_ws_rel_filesdir
self.excluded_datastores = []
re_pr_repos_key = re.compile(r'^\s*profile[-_]?repos?\s*$', re.IGNORECASE)
re_nameserver_key = re.compile(r'^\s*nameservers?\s*$', re.IGNORECASE)
re_dns_search_key = re.compile(r'^\s*dns[-_]?search\s*$', re.IGNORECASE)
+ re_ws_base_url_key = re.compile(
+ r'^\s*(?:ws|webserver)[-_]?base[-_]?url\s*$', re.IGNORECASE)
+ re_ws_docroot_key = re.compile(
+ r'^\s*(?:ws|webserver)[-_]?docroot\s*$', re.IGNORECASE)
+ re_ws_rel_filesdir_key = re.compile(
+ r'^\s*(?:ws|webserver)[-_]?rel(?:ative)?[-_]?filesdir\s*$', re.IGNORECASE)
for (key, value) in config.items(section_name):
if key.lower() == 'distro' and value.strip() != '':
if dpath.is_absolute():
self.cobbler_rootdir = Path(value)
else:
- msg = _("Path for Cobbler root directory {!r} is not absolute.").format(
- str(dpath))
+ msg = _("Path for {what} {path!r} is not absolute.").format(
+ what=_("Cobbler root directory"), path=str(dpath))
LOG.error(msg)
continue
if key.lower() == 'profile' and value.strip() != '':
if re_dns_search_key.match(key) and value.strip() != '':
self.cobbler_dns_search = re_split_values.split(value.strip().lower())
continue
-
+ if re_ws_base_url_key.match(key) and value.strip() != '':
+ self.cobbler_ws_base_url = value.strip().lower()
+ continue
+ if re_ws_docroot_key.match(key) and value.strip() != '':
+ dpath = Path(value.strip())
+ if dpath.is_absolute():
+ self.cobbler_ws_docroot = dpath
+ else:
+ msg = _("Path for {what} {path!r} is not absolute.").format(
+ what=_("Webserver document root"), path=str(dpath))
+ LOG.error(msg)
+ continue
+ if re_ws_rel_filesdir_key.match(key) and value.strip() != '':
+ self.cobbler_ws_rel_filesdir = Path(value.strip())
# =============================================================================
if __name__ == "__main__":