7.1.7. cobbler.modules package
7.1.7.1. Subpackages
- 7.1.7.1.1. cobbler.modules.authentication package
- 7.1.7.1.1.1. Submodules
- 7.1.7.1.1.2. cobbler.modules.authentication.configfile module
- 7.1.7.1.1.3. cobbler.modules.authentication.denyall module
- 7.1.7.1.1.4. cobbler.modules.authentication.ldap module
- 7.1.7.1.1.5. cobbler.modules.authentication.pam module
- 7.1.7.1.1.6. cobbler.modules.authentication.passthru module
- 7.1.7.1.1.7. cobbler.modules.authentication.spacewalk module
- 7.1.7.1.1.8. Module contents
- 7.1.7.1.2. cobbler.modules.authorization package
- 7.1.7.1.3. cobbler.modules.installation package
- 7.1.7.1.3.1. Submodules
- 7.1.7.1.3.2. cobbler.modules.installation.post_log module
- 7.1.7.1.3.3. cobbler.modules.installation.post_power module
- 7.1.7.1.3.4. cobbler.modules.installation.post_puppet module
- 7.1.7.1.3.5. cobbler.modules.installation.post_report module
- 7.1.7.1.3.6. cobbler.modules.installation.pre_clear_anamon_logs module
- 7.1.7.1.3.7. cobbler.modules.installation.pre_log module
- 7.1.7.1.3.8. cobbler.modules.installation.pre_puppet module
- 7.1.7.1.3.9. Module contents
- 7.1.7.1.4. cobbler.modules.managers package
- 7.1.7.1.4.1. Submodules
- 7.1.7.1.4.2. cobbler.modules.managers.bind module
- 7.1.7.1.4.3. cobbler.modules.managers.dnsmasq module
- 7.1.7.1.4.4. cobbler.modules.managers.genders module
- 7.1.7.1.4.5. cobbler.modules.managers.import_signatures module
- 7.1.7.1.4.6. cobbler.modules.managers.in_tftpd module
- 7.1.7.1.4.7. cobbler.modules.managers.isc module
- 7.1.7.1.4.8. cobbler.modules.managers.ndjbdns module
- 7.1.7.1.4.9. Module contents
- 7.1.7.1.5. cobbler.modules.serializers package
7.1.7.2. Submodules
7.1.7.3. cobbler.modules.nsupdate_add_system_post module
Replace (or remove) records in DNS zone for systems created (or removed) by Cobbler
- cobbler.modules.nsupdate_add_system_post.nslog(msg: str) None[source]
Log a message to the logger.
- Parameters:
msg – The message to log.
- cobbler.modules.nsupdate_add_system_post.register() str[source]
This method is the obligatory Cobbler registration hook.
- Returns:
The trigger name or an empty string.
- cobbler.modules.nsupdate_add_system_post.run(api: CobblerAPI, args: List[Any])[source]
This method executes the trigger, meaning in this case that it updates the dns configuration.
- Parameters:
api – The api to read metadata from.
args – Metadata to log.
- Returns:
“0” on success or a skipped task. If the task failed or problems occurred then an exception is raised.
7.1.7.4. cobbler.modules.nsupdate_delete_system_pre module
Replace (or remove) records in DNS zone for systems created (or removed) by Cobbler
- cobbler.modules.nsupdate_delete_system_pre.nslog(msg: str) None[source]
Log a message to the logger.
- Parameters:
msg – The message to log.
- cobbler.modules.nsupdate_delete_system_pre.register() str[source]
This method is the obligatory Cobbler registration hook.
- Returns:
The trigger name or an empty string.
- cobbler.modules.nsupdate_delete_system_pre.run(api: CobblerAPI, args: List[Any])[source]
This method executes the trigger, meaning in this case that it updates the dns configuration.
- Parameters:
api – The api to read metadata from.
args – Metadata to log.
- Returns:
“0” on success or a skipped task. If the task failed or problems occurred then an exception is raised.
7.1.7.5. cobbler.modules.scm_track module
Cobbler Trigger Module that puts the content of the Cobbler data directory under version control. Depending on
scm_track_mode in the settings, this can either be git or Mercurial.
- cobbler.modules.scm_track.register() str[source]
This pure python trigger acts as if it were a legacy shell-trigger, but is much faster. The return of this method indicates the trigger type :return: Always:
/var/lib/cobbler/triggers/change/*
- cobbler.modules.scm_track.run(api: CobblerAPI, args: Any)[source]
Runs the trigger, meaning in this case track any changed which happen to a config or data file.
- Parameters:
api – The api instance of the Cobbler server. Used to look up if scm_track_enabled is true.
args – The parameter is currently unused for this trigger.
- Returns:
0 on success, otherwise an exception is risen.
7.1.7.6. cobbler.modules.sync_post_restart_services module
Restarts the DHCP and/or DNS after a Cobbler sync to apply changes to the configuration files.
- cobbler.modules.sync_post_restart_services.register() str[source]
This pure python trigger acts as if it were a legacy shell-trigger, but is much faster. The return of this method indicates the trigger type
- Returns:
Always
/var/lib/cobbler/triggers/sync/post/*
- cobbler.modules.sync_post_restart_services.run(api: CobblerAPI, args: List[str]) int[source]
Run the trigger via this method, meaning in this case that depending on the settings dns and/or dhcp services are restarted.
- Parameters:
api – The api to resolve settings.
args – This parameter is not used currently.
- Returns:
The return code of the service restarts.
7.1.7.7. cobbler.modules.sync_post_wingen module
Create Windows boot files
To create Windows boot files, files are used that must be extracted from the distro. The cobbler import”
command extracts the required files and places them where the given trigger expects them to be found.
- To create boot files per profile/system, the trigger uses the following metadata from
--autoinstall-meta: kernel- the name of the bootstrap file for profile/system, can be:any filename, in the case of PXE boot without using
wimbootwhich is not the same as the filename for other profiles/systems of that distro. The trigger creates it from a copy ofpxeboot.n12by replacing thebootmgr.exestring in the binary copy with thebootmgrmetadata value. In the case of Windows XP/2003, it replaces theNTLDRstring.in case of PXE boot using
wimboot, specify the path towimbootin the file system, e.g/var/lib/tftpboot/wimbootin case of iPXE boot using
wimboot, specify the path towimbootin the file system or any url that supports iPXE, e.ghttp://@@http_server@@/cobbler/images/@@distro_name@@/wimboot
bootmgr- filename of the Boot Manager for the profile/system. The trigger creates it by copyingbootmgr.exeand replacing theBCDstring in the binary copy with the string specified in thebcdmetadata parameter. The filename must be exactly 11 characters long, e.g.bootmg1.exe,bootmg2.exe, ..and not match the names for other profiles/systems of the same distro. For Windows XP/2003,setupldr.exeis used as the Boot Manager and the stringwinnt.sifis replaced in its copy.bcd- The name of the Windows Boot Configuration Data (BCD) file for the profile/system. Must be exactly 3 characters and not the same as names for other profiles/systems on the same distro, e.g.000,001, etc.winpe- The name of the Windows PE image file for the profile/system. The trigger copies it from the distro and replaces the/Windows/System32/startnet.cmdfile in it with the one created from thestartnet.templatetemplate. Filenames must be unique per the distro.answerfile- the name of the answer file for the Windows installation, e.g.autounattend01.xmlor`` win01.sif`` for Windows XP/2003. The trigger creates the answerfile from theanswerfile.template. Filenames must be unique per the distro.post_install_script- The name of the post-installation script file that will be run after Windows is installed. To run a script, its filename is substituted into the answerfile template. Any valid Windows commands can be used in the script, but its usual purpose is to download and run the script for the profile fromhttp://@@http_server@@/cblr/svc/op/autoinstall/profile/@@profile_name@@, for this the script is passed profile name as parameter . The post-installation script is created by a trigger from thepost_inst_cmd.templatetemplate in thesources/$OEM$/$1distro directory only if it exists. The Windows Installer copies the contents of this directory to the target host during installation.any other key/value pairs that can be used in
startnet.template,answerfile.template,post_inst_cmd.templatetemplates
- cobbler.modules.sync_post_wingen.bcdedit(orig_bcd: str, new_bcd: str, wim: str, sdi: str, startoptions: str | None = None)[source]
Create new Windows Boot Configuration Data (BCD) based on Microsoft BCD extracted from a WIM image.
- Parameters:
orig_bcd – Path to the original BCD
new_bcd – Path to the new customized BCD
wim – Path to the WIM image
sdi – Path to the System Deployment Image (SDI)
startoptions – Other BCD options
- Returns:
- cobbler.modules.sync_post_wingen.register() str | None[source]
This pure python trigger acts as if it were a legacy shell-trigger, but is much faster. The return of this method indicates the trigger type :return: Always
/var/lib/cobbler/triggers/sync/post/*
- cobbler.modules.sync_post_wingen.run(api: CobblerAPI, args: Any)[source]
Runs the trigger, meaning in this case creates Windows boot files.
- Parameters:
api – The api instance of the Cobbler server. Used to look up if windows_enabled is true.
args – The parameter is currently unused for this trigger.
- Returns:
0 on success, otherwise an exception is risen.
7.1.7.8. Module contents
This part of Cobbler may be utilized by any plugins which are extending Cobbler and core code which can be exchanged
through the modules.conf file.
A Cobbler module is loaded if it has a method called register(). The method must return a str which represents
the module category.