]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-build: setup the virtualenv, install ansible and call the playbook
authorAndrew Schoen <aschoen@redhat.com>
Tue, 20 Oct 2015 15:21:40 +0000 (10:21 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 20 Oct 2015 15:21:40 +0000 (10:21 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-build/build/setup

index 8f995006651dce262bbeae685838f05d5c17da7e..52ac3a8afc4fef8b61a900ea27dd9244f7e26b78 100644 (file)
@@ -65,3 +65,26 @@ CentOS|Fedora|SUSE*|RedHatEnterpriseServer)
         echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually."
         ;;
 esac
+
+# Create the virtualenv
+virtualenv venv
+. venv/bin/activate
+
+# Define and ensure the PIP cache
+PIP_SDIST_INDEX="$HOME/.cache/pip"
+mkdir -p $PIP_SDIST_INDEX
+
+# The setup for this job ensures that a copy of ceph-build will be available
+# for this script
+
+# Install the package by trying with the cache first, otherwise doing a download only, and then
+# trying to install from the cache again.
+if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index ansible; then
+    venv/bin/pip install --exists-action=i --download-directory="$PIP_SDIST_INDEX" ansible
+    venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index ansible
+fi
+
+# run ansible to get this current host to meet our requirements, specifying
+# a local connection and 'localhost' as the host where to execute
+cd "$WORKSPACE/ceph-build/setup/playbooks"
+ansible-playbook -i "localhost," -c local setup.yml