Skip to content

Instantly share code, notes, and snippets.

@localdisk
Created May 20, 2015 00:25
Show Gist options
  • Select an option

  • Save localdisk/42fabd99a71a6f903f7d to your computer and use it in GitHub Desktop.

Select an option

Save localdisk/42fabd99a71a6f903f7d to your computer and use it in GitHub Desktop.
ゲストOSにAnsibleインストール
#!/usr/bin/env bash
ansible_conf="/home/vagrant/.ansible.cfg"
if ! [ `which ansible` ]; then
sudo yum -y update
sudo yum -y install python-setuptools python-devel
sudo yum -y groupinstall "Development Tools"
sudo easy_install pip
sudo pip install ansible
fi
sudo yum -y update kernel
sudo yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
if ! [ -e $ansible_conf ]; then
touch $ansible_conf
echo "[defaults] " >> $ansible_conf
echo "log_path=/vagrant/ansible.log" >> $ansible_conf
fi
sudo cp -p /vagrant/ansible/development /home/vagrant/
sudo chmod -x /home/vagrant/development
ansible-playbook -i /home/vagrant/development /vagrant/ansible/site.yml
#export KERN_DIR=`ls -t /usr/src/kernels/ | head -1` && sudo /etc/init.d/vboxadd setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment