Created
June 7, 2016 13:42
-
-
Save mchugh19/7be27ea18b5585da96e331d527d94d6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!py | |
import logging | |
import salt.runner | |
import salt.client | |
import salt.config | |
log = logging.getLogger(__name__) | |
def check_autosign(minion_id): | |
opts = salt.config.master_config('/etc/salt/master') | |
runner = salt.runner.RunnerClient(opts) | |
results = runner.cmd('authminion.servicenow', [minion_id]) | |
return results | |
def run(): | |
''' | |
Autosign reactor | |
''' | |
minion_id = data['id'] | |
if data.get('act') == 'pend' and check_autosign(minion_id): | |
log.info('Reactor accepting key for {0}'.format(minion_id)) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment