From 7d4f72760f1ba3fadaef56d60b5b4212d8ba34cc Mon Sep 17 00:00:00 2001
From: Christian Elberfeld <elberfeld@web.de>
Date: Sat, 3 Sep 2016 20:31:07 +0200
Subject: [PATCH] vagrant arbeitzumgebung

---
 .gitignore       |  2 ++
 VagrantPutty.bat | 18 +++++++++++
 Vagrantfile      | 81 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 101 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 VagrantPutty.bat
 create mode 100644 Vagrantfile

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..70757034
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/.vagrant
+/*.retry
diff --git a/VagrantPutty.bat b/VagrantPutty.bat
new file mode 100644
index 00000000..14ae2c1d
--- /dev/null
+++ b/VagrantPutty.bat
@@ -0,0 +1,18 @@
+
+rem Vagrant VM für Ansible Arbeitsumgebung 
+rem Unter Windows müssen die folgenden Git-Einstellungen 
+rem gesetzt werden damit die Dateien lokal mit LF als Dateiendungen 
+rem vorliegen:
+rem $ git config core.eol lf
+rem $ git config core.autocrlf input
+
+rem Vagrant VM Starten 
+vagrant up 
+
+rem SSH Verbindung über PuTTY mit https://github.com/nickryand/vagrant-multi-putty
+vagrant putty -- -l vagrant -pw vagrant
+
+pause
+
+rem Vagrant VM Stoppen 
+vagrant halt
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 00000000..37ad8df0
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,81 @@
+
+Vagrant.configure(2) do |config|
+
+  # Debian Jessie + VirtualBox Addons 
+  config.vm.box = "debian/contrib-jessie64"
+
+  # Hostname
+  config.vm.hostname = "box"
+  
+  # Customize 
+  config.vm.provider "virtualbox" do |vb|
+	vb.memory = "512"
+	vb.cpus = 2
+	vb.linked_clone = true
+  end
+
+  # Enable Agent forwarding   
+  config.ssh.forward_agent = true 
+  
+  config.vm.provision "shell", inline: <<-SHELL
+
+	echo "######################################################"
+	echo "Setup Debian Testing ..."
+	echo "######################################################"
+
+	echo "deb http://httpredir.debian.org/debian testing main contrib non-free" > /etc/apt/sources.list
+	echo "deb http://security.debian.org/ testing/updates main contrib non-free" >> /etc/apt/sources.list
+	
+	sudo apt-get update
+
+	# Avoid service sestart question if libc is upgraded
+	echo 'libc6 libraries/restart-without-asking boolean true' | sudo debconf-set-selections
+
+	echo "######################################################"
+	echo "Installing Vim ..."
+	echo "######################################################"
+
+	sudo apt-get install -y vim
+	
+	echo "######################################################"
+	echo "Installing Git ..."
+	echo "######################################################"
+
+	sudo apt-get install -y git
+	
+ 	echo "######################################################"
+    echo "Installing Fish Shell ..."
+    echo "######################################################"
+
+    sudo apt-get install -y fish
+	
+	# Set FiSH Shell as default Login Shell
+	sudo chsh -s /usr/bin/fish vagrant
+	
+	# Create a FiSH base config 
+	mkdir -p -v /home/vagrant/.config/fish/
+	curl https://raw.githubusercontent.com/elberfeld/fish/master/config.fish > /home/vagrant/.config/fish/config.fish
+	chown vagrant:vagrant -v -R /home/vagrant/.config 
+	
+	# Change to /vagrant/ directory on Login 
+    echo "cd /vagrant/" >> /home/vagrant/.config/fish/config.fish 
+
+	echo "######################################################"
+	echo "Installing Ansible ..."
+	echo "######################################################"
+		
+	sudo apt-get install -y python python-pip python-dev libffi6 libffi-dev libssl-dev
+	sudo pip install ansible markupsafe netaddr
+
+    echo "    StrictHostKeyChecking no" >> /etc/ssh/ssh_config  
+    
+    echo "[defaults]" > /home/vagrant/.ansible.cfg
+    echo "inventory = /vagrant/hosts" >> /home/vagrant/.ansible.cfg
+
+	echo "######################################################"
+	echo "DONE"
+	echo "######################################################"
+	
+  SHELL
+     
+end
-- 
GitLab