mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commit
d93ad103c7
2 changed files with 50 additions and 0 deletions
37
salt/grains/fx2.py
Normal file
37
salt/grains/fx2.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Generate baseline proxy minion grains
|
||||
'''
|
||||
from __future__ import absolute_import
|
||||
import salt.utils
|
||||
|
||||
__proxyenabled__ = ['rest_sample']
|
||||
|
||||
__virtualname__ = 'rest_sample'
|
||||
|
||||
|
||||
def __virtual__():
|
||||
if not salt.utils.is_proxy():
|
||||
return False
|
||||
else:
|
||||
return __virtualname__
|
||||
|
||||
|
||||
def kernel():
|
||||
return {'kernel': 'proxy'}
|
||||
|
||||
|
||||
def os():
|
||||
return {'os': 'RestExampleOS'}
|
||||
|
||||
|
||||
def location():
|
||||
return {'location': 'In this darn virtual machine. Let me out!'}
|
||||
|
||||
|
||||
def os_family():
|
||||
return {'os_family': 'proxy'}
|
||||
|
||||
|
||||
def os_data():
|
||||
return {'os_data': 'funkyHttp release 1.0.a.4.g'}
|
|
@ -51,6 +51,19 @@ def init(opts):
|
|||
return False
|
||||
|
||||
|
||||
def ping(opts):
|
||||
'''
|
||||
Required.
|
||||
Ping the device on the other end of the connection
|
||||
'''
|
||||
try:
|
||||
out, err = DETAILS['server'].sendline('help')
|
||||
return True
|
||||
except TerminalException as e:
|
||||
log.error(e)
|
||||
return False
|
||||
|
||||
|
||||
def shutdown(opts):
|
||||
'''
|
||||
Disconnect
|
||||
|
|
Loading…
Add table
Reference in a new issue