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