password#
State module for generating random strings usable as passwords
- idem_random.states.random.password.present(hub, ctx, name: str, length: int, resource_id: str = None, keepers: Dict[str, Any] = None, upper: bool = True, min_upper: int = 0, lower: bool = True, min_lower: int = 0, numeric: bool = True, min_numeric: int = 0, special: bool = True, min_special: int = 0, override_special: str = None) Dict[str, Any] [source]#
This is a logical state and doesn’t interact with any cloud providers. This state can be used in conjunction with any other state to generate random password with the provided configurations. State’s configuration data is stored in esm. If for a given state , the configuration changes , a new random password is generated. If there are no configuration changes , then the old password is retained.
- Parameters:
name (str) – An Idem name of the resource.
length (int) – The length of the required random password.
resource_id (str, Optional) – Unique random password
keepers (List, Optional) – A list of arbitrary map of values that, when changed, will trigger recreation of resource.
lower (bool, Optional) – Include lowercase alphabet characters in the result. Default value is true.
min_lower (int, Optional) – Minimum number of lowercase alphabet characters in the result.Default value is 0.
min_numeric (int, Optional) – Minimum number of numeric characters in the result. Default value is 0.
min_special (int, Optional) – Minimum number of special characters in the result. efault value is 0.
min_upper (int, Optional) – Minimum number of uppercase alphabet characters in the result. Default value is 0.
numeric (bool, Optional) – Include numeric characters in the result. Default value is true.
override_special (str, Optional) – Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The special argument must still be set to true for any overwritten characters to be used in generation.
special (bool, Optional) – Include special characters in the result. These are !@#$%&*()-_=+[]{}<>:?. Default value is true.
upper (bool, Optional) – Include uppercase alphabet characters in the result. Default value is true.
Request Syntax:
[random_password_state]: random.password.present: - name: 'string' - length: 'int' - keepers: 'string': 'string' - lower: 'boolean' - min_lower: 'int' - upper: 'boolean' - min_upper: 'int' - numeric: 'boolean' - min_numeric: 'int' - special: 'boolean' - override_special: 'string'
- Returns:
Dict[str, Any]
Examples:
random_passwd_state: random.password.present: - name: random_passwd - length: 13 - keepers: key: value
- idem_random.states.random.password.absent(hub, ctx, name: str) Dict[str, Any] [source]#
This logical state is used to invalidate/delete the password.
- Parameters:
name (str) – An Idem name of the resource.
Request Syntax:
[random_password_state]: random.password.absent: - name: 'string'
- Returns:
Dict[str, Any]
Examples:
random_state01011: random.password.absent: - name: rs01011