mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-23 03:20:19 +01:00
42 lines
941 B
YAML
42 lines
941 B
YAML
---
|
|
- name: Set OS dependent variables
|
|
include_vars: "{{ item }}"
|
|
with_first_found:
|
|
- "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
|
|
- "{{ ansible_distribution }}.yml"
|
|
- "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
|
|
- "{{ ansible_os_family }}.yml"
|
|
tags:
|
|
- sshd
|
|
|
|
- name: OS is supported
|
|
assert:
|
|
that: sshd_os_supported == True
|
|
|
|
- name: Installed
|
|
action: >
|
|
{{ ansible_pkg_mgr }}
|
|
name="{{ item }}"
|
|
state=installed
|
|
with_items: sshd_packages
|
|
tags:
|
|
- sshd
|
|
|
|
- name: Configuration
|
|
template:
|
|
src: sshd_config.j2
|
|
dest: "{{ sshd_config_file }}"
|
|
owner: "{{ sshd_config_owner }}"
|
|
group: "{{ sshd_config_group }}"
|
|
mode: "{{ sshd_config_mode }}"
|
|
notify: check_and_reload_sshd
|
|
tags:
|
|
- sshd
|
|
|
|
- name: Service enabled and running
|
|
service:
|
|
name: "{{ sshd_service }}"
|
|
enabled: true
|
|
state: running
|
|
tags:
|
|
- sshd
|