Created
May 5, 2018 18:00
-
-
Save DavidRdgz/fafb95e87f04b299a124c0af995d7868 to your computer and use it in GitHub Desktop.
Quick Vagrant machine with Hadoop & Spark using Ansible
This file contains 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
--- | |
- name: Spark Development in a Box | |
hosts: all | |
become: yes | |
become_method: sudo | |
become_user: root | |
gather_facts: no | |
pre_tasks: | |
- name: 'install python2' | |
raw: sudo apt-get -y install python-simplejson | |
tasks: | |
- name: Update and upgrade apt packages | |
apt: | |
update_cache: yes | |
- name: Install latest version of "openjdk-8-jdk" no "install-recommends" | |
apt: | |
name: openjdk-8-jdk | |
state: latest | |
install_recommends: no | |
- name: Download Hadoop with Spark | |
get_url: | |
url: http://d3kbcqa49mib13.cloudfront.net/spark-2.2.0-bin-hadoop2.7.tgz | |
dest: /home/vagrant | |
- name: Untar Hadoop with Spark | |
shell: cd /home/vagrant; tar -zxf spark-2.2.0-bin-hadoop2.7.tgz | |
This file contains 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 = "ubuntu/xenial64" | |
config.vm.hostname = "spark.xenial.box" | |
config.vm.network :private_network, ip: "192.168.0.42" | |
config.vm.synced_folder "./data", "/vagrant_data" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 4096 | |
vb.cpus = 2 | |
end | |
config.vm.provision "ansible" do |ansible| | |
ansible.playbook = "playbook.yml" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment