Profile task timing

Sort tasks by run time to find the slow steps; profile_roles does the same per role

ANSIBLE_CALLBACKS_ENABLED=profile_tasks ansible-playbook site.yml

tool
ansible56 commands
tags
ansibleperformanceobservability

More ansible commands

  • ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook site.yml -vvvv --limit <host>

    Keep the module scripts Ansible pushed to ~/.ansible/tmp, so you can debug a failing module by hand

  • ansible-playbook -i inventory/prod playbook.yml --diff

    Run a playbook with --diff to see what it changes

  • ansible-playbook -i inventory playbook.yml --limit host1,host2

    Run only on the listed hosts from the inventory

  • ansible-playbook -i inventory playbook.yml --tags install,configure

    Run only the tasks with these tags

  • ansible-playbook -i inventory playbook.yml --skip-tags cleanup

    Skip tasks with these tags

all 56 ansible commands