From dfa61dcea06bf329941c831b3525d4e406b00db4 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 17 Mar 2015 15:12:41 -0500 Subject: [PATCH] Configure ssh on rhel in the common role Signed-off-by: Andrew Schoen --- roles/common/handlers/main.yml | 5 +++++ roles/common/tasks/setup-redhat.yml | 22 +++++++++++++++++++ ...config_redhat_7.0 => sshd_config_rhel_7.0} | 0 3 files changed, 27 insertions(+) rename roles/common/templates/ssh/{sshd_config_redhat_7.0 => sshd_config_rhel_7.0} (100%) diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 6d96e57..9957695 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -3,3 +3,8 @@ service: name: "{{ ntp_service_name }}" state: restarted + +- name: restart sshd + service: + name: sshd + state: restarted diff --git a/roles/common/tasks/setup-redhat.yml b/roles/common/tasks/setup-redhat.yml index 8248696..48e41bb 100644 --- a/roles/common/tasks/setup-redhat.yml +++ b/roles/common/tasks/setup-redhat.yml @@ -68,6 +68,28 @@ - raid.pl - diskusage.pl +- name: Upload rhel version specific sshd_config. + template: + src: "ssh/sshd_config_rhel_{{ ansible_distribution_version }}" + dest: /etc/ssh/sshd_config + owner: root + group: root + mode: 0755 + notify: + - restart sshd + tags: + - ssh + +- name: Upload ssh_config. + template: + src: ssh/ssh_config + dest: /etc/ssh/ssh_config + owner: root + group: root + mode: 0755 + tags: + - ssh + - name: Include version specific tasks. include: redhat/rhel_7.0.yml when: ansible_distribution_version == "7.0" diff --git a/roles/common/templates/ssh/sshd_config_redhat_7.0 b/roles/common/templates/ssh/sshd_config_rhel_7.0 similarity index 100% rename from roles/common/templates/ssh/sshd_config_redhat_7.0 rename to roles/common/templates/ssh/sshd_config_rhel_7.0 -- 2.39.5