--- - name: "set user home var " set_fact: app_user_home: "/home/{{ app_user }}" tags: - setpath - name: "set instance root" set_fact: app_instance_root: "{{ app_user_home }}/{{ app_instance_id }}" tags: - setpath - name: "set instance root" set_fact: run_user: "{{ app_user }}" tags: - setpath - import_tasks: install.yml when: app_run in ['install', 'reinstall'] - import_tasks: uninstall.yml when: app_run == 'uninstall'