Add variable for the ssh service and ensure its enabled

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 swift cluster
ensuring ssh is enabled and started. If SSH is not running everywhere at
the same time swift ring distribution will not be possible later on in
the role.

Change-Id: Ifbc748019403f0c0712d5f241f118e998d2061d4
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-10-03 23:57:33 -05:00 committed by Kevin Carter (cloudnull)
parent f88a41dc92
commit d40a020678
4 changed files with 18 additions and 0 deletions

View File

@ -47,3 +47,15 @@
notify:
- Restart swift services
- Restart rsyslog
- name: Enable SSHD
systemd:
name: "{{ swift_sshd }}"
state: started
enabled: yes
masked: no
daemon_reload: yes
delegate_to: "{{ item }}"
with_items: "{{ groups['swift_proxy'] }}"
when:
- "inventory_hostname == ((groups['swift_proxy'] | intersect(ansible_play_hosts)) | list)[0]"

View File

@ -39,3 +39,5 @@ swift_service_distro_packages:
- swift-proxy
swift_rsync_service_name: rsync
swift_sshd: ssh

View File

@ -39,3 +39,5 @@ swift_service_distro_packages:
- python-swift
swift_rsync_service_name: rsyncd
swift_sshd: sshd

View File

@ -40,3 +40,5 @@ swift_service_distro_packages:
- python-swift
swift_rsync_service_name: rsyncd
swift_sshd: sshd