Resolving dependecies of salt grains -
we're using saltstack , write custom grain depends on python library - netifaces in case.
as minions should able execute grain need ensure library available.
what best practice achieve this? recommended write state , apply state minions. feels bit messy have dependency between grain , state. there way define dependency inside of grains itself?
grains not responsible manage own dependencies. based on seems straight forward me write state resolves dependencies of grain.
grains shipped in saltstack/salt/salt/grains/core.py report missing modules that:
log = logging.getlogger(__name__) has_wmi = false if salt.utils.is_windows(): # attempt import python wmi module # windows minion uses wmi of grains try: import wmi # pylint: disable=import-error import salt.utils.winapi has_wmi = true except importerror: log.exception( 'unable import python wmi module, core grains ' 'will missing' )
further opinions welcome.
Comments
Post a Comment