--- - name: check if nDPI dir exists stat: path: "{{ndpi_clone_dir}}" register: dir_present - name: get nDPI sources shell: cmd: git clone https://github.com/ntop/nDPI.git {{ndpi_clone_dir}} when: dir_present.stat.exists == false - name: build and install nDPI shell: cmd: cd {{ndpi_clone_dir}}; git checkout {{ndpi_compat_version}}; ./autogen.sh && ./configure && make && make install && make clean && git switch - ; ./autogen.sh && ./configure && make && make install chdir: "{{ndpi_clone_dir}}"