Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small changes to make it compatible with the latest versions #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "puppetlabs/centos-6.5-64-nocm"
config.vm.box = "hansode/centos-6.5-x86_64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
Expand All @@ -19,13 +19,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# config.vm.synced_folder "../data", "/vagrant_data"

# As of Vagrant 1.7+, the ansible parallel provisioning trick is easier to
# be implemented with `config.ssh.insert_key=false` (fallback to previous
# behaviour).
config.ssh.insert_key = false

# Create a forwarded port mapping which allows access to specific port
# within the machine from a port on the host machine.

config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--cpus", "1", "--memory", "1024"]
v.customize ["modifyvm", :id, "--cpus", "1", "--memory", "8192"]
end

config.vm.define "ambari" do |ambari|
ambari.vm.network "private_network", ip: "192.168.50.3"
ambari.vm.hostname = "ambari.localdomain"
ambari.vm.network "forwarded_port", guest: 8080, host: 1234
end

config.vm.define "master1" do |master1|
Expand Down Expand Up @@ -54,7 +63,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# VMs are up and running.
slave2.vm.provision "ansible" do |ansible|
ansible.inventory_path = "inventory/vagrant-virtualbox"
ansible.verbose = "v"
ansible.verbose = "vvv"
# ansible.raw_arguments = "--check"
ansible.raw_arguments = "--private-key=~/.vagrant.d/insecure_private_key"
ansible.sudo = true
Expand Down
10 changes: 5 additions & 5 deletions inventory/vagrant-virtualbox
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Ambari server will also run Ganglia and Nagios servers + ZK
[ambari]
ambari ansible_ssh_host=192.168.50.3
ambari.localdomain ansible_ssh_host=192.168.50.3

# Runs Namenode, Hive server will also run metastore and mysql server / webhcat / hcatalog, ZK
[master1]
master1 ansible_ssh_host=192.168.50.4
master1.localdomain ansible_ssh_host=192.168.50.4

# Runs resourcemanager, historyserver, ZK, secondary namenode
[master2]
master2 ansible_ssh_host=192.168.50.5
master2.localdomain ansible_ssh_host=192.168.50.5

[masters:children]
master1
master2

[slaves]
slave1 ansible_ssh_host=192.168.50.6
slave2 ansible_ssh_host=192.168.50.7
slave1.localdomain ansible_ssh_host=192.168.50.6
slave2.localdomain ansible_ssh_host=192.168.50.7

[all:children]
ambari
Expand Down
8 changes: 8 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
- name: ensure iptables is stopped and is not running at boot time.
service: name=iptables state=stopped enabled=no

# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Credits to rothgar: https://gist.github.com/rothgar/8793800
- name: Build hosts file (backups will be made)
lineinfile: dest=/etc/hosts regexp='{{ hostvars[item].ansible_hostname }}$' line='{{ hostvars[item]['ansible_ssh_host'] }} {{ item }} {{ hostvars[item].ansible_hostname }}' state=present backup=yes
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']

#- name: ensure iptables6 is stopped and is not running at boot time.
#service: name=iptables6 state=stopped enabled=no

Expand Down
3 changes: 3 additions & 0 deletions roles/geerlingguy.repo-epel/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
# Added to be able to update yum on centos 6.5
- shell: echo "6" > /etc/yum/vars/releasever

- name: Install EPEL repo.
yum:
name: "{{ epel_repo_url }}"
Expand Down
1 change: 1 addition & 0 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
sudo: yes
roles:
- common
- ambari-repo

- name: Ambari server
hosts: ambari
Expand Down