Created
March 8, 2015 22:11
-
-
Save PeterS242/0d1544e181140989b7ce to your computer and use it in GitHub Desktop.
This file contains 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
import logging | |
from salt.exceptions import CommandExecutionError | |
log = logging.getLogger(__name__) | |
__outputter__ = { | |
'deploy': 'highstate' | |
} | |
SERVICES = [ | |
'uwsgi', | |
'celeryd' | |
] | |
def deploy(): | |
# _id = __grains__['id'] | |
# directories = __pillar__['directories'] | |
# main_user = __pillar__['main_user'] | |
# ret = {'Machine': _id, 'changes': [], 'changed': False} | |
# for service in SERVICES: | |
# if (__salt__['service.available'](service)): | |
# try: | |
# ret['changed'] = True | |
# ret['result'] = True | |
# __salt__['git.pull'](directories['src'], user=main_user) | |
# __salt__['service.restart'](service) | |
# ret['changes'].append({'name': service, 'updated': True}) | |
# except CommandExecutionError as e: | |
# ret['changed'] = True | |
# ret['result'] = False | |
# ret['changes'].append({'name': service, 'updated': False}) | |
ret = { 'comment': 'Deploy is not currently functional.', 'changed': True, 'result': False } | |
return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment