Hello everybody,
I am using Ansible 2.3.1.1 with Jenkins. I have encountered the following
issue - my playbook which uses variables from aws dynamic inventory becomes
extremely slow. The most interesting case that if I copy this playbook
outside my jenkins workspace and run it in any other directory the
execution speed is OK. In order to test it I moved out all variable files
from workspace directory /group_vars/all, as a result the execution speed
for this playbook inside workspace become OK too. Then I put variable files
back to /group_vars/all one by one and test execution time. Each additional
file in the folder augments the execution time for each task iteration.
Also when I put one file which has reference to removed file variable
Ansible throwed an error.
I can conclude that Ansible evaluates all variables in the /group_vars/all
for each tasks and for each iteration of the task before run despite it is
not actually used. But according to the documentation Ansible uses lazy
evaluation method, so I can not understand why this issue occurs and how it
could be fixed. Could someone shed the light on it?
the playbook is the following:
- hosts: "127.0.0.1"
tasks:
- name: print something
debug:
var: hostvars["{{item}}"]['ec2_vpc_id']
with_items: "{{groups['some_tag']}}"
Regards.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/36595396-dcf5-4c92-a19e-3b64384d7c3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.