diff --git a/openssh/config.ansible.yml b/openssh/config.ansible.yml new file mode 100644 index 0000000..0524294 --- /dev/null +++ b/openssh/config.ansible.yml @@ -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 diff --git a/openssh/init.ansible.yml b/openssh/init.ansible.yml index 24ca4e1..8ee824d 100644 --- a/openssh/init.ansible.yml +++ b/openssh/init.ansible.yml @@ -1 +1,3 @@ -- import_playbook: +- import_playbook: pkg.ansible.yml +- import_playbook: config.ansible.yml +- import_playbook: service.ansible.yml diff --git a/openssh/pkg.ansible.yml b/openssh/pkg.ansible.yml new file mode 100644 index 0000000..6c28129 --- /dev/null +++ b/openssh/pkg.ansible.yml @@ -0,0 +1,7 @@ +- hosts: localhost + tasks: + - name: Install openssh package + package: + state: present + name: + - openssh-server diff --git a/openssh/service.ansible.yml b/openssh/service.ansible.yml new file mode 100644 index 0000000..6413ed5 --- /dev/null +++ b/openssh/service.ansible.yml @@ -0,0 +1,7 @@ +- hosts: localhost + tasks: + - name: Enable openssh service + service: + name: sshd + state: started + enabled: true diff --git a/top.ansible.yml b/top.ansible.yml index 64e2750..4c92ea4 100644 --- a/top.ansible.yml +++ b/top.ansible.yml @@ -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