--- - block: - name: Detect installed version shell: /usr/local/bin/consul version | head -1 | perl -pe 's/Consul v(\d+(\.\d+)*)/$1/' changed_when: False register: consul_current_version - set_fact: consul_current_version={{ consul_current_version.stdout }} tags: consul - name: Check if the consul-template service still exists stat: path=/etc/systemd/system/consul-template-consul register: consul_ct_service tags: consul