spark/roles/base/tasks/ssh.yml

64 lines
1.5 KiB
YAML

---
- name: Install OpenSSH
pacman: name=openssh state=present
tags:
- ssh
- name: Push OpenSSH daemon configuration file
template: src=sshd_config.j2 dest=/etc/ssh/sshd_config
tags:
- ssh
- name: Create OpenSSH systemd unit file directory
file: path=/etc/systemd/system/sshd.socket.d state=directory
when: ssh.enable_sshd == "True"
tags:
- ssh
- name: Push OpenSSH socket unit file
template: src=sshd-socket-override.conf.j2 dest=/etc/systemd/system/sshd.socket.d/override.conf
when: ssh.enable_sshd == "True"
tags:
- ssh
- name: Enable and start OpenSSH
service: name=sshd.socket enabled=yes state=started
when: ssh.enable_sshd == "True"
tags:
- ssh
- name: Install sshfs
pacman: name=sshfs state=present
tags:
- ssh
- name: Copy fuse configuration file
copy: src=fuse.conf dest=/etc/fuse.conf
tags:
- ssh
- name: Install keychain
pacman: name=keychain state=present
tags:
- ssh
- name: Install x11-ask-pass
pacman: name=x11-ssh-askpass state=present
tags:
- ssh
- name: Make directory for user SSH key
file: path=/home/{{ user.name }}/.ssh state=directory owner={{ user.name }} group={{ user.group }}
tags:
- ssh
- name: Install user SSH key
copy: src={{ ssh.user_key }} dest=/home/{{ user.name }}/.ssh/id_rsa mode=600 owner={{ user.name }} group={{ user.group }}
when: ssh.user_key is defined
tags:
- ssh
- name: Install Mosh
pacman: name=mosh state=present
tags:
- ssh