Executing playbooks from callback, It became slow all of sudden,

18 views
Skip to first unread message

Darup tek

unread,
Nov 10, 2014, 4:49:16 PM11/10/14
to ansible...@googlegroups.com
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.

Darup tek

unread,
Nov 10, 2014, 4:51:46 PM11/10/14
to ansible...@googlegroups.com
And regular: ansible-playbook command works fine when the playbook is pointed.

Reply all
Reply to author
Forward
0 new messages