Add openssh playbooks
This commit is contained in:
parent
daae7a7cd9
commit
bee1a9627c
5 changed files with 41 additions and 1 deletions
23
openssh/config.ansible.yml
Normal file
23
openssh/config.ansible.yml
Normal 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
|
|
@ -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
7
openssh/pkg.ansible.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: Install openssh package
|
||||||
|
package:
|
||||||
|
state: present
|
||||||
|
name:
|
||||||
|
- openssh-server
|
7
openssh/service.ansible.yml
Normal file
7
openssh/service.ansible.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: Enable openssh service
|
||||||
|
service:
|
||||||
|
name: sshd
|
||||||
|
state: started
|
||||||
|
enabled: true
|
|
@ -2,3 +2,4 @@
|
||||||
- import_playbook: system/init.ansible.yml
|
- import_playbook: system/init.ansible.yml
|
||||||
- import_playbook: network/init.ansible.yml
|
- import_playbook: network/init.ansible.yml
|
||||||
- import_playbook: apps/init.ansible.yml
|
- import_playbook: apps/init.ansible.yml
|
||||||
|
- import_playbook: openssh/init.ansible.yml
|
||||||
|
|
Loading…
Reference in a new issue