tripleo-image-elements/elements/ansible/install.d/ansible-source-install/30-ansible-source

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -eux
set -o pipefail
ANSIBLE_VERSION=${ANSIBLE_VERSION:-1.8.1}
install-packages build-essential libssl-dev libyaml-dev python-dev libxml2-dev libxslt-dev libffi-dev
virtualenv $ANSIBLE_VENV_DIR
set +u
source $ANSIBLE_VENV_DIR/bin/activate
set -u
$ANSIBLE_VENV_DIR/bin/pip install paramiko PyYAML jinja2 httplib2
$ANSIBLE_VENV_DIR/bin/pip install ansible==${ANSIBLE_VERSION}
ln -s $ANSIBLE_VENV_DIR/bin/ansible /usr/local/bin/ansible
ln -s $ANSIBLE_VENV_DIR/bin/ansible-playbook /usr/local/bin/ansible-playbook