12345678910111213141516 |
- import salt.client
- salt = salt.client.LocalClient()
- print(salt.cmd('*', 'test.ping'))
- for minion, ips in salt.cmd('*', 'network.ipaddrs').items():
- print(minion, ips)
- for minion, res in salt.cmd('*', 'pkg.version', arg=('git')):
- if not res:
- 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)
|