beaker: support ssh service name on centos

In a previous patch, we added Centos support for Beaker but we forgot
to change the SSH service name.
On ubuntu, service name is ssh, and on RH systems it's sshd.

Also use systemctl on RH because 'service' is not in PATH:
/usr/bin/systemctl
/usr/sbin/service
Since we use sudo without option, we should use systemctl to manage the
service.

Also install `bundle` which is needed by Beaker to run.
This package was installed in the previous image we were using, but not
on this one.

Change-Id: I6be34f2c6a8b4effd49e27dff0fbdeffafc4c5cb
This commit is contained in:
Emilien Macchi 2015-05-08 12:03:39 -04:00
parent 006d7266b9
commit 7a30db06c1

@ -47,9 +47,14 @@
ssh-keygen -f ~/.ssh/id_rsa -b 2048 -C "beaker key" -P ""
sudo mkdir -p /root/.ssh
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
sudo service ssh restart
if [ -f /usr/bin/yum ]; then
sudo systemctl restart sshd
elif [ -f /usr/bin/apt-get ]; then
sudo service ssh restart
fi
- revoke-sudo
- shell: |
sudo gem install bundler --no-rdoc --no-ri --verbose
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
bundle install