Merge "elements: Add new openssh-server element"

This commit is contained in:
Jenkins 2016-11-28 17:09:15 +00:00 committed by Gerrit Code Review
commit 7644681815
11 changed files with 63 additions and 4 deletions

View File

@ -1 +1,2 @@
debian-minimal debian-minimal
openssh-server

View File

@ -1,4 +1,3 @@
openssh-server:
file: file:
less: less:
kbd: kbd:

View File

@ -1,3 +1,3 @@
dib-init-system dib-init-system
install-static install-static
package-installs openssh-server

View File

@ -1 +1 @@
package-installs openssh-server

View File

@ -1 +0,0 @@
openssh-server:

View File

@ -0,0 +1,14 @@
==============
openssh-server
==============
This element ensures that openssh server is installed and enabled during boot.
Note
----
Most cloud images come with the openssh server service installed and enabled
during boot. However, certain cloud images, especially those created by the
\*-minimal elements may not have it installed or enabled. In these cases,
using this element may be helpful to ensure your image will accessible via SSH.
It's usually helpful to combine this element with others such as the
`runtime-ssh-host-keys`.

View File

@ -0,0 +1,3 @@
dib-init-system
package-installs
runtime-ssh-host-keys

View File

@ -0,0 +1,10 @@
{
"family": {
"suse": {
"openssh-server": "openssh"
},
"gentoo": {
"openssh-server": "openssh"
}
}
}

View File

@ -0,0 +1,29 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
case "$DIB_INIT_SYSTEM" in
upstart)
# nothing to do
exit 0
;;
systemd)
if [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then
systemctl enable ssh.service
else
systemctl enable sshd.service
fi
;;
openrc)
# let dib-init-system's postinstall handle enabling init scripts
exit 0
;;
*)
echo "Unsupported init system"
exit 1
;;
esac

View File

@ -0,0 +1,4 @@
---
features:
- New openssh-server element to ensure that the openssh
server is installed and enabled during boot.