| Server IP : 104.21.25.182 / Your IP : 216.73.217.22 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.9/site-packages/ansible/plugins/filter/ |
Upload File : |
DOCUMENTATION:
name: random
version_added: "2.6"
short_description: random number or list item
description:
- Use the input to either select a random element of a list or generate a random number.
positional: _input, start, step, seed
options:
_input:
description: A number or list/sequence, if it is a number it is the top bound for random number generation, if it is a sequence or list, the source of the random element selected.
type: raw
required: true
start:
description: Bottom bound for the random number/element generated.
type: int
step:
description: Subsets the defined range by only using this value to select the increments of it between start and end.
type: int
default: 1
seed:
description: If specified use a pseudo random selection instead (repeatable).
type: str
EXAMPLES: |
# can be any item from the list
random_item: "{{ ['a','b','c'] | random }}"
# cron line, select random minute repeatable for each host
"{{ 60 | random(seed=inventory_hostname) }} * * * * root /script/from/cron"
RETURN:
_value:
description: Random number or list element.
type: raw