The final beacon module
When all is said and done, our final beacon module will look like this:
''' Send events covering nspawn containers This beacon accepts a list of containers and whether they should be running or absent: .. code-block:: yaml beacons: nspawn: vsftpd: running httpd: absent This file should be saved as salt/beacons/nspawn.py ''' import time __virtualname__ = 'nspawn' def __virtual__(): ''' Ensure that systemd-nspawn is available ''' if 'nspawn.list_running' in __salt__: return __virtualname__ return False def validate(config): ''' Validate the beacon configuration ''' if not isinstance(config, dict): return False for key in config: if config[key] not in ('running', 'absent'): return False return True def beacon...