21 lines
717 B
YAML
21 lines
717 B
YAML
|
---
|
||
|
# Manage the hdfs ssh keys used by the HDFS HA
|
||
|
- name: Create a ssh key for the hdfs user. Needed by NN automatic failover
|
||
|
user: name=hdfs generate_ssh_key=yes ssh_key_type=rsa ssh_key_bits=2048
|
||
|
tags:
|
||
|
- hdfs-ssh
|
||
|
|
||
|
- name: Fetch the ssh public key. Needed to populate authorized_keys
|
||
|
fetch: src=/usr/lib/hadoop/.ssh/id_rsa.pub dest=/var/tmp/prefix-hdfs-{{ ansible_fqdn }}-id_rsa.pub fail_on_missing=yes flat=yes
|
||
|
tags:
|
||
|
- hdfs-ssh
|
||
|
|
||
|
- name: Authorize the hdfs user ssh key. Needed by NN automatic failover
|
||
|
authorized_key: user=hdfs key="{{ lookup('file', '/var/tmp/prefix-hdfs-{{ item }}.t.hadoop.research-infrastructures.eu-id_rsa.pub') }}"
|
||
|
with_items:
|
||
|
- nn1
|
||
|
- nn2
|
||
|
tags:
|
||
|
- hdfs-ssh
|
||
|
|