Created
September 8, 2015 03:17
-
-
Save alexwoolford/da241e70ed8f2b585365 to your computer and use it in GitHub Desktop.
Prepare cluster nodes (Ubuntu 14.04) for Cloudera installation.
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
--- | |
# cluster_setup.yml | |
# to run: ansible-playbook ~/cluster_setup.yaml -u awoolford -k --ask-sudo-pass | |
- hosts: cluster | |
user: awoolford | |
sudo: True | |
tasks: | |
- name: install linux packages | |
apt: name=debconf-utils state=present | |
- name: add WebUpd8 PPA repo | |
apt_repository: repo='ppa:webupd8team/java' | |
- name: accept Oracle Java installer licence agreement | |
debconf: name='oracle-java7-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select' | |
- name: Install JDK | |
apt: pkg=oracle-java8-installer state=latest update-cache=yes force=yes | |
- name: comment out the hostname association with 127.0.1.1 in /etc/hosts | |
lineinfile: dest=/etc/hosts state=absent regexp="^127\.0\.1\.1" | |
- name: set noatime on /data | |
mount: name=/data src='LABEL=data' fstype=ext4 opts=noatime state=present | |
- name: passwordless sudo for sudoers | |
lineinfile: dest=/etc/sudoers state=present regexp='^%sudo ALL\=' line='%sudo ALL=(ALL) NOPASSWD:ALL' validate='visudo -cf %s' | |
- name: set vm.swappiness = 0 | |
sysctl: name="vm.swappiness" value=0 sysctl_set=yes | |
- name: set vm.swappiness = 0 | |
sysctl: name={{item}} value=1 sysctl_set=yes | |
with_items: | |
- net.ipv6.conf.all.disable_ipv6 | |
- net.ipv6.conf.default.disable_ipv6 | |
- net.ipv6.conf.lo.disable_ipv6 | |
- name: download cloudera installer | |
get_url: url=http://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin dest=/home/awoolford/ mode="u+x" owner=awoolford | |
- name: install linux packages | |
action: apt update_cache=yes pkg={{item}} state=installed | |
with_items: | |
- maven | |
- vim | |
- name: add local ssh public key to authorized keys | |
authorized_key: user=awoolford key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment