Some tasks in ansible are't executed

I’m using ansible for some deployment issues.

I want to do the following:

  1. Install virtualenv
  2. Activate installed virtual environment
  3. Check if I’m in virtual environment

For this purposes I have the following playbook:

You don’t put the “tasks:” category in a playbook more than once.

This is a hash data structure, so you are basically clobbering it with another, again and again.

Just let the value of “tasks:” be a YAML list, and only put tasks in there once.