Commit ada5acb9 authored by Georgios Ouzounis's avatar Georgios Ouzounis

Merge pull request #2 from ioantsaf/LAM-49-proxy

Ansible fixes for proxy
parents ff579dc1 aaddf3c4
internal_ip: "192.168.0.3"
internal_ip: "192.168.0.2"
## Apache Kafka variables.
id: 1
internal_ip: "192.168.0.4"
## Apache Kafka variables.
id: 2
[master]
master-node
[slaves]
slave-1
slave-2
---
- name: Download Apache Flink, Yarn version.
get_url: url="{{ mirror_url }}/flink-{{ version }}/flink-{{ version }}-{{ version_for }}.tgz" dest="{{ download_path }}/flink-{{ version }}-{{ version_for }}.tgz"
environment: proxy_env
tags:
- download
......
---
- name: Download Apache Hadoop.
get_url: url="{{ mirror_url }}/hadoop-{{ version }}/hadoop-{{ version }}.tar.gz" dest="{{ download_path }}/hadoop-{{ version }}.tar.gz"
environment: proxy_env
- name: Uncompress Apache Hadoop.
unarchive: src="{{ download_path }}/hadoop-{{ version }}.tar.gz" dest="{{ installation_path }}" copy=no owner=hduser group=lambda
......
---
- name: Download Apache Kafka.
get_url: url="{{ mirror_url }}/{{ version }}/kafka_{{ scala_version }}-{{ version }}.tgz" dest="{{ download_path }}/kafka_{{ scala_version }}-{{ version }}.tgz"
environment: proxy_env
- name: Uncompress Apache Kafka.
unarchive: src="{{ download_path }}/kafka_{{ scala_version }}-{{ version }}.tgz" dest="{{ installation_path }}" copy=no owner=kafka group=lambda
......
---
- name: Copy hosts file.
template: src=hosts.j2 dest=/etc/hosts backup=no owner=root group=lambda mode=0750
- name: Upgrade packages.
apt: upgrade=dist update_cache=yes
- name: Install the latest Java 7.
apt: name=openjdk-7-jdk state=latest install_recommends=no update_cache=yes
- name: Copy hosts file.
template: src=hosts.j2 dest=/etc/hosts backup=no owner=root group=lambda mode=0750
- name: Copy environment file.
template: src=environment.j2 dest=/etc/environment backup=no owner=root group=lambda mode=0750
......
---
- name: Distribute root ssh key to all nodes.
authorized_key: user=root key="{{ lookup('file', '/tmp/fetched/root_id_rsa.pub') }}"
# - name: Distribute root ssh key to all nodes.
# authorized_key: user=root key="{{ lookup('file', '/tmp/fetched/root_id_rsa.pub') }}"
- name: Distribute hduser ssh key to all nodes.
authorized_key: user=hduser key="{{ lookup('file', '/tmp/fetched/hduser_id_rsa.pub') }}"
......
......@@ -5,13 +5,13 @@
- name: Include common tasks.
include: common-1.yml
- name: Generate ssh key for root.
shell: cat /dev/zero | ssh-keygen -q -N ""
args:
creates: /root/.ssh/id_rsa.pub
# - name: Generate ssh key for root.
# shell: cat /dev/zero | ssh-keygen -q -N ""
# args:
# creates: /root/.ssh/id_rsa.pub
- name: Fetch id_rsa.pub file from root.
fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/fetched/root_id_rsa.pub flat=yes
# - name: Fetch id_rsa.pub file from root.
# fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/fetched/root_id_rsa.pub flat=yes
- name: Generate ssh key for hduser.
shell: cat /dev/zero | ssh-keygen -q -N ""
......
127.0.0.1 localhost
{% for master in groups["master"] %}
{{ hostvars[master]["internal_ip"] }} {{ master }}
{{ hostvars[master]["internal_ip"] }} {{ master | replace(".vm.okeanos.grnet.gr",".local") }}
{% endfor %}
{% for slave in groups["slaves"] %}
{{ hostvars[slave]["internal_ip"] }} {{ slave }}
{{ hostvars[slave]["internal_ip"] }} {{ slave | replace(".vm.okeanos.grnet.gr",".local") }}
{% endfor %}
# The following lines are desirable for IPv6 capable hosts
......
{% for master in groups["master"] %}
Host {{ master }}
StrictHostKeyChecking no
Host {{ master }}
StrictHostKeyChecking no
{% endfor %}
{% for slave in groups["slaves"] %}
Host {{ slave }}
StrictHostKeyChecking no
Host {{ slave }}
StrictHostKeyChecking no
{% endfor %}
Host 0.0.0.0
StrictHostKeyChecking no
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment