2023-03-30 14:28:10 +02:00
|
|
|
# ===================================================================================================
|
2023-02-27 16:39:00 +01:00
|
|
|
# ? ABOUT
|
|
|
|
|
# @author : Noah Knegt
|
|
|
|
|
# @email : personal@noahknegt.com
|
|
|
|
|
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
|
|
|
# @createdOn : 27-02-2023
|
|
|
|
|
# @description : This will setup the ssh server on the machine.
|
2023-03-30 14:28:10 +02:00
|
|
|
# ===================================================================================================
|
2023-02-27 16:39:00 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
- name: Install or update openssh
|
2023-02-27 17:12:08 +01:00
|
|
|
package:
|
2023-02-27 16:39:00 +01:00
|
|
|
name: "{{ openssh_package }}"
|
|
|
|
|
state: latest
|
|
|
|
|
notify:
|
|
|
|
|
- restart_sshd
|
|
|
|
|
|
|
|
|
|
- name: enable ssh daemon
|
|
|
|
|
service:
|
|
|
|
|
name: "{{ openssh_service }}"
|
|
|
|
|
state: started
|
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
|
|
- name: configure sshd
|
|
|
|
|
template:
|
|
|
|
|
src: sshd_config.j2
|
|
|
|
|
dest: /etc/ssh/sshd_config
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: 0644
|
|
|
|
|
notify:
|
|
|
|
|
- restart_sshd
|
|
|
|
|
|
|
|
|
|
- name: copy sshd banner
|
|
|
|
|
copy:
|
|
|
|
|
src: ssh_banner.net
|
|
|
|
|
dest: /etc/issue.net
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: 0644
|