2014-12-18 23:12:51 +01:00
|
|
|
---
|
2014-12-21 21:29:13 +01:00
|
|
|
- name: Role set up
|
2014-12-18 23:12:51 +01:00
|
|
|
include_vars: "{{ item }}"
|
|
|
|
with_first_found:
|
2014-12-22 11:05:09 +01:00
|
|
|
- "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
|
2014-12-22 21:18:35 +01:00
|
|
|
- "{{ ansible_distribution }}.yml"
|
2014-12-18 23:12:51 +01:00
|
|
|
- "{{ ansible_os_family }}.yml"
|
|
|
|
- default.yml
|
2014-12-25 21:02:44 +01:00
|
|
|
tags:
|
|
|
|
- sshd
|
2014-12-18 23:12:51 +01:00
|
|
|
|
2014-12-21 21:29:13 +01:00
|
|
|
- name: Installed
|
|
|
|
action: >
|
|
|
|
{{ ansible_pkg_mgr }}
|
|
|
|
name="{{ item }}"
|
|
|
|
state=installed
|
|
|
|
with_items: sshd_packages
|
2014-12-25 21:02:44 +01:00
|
|
|
tags:
|
|
|
|
- sshd
|
2014-12-21 21:29:13 +01:00
|
|
|
|
|
|
|
- name: Configured
|
2014-12-18 23:12:51 +01:00
|
|
|
template:
|
|
|
|
src: sshd_config.j2
|
|
|
|
dest: "{{ sshd_config_file }}"
|
2014-12-22 10:25:31 +01:00
|
|
|
owner: "{{ sshd_config_owner }}"
|
|
|
|
group: "{{ sshd_config_group }}"
|
2014-12-22 11:05:09 +01:00
|
|
|
mode: "{{ sshd_config_mode }}"
|
2014-12-18 23:12:51 +01:00
|
|
|
notify: check and reload sshd
|
2014-12-25 21:02:44 +01:00
|
|
|
tags:
|
|
|
|
- sshd
|
2014-12-21 21:29:13 +01:00
|
|
|
|
|
|
|
- name: Service enabled and running
|
|
|
|
service:
|
|
|
|
name: "{{ sshd_service }}"
|
|
|
|
enabled: true
|
|
|
|
state: running
|
2014-12-25 21:02:44 +01:00
|
|
|
tags:
|
|
|
|
- sshd
|