diff options
Diffstat (limited to 'roles/ssh/tasks/main.yml')
-rw-r--r-- | roles/ssh/tasks/main.yml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/roles/ssh/tasks/main.yml b/roles/ssh/tasks/main.yml new file mode 100644 index 0000000..a526b4e --- /dev/null +++ b/roles/ssh/tasks/main.yml @@ -0,0 +1,36 @@ +--- +- name: ssh get vars + include_vars: default.yml + +- name: ssh get OS vars + include_vars: '{{ item }}' + with_first_found: + - '{{ ansible_distribution }}.yml' + - default.yml + +- name: ssh get host-specific vars + include_vars: '{{ item }}' + with_first_found: + - files: + - '../hosts/{{ ansible_fqdn }}.yml' + skip: true + +- name: ssh_config conf + template: src='{{ item }}' dest='{{ ssh_config_file }}' owner=root group='{{ ssh_group }}' mode=0644 + with_first_found: + - files: + - '../hosts/ssh_config.{{ ansible_fqdn }}' + - 'ssh_config.{{ ansible_distribution }}' + - ssh_config + notify: + - ssh restart + +- name: sshd_config conf + template: src='{{ item }}' dest='{{ sshd_config_file }}' owner=root group='{{ ssh_group }}' mode=0644 + with_first_found: + - files: + - '../hosts/sshd_config.{{ ansible_fqdn }}' + - 'sshd_config.{{ ansible_distribution }}' + - sshd_config + notify: + - ssh restart |