Skip to content

RH compatibility to Ansible installation scripts #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 70 additions & 32 deletions scripts/install-ansible.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,72 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive
export PYTHONUNBUFFERED=1

sudo apt-get update

printf '**************************\n\n'
printf 'Install cachefilesd'
printf '**************************\n\n'
# NFS improve caching
sudo apt-get install cachefilesd
sudo echo "RUN=yes" > /etc/default/cachefilesd
sudo service cachefilesd start
printf '**************************\n\n'
printf 'Finish install cachefilesd'
printf '**************************\n\n'

printf '**************************\n\n'
printf 'Install ansible'
printf '**************************\n\n'
sudo apt-get install -y python-pip python-dev python-pycurl
sudo pip install ansible

sudo mkdir -p /etc/ansible

printf '**************************\n\n'
printf 'Removes executable permission on hosts.ini to avoid ansible evalute this inventory like external scritp'
chmod -x $1/provisioning/hosts.ini
printf '**************************\n\n'

printf '**************************\n\n'
printf 'Finish install ansible'
printf '**************************\n\n'
if [ -f /etc/centos-release ]; then

export PYTHONUNBUFFERED=1
yum -y install wget
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
sudo yum -y install epel-release-7-5.noarch.rpm
sudo yum --enablerepo="epel"
sudo yum -y update

printf '**************************\n\n'
printf 'Install cachefilesd'
printf '**************************\n\n'
#NFS improve caching
sudo yum -y install cachefilesd
sudo echo "RUN=yes" > /etc/default/cachefilesd
sudo service cachefilesd start
printf '**************************\n\n'
printf 'Finish install cachefilesd'
printf '**************************\n\n'

printf '**************************\n\n'
printf 'Install ansible'
printf '**************************\n\n'
sudo yum install -y python-pip python-devel python-pycurl ansible
sudo mkdir -p /etc/ansible

printf '**************************\n\n'
printf 'Removes executable permission on hosts.ini to avoid ansible evalute this inventory like external scritp'
chmod -x $1/provisioning/hosts.ini
printf '**************************\n\n'

printf '**************************\n\n'
printf 'Finish install ansible'
printf '**************************\n\n'

else

export DEBIAN_FRONTEND=noninteractive
export PYTHONUNBUFFERED=1

sudo apt-get update

printf '**************************\n\n'
printf 'Install cachefilesd'
printf '**************************\n\n'
# NFS improve caching
sudo apt-get install cachefilesd
sudo echo "RUN=yes" > /etc/default/cachefilesd
sudo service cachefilesd start
printf '**************************\n\n'
printf 'Finish install cachefilesd'
printf '**************************\n\n'

printf '**************************\n\n'
printf 'Install ansible'
printf '**************************\n\n'
sudo apt-get install -y python-pip python-dev python-pycurl
sudo pip install ansible

sudo mkdir -p /etc/ansible

printf '**************************\n\n'
printf 'Removes executable permission on hosts.ini to avoid ansible evalute this inventory like external scritp'
chmod -x $1/provisioning/hosts.ini
printf '**************************\n\n'

printf '**************************\n\n'
printf 'Finish install ansible'
printf '**************************\n\n'
fi
4 changes: 0 additions & 4 deletions scripts/run-ansible.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive
export PYTHONUNBUFFERED=1

echo Running ansible playbooks as local
ansible-playbook $1/provisioning/playbooks.yml -i $1/provisioning/hosts.ini --extra-vars="target=development target_user=vagrant" --connection=local