Sometimes hosts may not be configured within WATO itself, but imported from a CMDB. In this case it is important that these host are never modified by WATO itself, since any update from the CMDB would discard any changes made in the configuration files.
2. New Locking Mechanism
2.1. Locking hosts (hosts.mk)
The hosts.mk supports the new variable _lock, which can be set to True or a string of your choice. This variable is an indicator for WATO, that all hosts in this hosts.mk are fixed. As a consequence some of the modify options within this folder are disabled
- The buttons "New Host", "New Cluster" and "Parentscan" are removed
- The host icons "Delete" and "Clone" are dropped
- The host can now longer be moved to another folder
- The checkboxes are removed in the host properties and
- The buttons "Save & Finish", "Save & go to services" and "Delete host" are gone
- Bulk operations "Delete", "Edit", "Cleanup", "Parentscan" and "Move" are no longer available
A note is displayed within the folder view in case the attribute _lock is set. If _lock is set to True a generic info is displayed. If no generic info should be shown you can set the variable _lock to a string of you choice, which is displayed instead. Setting this string to "" still enables the lock of this folder but disables any note displayed on the screen. With this feature you can create small comments for each hosts.mk describing its purpose more in detail.
2.2. Locking folders (.wato)
Similar to the lock of the hosts.mk, folders can be locked, too. Adding the variable lock in the .wato file WATO performs the following actions
- The button "Save & finish" is removed from folder properities
- The checkboxes are removed from folder properties
Additionally, you can set a variable lock_subfolders which prevents any changes in the folder structure
- No folders can be created or deleted within this folder
- The deletion of this folder is no longer avaialable
The locking mechanism ensures that the provided hosts.mk and .wato files are by any menas never written again through the WATO. This means in reverse that an update of these files is unavailable, which might be neccessary in case of changes in the inherited host tags. This restriction requires that all host tags within the hosts.mk files are complete and do not rely on inherited values.