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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -