Not set variables can be used first and then be manipulated in "vars_prompt" using "prompt" #66020
Labels
affects_2.7
This issue/PR affects Ansible v2.7
bug
This issue/PR relates to a bug.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
SUMMARY
I am using
prompt
invars_prompt
to manipulate the variableserial
in a playbook to define how many of my hosts should be updated at once. I am not sure, if this should be possible, because I am using a variable before it was actually defined. I always guessed, that a playbook is read top-down.Is this intended or did I find a bug?
ISSUE TYPE
COMPONENT NAME
lib/ansible/executor/playbook_executor.py#L115
ANSIBLE VERSION
The
latest stable
anddevel
version are also affected:CONFIGURATION
OS / ENVIRONMENT
Ansible host
$ uname -a Linux ansible 5.3.13-1-pve #1 SMP PVE 5.3.13-1 (Thu, 05 Dec 2019 07:18:14 +0100) x86_64 GNU/Linux
STEPS TO REPRODUCE
/home/ansible/provisioning/playbooks/
:update_packages.yml
$ ansible-playbook --inventory="inventory.yml" playbooks/update_packages.yml
EXPECTED RESULTS
It should not work, since I am using a variable, which was actually not defined before.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: