When running our plugins we're seeing a severe performance impact in
the ansible run-time. As it turns out, within the linear strategy we're
looping over all physical hosts in an environment and pulling address
information out to store as a task variable. This action causes all
tasks to reload all {group,host}_vars for all hosts and that repetitive
action results in a massive slowdown, especially when there are many
hosts within the inventory.
Results from a normal OSA playbook run on 50 hosts:
time openstack-ansible openstack-hosts-setup.yml --forks 15
real 37m44.263s
user 35m30.984s
sys 2m23.252s
Results with the strategy plugin disabled on 50 hosts:
time ANSIBLE_STRATEGY_PLUGINS=false openstack-ansible openstack-hosts-setup.yml --forks 15
real 5m8.641s
user 6m30.792s
sys 1m32.512s
This change scopes the physical host look up to the task and target host
and adds conditionals around the process to ensure we're not forcing a lookup
that has no chance of succeeding.
Results with this patch applied on 50 hosts and no forks:
time openstack-ansible openstack-hosts-setup.yml
real 6m40.573s
user 7m53.336s
sys 1m25.828s
Should anything like this come up again debug statements have been added
to the method so that we can enable verbose mode and know what is being
parsed.
Change-Id: I76af71ffe19b2a8afb18ed731f1362a4e399c613
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
These are the plugins the OpenStack-Ansible deployment project relies
on. The plugins can be added to any Ansible project by simply cloning
this repository and setting up the ansible.cfg file to
point at them as additional plugins for your project.