Skip to content
Snippets Groups Projects
Commit ae8db60f authored by nimrod's avatar nimrod
Browse files

- Handle output from which better.

- Correct Nginx facts for Ubuntu.
parent f9871ba3
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,6 @@ fail () ...@@ -7,6 +7,6 @@ fail ()
exit exit
} }
which collectd || fail "Can't find collectd executable." which collectd 2>&1 > /dev/null || fail "Can't find collectd executable."
collectd -h | sed -n 's/[a-zA-Z ]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/{"changed": false, "ansible_facts": {"collectd": {"major":\1, "minor":\2, "patch":\3}}}/p' collectd -h 2>&1 | sed -n 's/[a-zA-Z ]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/{"changed": false, "ansible_facts": {"collectd": {"major":\1, "minor":\2, "patch":\3}}}/p'
...@@ -7,6 +7,6 @@ fail () ...@@ -7,6 +7,6 @@ fail ()
exit exit
} }
which nginx || fail "Can't find nginx executable." which nginx 2>&1 > /dev/null || fail "Can't find nginx executable."
nginx -v 2>&1 | sed -n 's/[a-zA-Z :\/]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]\)*/{"changed": false, "ansible_facts": {"nginx": {"major":\1, "minor":\2, "patch":\3, "version":"\1.\2.\3"}}}/gp' nginx -v 2>&1 | sed -n 's/[a-zA-Z :\/]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]\)*.*$/{"changed": false, "ansible_facts": {"nginx": {"major":\1, "minor":\2, "patch":\3, "version":"\1.\2.\3"}}}/gp'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment