Skip to content

Instantly share code, notes, and snippets.

@edingc
Created January 24, 2014 16:46
Show Gist options
  • Save edingc/8601135 to your computer and use it in GitHub Desktop.
Save edingc/8601135 to your computer and use it in GitHub Desktop.
CentOS shell script to automatically enable EPEL repository, update the system and install Ansible for configuration management. Useful to bootstrap a system in preparation for Ansible configuration.
#!/bin/bash
# Download and install EPEL repository.
/usr/bin/wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
/usr/bin/yum -y install epel-release-6*.rpm
# Fully update the system and install Ansible
/usr/bin/yum -y update
/usr/bin/yum -y install ansible
# Cleanup after ourselves.
/bin/rm -rf /root/epel-release-6*.rpm /root/bootstrap_ansible.sh
# Restart the server.
/sbin/shutdown -r now
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment