summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-07-25 00:02:00 +0300
committerLars Wirzenius <liw@liw.fi>2015-07-25 00:02:00 +0300
commit826e7ea9a3303fa1ea1044b6022992038f40333f (patch)
tree87ea5a89a47fd07ea63242f45b28a2700a72b58e /yarns
parent70f98dc19880bf35b24f8fab8b02d544a8587a75 (diff)
downloadansibleness-826e7ea9a3303fa1ea1044b6022992038f40333f.tar.gz
Check for python version
Diffstat (limited to 'yarns')
-rw-r--r--yarns/100-willikins.yarn1
-rw-r--r--yarns/900-implements.yarn9
2 files changed, 10 insertions, 0 deletions
diff --git a/yarns/100-willikins.yarn b/yarns/100-willikins.yarn
index 3004019..697897b 100644
--- a/yarns/100-willikins.yarn
+++ b/yarns/100-willikins.yarn
@@ -9,3 +9,4 @@ backups. It is only ever accessed over ssh (including sftp).
THEN server responds to ping
AND server hostname is as expected
AND server account has sudo
+ AND server has python version 2 installed
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index 7c40885..f08baee 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -39,6 +39,15 @@ access to root?
ssh "$ACCOUNT@$SERVER" sudo -n id -u > "$DATADIR/id.out"
grep -F 0 "$DATADIR/id.out"
+## Python 2 installed?
+
+Does the server have Python 2 installed, by invoking `python`?
+
+ IMPLEMENTS THEN server has python version 2 installed
+ . "$DATADIR/config.sh"
+ ssh "$ACCOUNT@$SERVER" python --version 2> "$DATADIR/python.out"
+ grep "^Python 2\." "$DATADIR/python.out"
+
## Running command over ssh
Run a command on the server over ssh, capturing stdout and stderr and