New in version 2014.7.0.
New in version 2014.7.0.
Returns a random string of the specified length.
CLI Example:
salt '*' random.get_str 128
New in version 2014.7.0.
Encodes a value with the specified encoder.
CLI Example:
salt '*' random.hash 'I am a string' md5
Returns a random integer number between the start and end number.
Changed in version 2019.2.0: Added seed argument. Will return the same result when run with the same seed.
CLI Example:
salt '*' random.rand_int 1 10
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 Example:
salt '*' random.seed 10 hash=None
Generates a salted hash suitable for /etc/shadow.
CLI Example:
salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5
New in version 2014.7.0.
CLI Example:
salt '*' random.str_encode 'I am a new string' base64
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.mod_random.html