From 2589ce6db0d9c67565ce84e916fcad393066df4e Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 1 Oct 2018 19:11:45 -0500 Subject: [PATCH] Add variable for the ssh service The ssh service on ubuntu based systems is "ssh" which is established by the service unit path `/lib/systemd/system/ssh.service`. When running the service will respond to the name "sshd" however this is just an alias. This change adds a variable to set the service unit name based on the distro family which will allow the service to start should it be masked. The change will now delegate to all nodes within the keystone cluster ensuring ssh is enabled and started. If SSH is not running everywhere at the same time keystone key rotation will not be possible later on in the role. Change-Id: I552a6bb09b3ab917bfcad140633fe4662c0c5a82 Signed-off-by: Kevin Carter --- tasks/keystone_post_install.yml | 4 +++- vars/redhat-7.yml | 2 ++ vars/suse.yml | 2 ++ vars/ubuntu.yml | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tasks/keystone_post_install.yml b/tasks/keystone_post_install.yml index 13b621fe..18fc4462 100644 --- a/tasks/keystone_post_install.yml +++ b/tasks/keystone_post_install.yml @@ -15,11 +15,13 @@ - name: Enable SSHD systemd: - name: sshd + name: "{{ keystone_sshd }}" state: started enabled: yes masked: no daemon_reload: yes + delegate_to: "{{ item }}" + with_items: "{{ ansible_play_hosts }}" - name: Generate the keystone system user ssh key user: diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index f56d20f0..1963b3ee 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -83,3 +83,5 @@ keystone_nginx_conf_path: "conf.d" keystone_system_service_name: httpd keystone_uwsgi_bin: '/usr/sbin' + +keystone_sshd: sshd \ No newline at end of file diff --git a/vars/suse.yml b/vars/suse.yml index 683f7dfd..82f65cff 100644 --- a/vars/suse.yml +++ b/vars/suse.yml @@ -109,3 +109,5 @@ keystone_nginx_conf_path: 'conf.d' keystone_system_service_name: apache2 keystone_uwsgi_bin: '/usr/sbin' + +keystone_sshd: sshd \ No newline at end of file diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml index 77ed03a6..dff56511 100644 --- a/vars/ubuntu.yml +++ b/vars/ubuntu.yml @@ -97,3 +97,5 @@ keystone_nginx_conf_path: "sites-available" keystone_system_service_name: apache2 keystone_uwsgi_bin: '/usr/bin' + +keystone_sshd: ssh \ No newline at end of file