Created
October 16, 2015 09:06
-
-
Save mfojtik/e6ca4cc2f224a2ac03d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "/home/mfojtik/rhel-server-virtualbox-7.1-3.x86_64.box" | |
config.vm.network "private_network", ip: "192.168.33.10" | |
config.vm.provision "shell", privileged: false, inline: <<-SHELL | |
# Need to do commented steps manually right now :/ | |
# subscription-manager register | |
# subscription-manager attach --auto | |
# subscription-manager repos --disable="*" | |
# subscription-manager repos \ | |
# --enable="rhel-7-server-rpms" \ | |
# --enable="rhel-7-server-extras-rpms" \ | |
# --enable="rhel-7-server-ose-3.0-rpms" | |
# yum install -y https:////dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
# yum install -y ansible | |
if ! grep "openshift-master" /etc/hosts &>/dev/null; then | |
sudo sh -c 'echo "192.168.33.10 openshift-master.cdk.local" >> /etc/hosts' | |
sudo hostnamectl set-hostname openshift-master.cdk.local | |
fi | |
if [ ! -f ~/.ssh/id_rsa ]; then | |
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" | |
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
fi | |
eval $(/usr/bin/ssh-agent) | |
ssh-add || exit 1 | |
if [ ! -d openshift-ansible ]; then | |
git clone https://github.com/openshift/openshift-ansible.git | |
fi | |
cd openshift-ansible | |
cat > origin-config << EOF | |
[OSv3:children] | |
masters | |
nodes | |
[OSv3:vars] | |
ansible_ssh_user=vagrant | |
ansible_sudo=true | |
deployment_type=origin | |
[masters] | |
openshift-master.cdk.local openshift_use_openshift_sdn=false | |
[nodes] | |
openshift-master.cdk.local openshift_use_openshift_sdn=false | |
EOF | |
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook playbooks/byo/config.yml --inventory origin-config | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment