I have three linux servers and i created the ansible inventory file:
[web]
192.168.0.155
192.168.0.165
192.168.0.175
And i have playbook.yml:
---
- hosts: web
tasks:
- name: Check drinks versions
shell: "python3.4 {{ item.sw_path }} -v"
sudo: yes
with_items:
- { sw_path: '/home/beer.py' }
- { sw_path: '/home/vodka.py' }
- { sw_path: '/home/whisky.py' }
The scripts (beer.py, vodka.py and whisky.py) print their versions in format like: "/home/beer.py 1.0.0". And i need to get this versions, compare it with versions that i store in database (this is the actual versions) and if versions are not equal then copy an actual version from svn (svn paths also stored in database) to the server. How can i do that using ansible capabilities?