Commit f211316b authored by Georgios Ouzounis's avatar Georgios Ouzounis

LAM-49 Create an ssh key pair for hduser and flink users on master. They need...

LAM-49 Create an ssh key pair for hduser and flink users on master. They need to access hduser and flink user respectively on slaves.
parent 64421604
......@@ -10,8 +10,3 @@
- name: Copy environment file.
template: src=environment.j2 dest=/etc/environment backup=no owner=root group=lambda mode=0750
- name: Generate ssh key.
shell: cat /dev/zero | ssh-keygen -q -N ""
args:
creates: /root/.ssh/id_rsa.pub
---
- name: Distribute ssh key to all nodes.
authorized_key: user=root key="{{ lookup('file', '/tmp/fetched/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') }}"
- name: Distribute flink ssh key to all nodes.
authorized_key: user=flink key="{{ lookup('file', '/tmp/fetched/flink_id_rsa.pub') }}"
......@@ -5,11 +5,38 @@
- name: Include common tasks.
include: common-1.yml
- name: Fetch id_rsa.pub file from master.
fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/fetched/ flat=yes
- name: Generate ssh key for root.
shell: cat /dev/zero | ssh-keygen -q -N ""
args:
creates: /root/.ssh/id_rsa.pub
- name: Set up ssh config.
- 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 ""
args:
creates: /home/hduser/.ssh/id_rsa.pub
- name: Fetch id_rsa.pub file from hduser user.
fetch: src=/home/hduser/.ssh/id_rsa.pub dest=/tmp/fetched/hduser_id_rsa.pub flat=yes
- name: Generate ssh key for flink user.
shell: cat /dev/zero | ssh-keygen -q -N ""
args:
creates: /home/flink/.ssh/id_rsa.pub
- name: Fetch id_rsa.pub file from hduser.
fetch: src=/home/flink/.ssh/id_rsa.pub dest=/tmp/fetched/flink_id_rsa.pub flat=yes
- name: Set up ssh config for root user.
template: src=ssh-config.j2 dest=/root/.ssh/config owner=root group=root mode=664
- name: Set up ssh config for hduser user.
template: src=ssh-config.j2 dest=/home/hduser/.ssh/config owner=hduser group=lambda mode=600
- name: Set up ssh config for flink user.
template: src=ssh-config.j2 dest=/home/flink/.ssh/config owner=flink group=lambda mode=600
- name: Include more common tasks.
include: common-2.yml
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