CSC Ansible Playbooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-playbooks/distribute-ssh-config.yml

18 lines
636 B

---
- hosts: all
gather_facts: no
become: yes
tasks:
- name: generate ed25519 key
shell: ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' < /dev/null
args:
creates: /etc/ssh/ssh_host_ed25519_key
- name: copy ssh config
copy: src={{ item.src }} dest={{ item.dest }} backup=yes
with_items:
- { src: 'files/ssh_config', dest: '/etc/ssh/ssh_config' }
- { src: 'files/sshd_config', dest: '/etc/ssh/sshd_config' }
- { src: 'files/ssh_known_hosts', dest: '/etc/ssh/ssh_known_hosts' }
- name: restart sshd
service: name=ssh state=restarted