Last active
August 29, 2015 14:24
-
-
Save sarasfox/652fbcba9385c83f0fec to your computer and use it in GitHub Desktop.
working
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
# -*- 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} |
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
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