--- - name: install bird apt: name=bird state=installed install_recommends=no when: bird_enable - name: install bird6 apt: name=bird6 state=installed install_recommends=no when: bird6_enable # Debian version does not support status ensure that it exists - name: ensure bird status works in init.d replace: dest=/etc/init.d/bird regexp='(\;\;\s*)\n(\s*reload\|)' replace='\1\n status)\n status_of_proc $DAEMON $NAME && exit 0 || exit $?\n ;;\n\2' when: bird_enable - name: ensure bird6 status works in init.d replace: dest=/etc/init.d/bird6 regexp='(\;\;\s*)\n(\s*reload\|)' replace='\1\n status)\n status_of_proc $DAEMON $NAME && exit 0 || exit $?\n ;;\n\2' when: bird6_enable - name: Ensure bird is started service: name=bird state=started enabled=yes when: bird_enable and bird_enable_service - name: Ensure bird6 is started service: name=bird6 state=started enabled=yes when: bird6_enable and bird_enable_service