- name: install python requirements apt: pkg: python-passlib - name: generate passwordfile with_items: "{{ htpasswdfile }}" loop_control: loop_var: passfile include_tasks: htpasswdfile.yml