2014.7.0 新版功能.
salt.modules.mod_random.
get_str
(length=20)¶2014.7.0 新版功能.
Returns a random string of the specified length.
命令行接口CLI 范例:
salt '*' random.get_str 128
salt.modules.mod_random.
hash
(value, algorithm='sha512')¶2014.7.0 新版功能.
Encodes a value with the specified encoder.
命令行接口CLI 范例:
salt '*' random.hash 'I am a string' md5
salt.modules.mod_random.
rand_int
(start=1, end=10)¶Returns a random integer number between the start and end number.
命令行接口CLI 范例:
salt '*' random.rand_int 1 10
salt.modules.mod_random.
seed
(range=10, hash=None)¶Returns a random number within a range. Optional hash argument can be any hashable object. If hash is omitted or None, the id of the minion is used.
命令行接口CLI 范例:
salt '*' random.seed 10 hash=None
salt.modules.mod_random.
shadow_hash
(crypt_salt=None, password=None, algorithm='sha512')¶Generates a salted hash suitable for /etc/shadow.
命令行接口CLI 范例:
salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5
salt.modules.mod_random.
str_encode
(value, encoder='base64')¶2014.7.0 新版功能.
命令行接口CLI 范例:
salt '*' random.str_encode 'I am a new string' base64