Skip to content

Instantly share code, notes, and snippets.

@sarasfox
Last active August 29, 2015 14:24
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 sarasfox/652fbcba9385c83f0fec to your computer and use it in GitHub Desktop.
Save sarasfox/652fbcba9385c83f0fec to your computer and use it in GitHub Desktop.
working
# -*- coding: utf-8 -*-
'''
Module for managing Arangodb and Foxx app's
'''
from __future__ import absolute_import
# Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def __virtual__():
return True
def add_app(app, name, **kwargs):
'''
Install a Foxx app
Form the Foxx app store only requries the app name
Form Github git:name of the app
Form Local path to a .zip file or the folder
Form Remote http path to a .zip or the folder with the app
'''
out = "it was aleardy installed"
if not __salt__['cmd.run']('foxx-manager list | grep /' + name):
cmd = 'foxx-manager install ' + app + ' /' + name + " "
cmd = cmd + ' '.join("%s=%s" % (key, value) for key, value in kwargs.items())
out = __salt__['cmd.run'](cmd)
return {"name":name,"result":"the app "+app+" was add at /"+name,
"changes":app + " was install at /" + name,"comment":out}
test:
arangodb.add_app_store:
- app: 'mailer-mailgun'
- apiKey: "key"
- domain: "bob.com"
test2:
arangodb.add_app_store:
- app: 'mailer-mailgun'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment