ansible-sshd/tasks/main.yml

30 lines
602 B
YAML
Raw Normal View History

2014-12-18 23:12:51 +01:00
---
- name: Role set up
2014-12-18 23:12:51 +01:00
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- default.yml
- name: Installed
action: >
{{ ansible_pkg_mgr }}
name="{{ item }}"
state=installed
with_items: sshd_packages
- name: Configured
2014-12-18 23:12:51 +01:00
template:
src: sshd_config.j2
dest: "{{ sshd_config_file }}"
owner: "{{ sshd_user }}"
group: "{{ sshd_group }}"
2014-12-18 23:12:51 +01:00
mode: 600
notify: check and reload sshd
- name: Service enabled and running
service:
name: "{{ sshd_service }}"
enabled: true
state: running