Add openssh playbooks

This commit is contained in:
LinuxSquare 2024-07-06 10:10:42 +02:00
parent daae7a7cd9
commit bee1a9627c
5 changed files with 41 additions and 1 deletions

View file

@ -0,0 +1,23 @@
- hosts: localhost
tasks:
- name: Populate sshd_config
template:
src: files/openssh_sshd_config
dest: /etc/ssh/sshd_config
mode: '0644'
owner: root
group: root
- name: Configure root .ssh directory
file:
state: directory
path: /root/.ssh
mode: '0755'
owner: root
group: root
- name: Configure root authorized_keys
template:
src: files/openssh_authorized_keys
dest: /root/.ssh/authroized_keys
mode: '0644'
owner: root
group: root

View file

@ -1 +1,3 @@
- import_playbook:
- import_playbook: pkg.ansible.yml
- import_playbook: config.ansible.yml
- import_playbook: service.ansible.yml

7
openssh/pkg.ansible.yml Normal file
View file

@ -0,0 +1,7 @@
- hosts: localhost
tasks:
- name: Install openssh package
package:
state: present
name:
- openssh-server

View file

@ -0,0 +1,7 @@
- hosts: localhost
tasks:
- name: Enable openssh service
service:
name: sshd
state: started
enabled: true

View file

@ -2,3 +2,4 @@
- import_playbook: system/init.ansible.yml
- import_playbook: network/init.ansible.yml
- import_playbook: apps/init.ansible.yml
- import_playbook: openssh/init.ansible.yml