Skip to content

Instantly share code, notes, and snippets.

@ahmet2mir
Last active August 29, 2015 14:10
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 ahmet2mir/5027e80dfdc23239ff40 to your computer and use it in GitHub Desktop.
Save ahmet2mir/5027e80dfdc23239ff40 to your computer and use it in GitHub Desktop.
Module in folder
export FILEROOT=/srv/salt/base
mkdir /srv/salt/base/_modules/myfolder
cd /srv/salt/base/_modules/myfolder
cat >__init__.py <<EOF
def test(**dummy):
return {"reponse": "42"}
EOF
cat > dummy.py <<EOF
def othertest(**dummy):
return {"reponse": "42_1"}
EOF
salt xxx saltutil.sync_modules
-> __init__ and dummy are synced
salt xxx myfolder.test
-> success
salt xxx myfolder.dummy.othertest
-> failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment