diff --git a/lib/ansible/plugins/filter/core.py b/lib/ansible/plugins/filter/core.py index f4487f7d245426..b471c16a7c95ba 100644 --- a/lib/ansible/plugins/filter/core.py +++ b/lib/ansible/plugins/filter/core.py @@ -235,7 +235,7 @@ def rand(environment, end, start=None, step=None, seed=None): start = 0 if not step: step = 1 - return r.randrange(start, end, step) + return r.randrange(start, end + 1, step) elif hasattr(end, '__iter__'): if start or step: raise AnsibleFilterError('start and step can only be used with integer values')