salt.beacons.bonjour_announce
Beacon to announce via Bonjour (zeroconf)
-
Broadcast values via zeroconf
If the announced values are static, it is advised to set run_once: True (do not poll) on the beacon configuration.
The following are required configuration settings:
servicetype
- The service type to announceport
- The port of the service to announce-
txt
- The TXT record of the service being announced as a dict. Grains can be used to define TXT values using one of following two formats:grains.<grain_name>
grains.<grain_name>[i]
where i is an integer representing the index of the grain to use. If the grain is not a list, the index is ignored.
The following are optional configuration settings:
servicename
- Set the name of the service. Will use the hostname from the minion'shost
grain if this value is not set.reset_on_change
- IfTrue
and there is a change in TXT records detected, it will stop announcing the service and then restart announcing the service. This interruption in service announcement may be desirable if the client relies on changes in the browse records to update its cache of TXT records. Defaults toFalse
.reset_wait
- The number of seconds to wait after announcement stops announcing and before it restarts announcing in the case where there is a change in TXT records detected andreset_on_change
isTrue
. Defaults to0
.copy_grains
- IfTrue
, Salt will copy the grains passed into the beacon when it backs them up to check for changes on the next iteration. Normally, instead of copy, it would use straight value assignment. This will allow detection of changes to grains where the grains are modified in-place instead of completely replaced. In-place grains changes are not currently done in the main Salt code but may be done due to a custom plug-in. Defaults toFalse
.
Example Config
beacons: bonjour_announce: - run_once: True - servicetype: _demo._tcp - port: 1234 - txt: ProdName: grains.productname SerialNo: grains.serialnumber Comments: 'this is a test'
salt.beacons.bonjour_announce.beacon(config)
-
Validate the beacon configuration
salt.beacons.bonjour_announce.validate(config)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/beacons/all/salt.beacons.bonjour_announce.html