Эх сурвалжийг харах

Added LocalCaller example

nee2c 4 жил өмнө
parent
commit
c6712b2836

+ 15 - 0
api/LocalCalllerexample.py

@@ -0,0 +1,15 @@
+import salt.client
+
+salt = salt.client.LocalClient()
+
+print(salt.cmd('*', 'test.ping'))
+
+
+for minion, ips in salt.cmd('*', 'network.ipaddrs').items():
+    print(minion, ips)
+
+
+salt.cmd('*', 'pkg.install', arg=['git'])
+
+for minion, res in salt.cmd('*', 'git.clone', arg=['/tmp/'], kwarg={'url':'https://n1chome.uk/nee2c/salttest.git', 'name':'stest'}, full_return=True).items():
+    print(minion, res)