added script and instructions for lint checking

Change-Id: I0a8f6058099637c3eacc6c77f8c9cefc60fe0915
diff --git a/README.md b/README.md
index 5bdf200..289825f 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,17 @@
 
 This repository contains [Ansible](http://docs.ansible.com) playbooks for
 installing and configuring software components on a CORD POD: OpenStack, ONOS,
-and XOS.  It is a sub-module of the [main CORD repository](https://github.com/opencord/cord).
+and XOS.  It is a sub-module of the [main CORD
+repository](https://github.com/opencord/cord).
 
-To install a single-node CORD POD, read [INSTALL_SINGLE_NODE.md](./INSTALL_SINGLE_NODE.md).
+To install a single-node CORD POD, read
+[INSTALL_SINGLE_NODE.md](./INSTALL_SINGLE_NODE.md).
 
-Otherwise you should start with the [CORD repository](https://github.com/opencord/cord).
+Otherwise you should start with the [CORD
+repository](https://github.com/opencord/cord).
+
+# Lint checking your code
+
+Before commit, please run `scripts/lintcheck.sh`, which will perform the same
+lint check that Jenkins performs when in review in Gerrit.
+
diff --git a/scripts/lintcheck.sh b/scripts/lintcheck.sh
new file mode 100644
index 0000000..063ddee
--- /dev/null
+++ b/scripts/lintcheck.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set +e
+fail_ansible=0
+
+# verify that we have ansible-lint installed
+command -v ansible-lint  >/dev/null 2>&1 || { echo "ansible-lint not found, please install it" >&2; exit 1; }
+
+# when not running under Jenkins, use current dir as workspace
+WORKSPACE=${WORKSPACE:-.}
+
+echo "=> Linting Ansible Code with" `ansible-lint --version`
+for f in `find $WORKSPACE -name "*.yml"`; do
+    echo "==> CHECKING: $f"
+    ansible-lint -p $f
+    rc=$?
+    if [[ $rc != 0 ]]; then
+        echo "==> LINTING FAIL: $f"
+        fail_ansible=1
+    fi
+done
+
+exit 0