]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-build-pull-requests: check ansible syntax 224/head
authorKen Dreyer <kdreyer@redhat.com>
Fri, 13 Nov 2015 22:12:24 +0000 (15:12 -0700)
committerKen Dreyer <kdreyer@redhat.com>
Mon, 16 Nov 2015 16:53:50 +0000 (09:53 -0700)
With this change, the ceph-build-pull-requests job will run
ansible-playbook with the "--syntax-check" flag on every playbook in the
top-level of "./ansible/". This will help us avoid simple Ansible syntax
errors.

ceph-build-pull-requests/build/build

index 63d69453cac13b64df0606338e825f7a7bb7cb74..cc21e1002516d6e3bd03fd6e4f1fa60060de486f 100644 (file)
@@ -29,3 +29,14 @@ for dir in `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
         venv/bin/jenkins-jobs test $definitions_dir -o /tmp/output
     fi
 done
+
+# Install Ansible
+if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index ansible; then
+    venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" ansible
+    venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index ansible
+fi
+
+# Syntax-check each Ansible playbook
+for playbook in $WORKSPACE/ansible/*.yml; do
+    ansible-playbook -i '127.0.0.1,' $playbook --syntax-check
+done