Skip to content

Instantly share code, notes, and snippets.

@PeterS242
Created March 8, 2015 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeterS242/0d1544e181140989b7ce to your computer and use it in GitHub Desktop.
Save PeterS242/0d1544e181140989b7ce to your computer and use it in GitHub Desktop.
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