I am using the below function for the past 4 months to orchestrate the 
installations/depolyments and it was quick.

It was working fine and all of a sudden, it became dead slow. I do not 
remember tweaking settings.

def run_playbook(listVMs, playbook, user, extra_vars=None, key_file=None):
    print(datetime.datetime.now())
    stats = callbacks.AggregateStats()
    playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY)
    runner_cb = callbacks.PlaybookRunnerCallbacks(stats, 
verbose=utils.VERBOSITY)

    pb = ansible.playbook.PlayBook(
        host_list=listVMs,
        playbook=playbook,
        forks=20,
        remote_user=user,
        remote_pass='centos',
        runner_callbacks=runner_cb,
        callbacks=playbook_cb,
        stats=stats,
        extra_vars=extra_vars
    )

    pb.run()


run_playbook(listAllVms, 
'./resources/yaml/playbooks/all/config/yumbootstrap.yml', 'root')


Please help.

-- 
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/440d0472-9f57-4fcf-a218-a6dfbe005132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to