Skip to content

Commit

Permalink
Merge pull request #858 from smithfarm/wip-openstack-opensuse
Browse files Browse the repository at this point in the history
Get dummy suite to run on openSUSE Leap in OpenStack
  • Loading branch information
zmc committed Aug 29, 2016
2 parents 863b23d + 87caf37 commit 9da30bb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'openstack-centos-7.1-user-data.txt',
'openstack-centos-7.2-user-data.txt',
'openstack-debian-8.0-user-data.txt',
'openstack-opensuse-user-data.txt',
'openstack-opensuse-42.1-user-data.txt',
'openstack-teuthology.cron',
'openstack-teuthology.init',
'openstack-ubuntu-12.04-user-data.txt',
Expand Down
1 change: 1 addition & 0 deletions teuthology/openstack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class OpenStack(object):
'centos-7.0': 'http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1503.qcow2',
'centos-7.1': 'http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1503.qcow2',
'centos-7.2': 'http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1511.qcow2',
'opensuse-42.1': 'http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2',
'ubuntu-12.04': 'https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img',
'ubuntu-14.04': 'https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img',
'debian-8.0': 'http://cdimage.debian.org/cdimage/openstack/current/debian-8.2.0-openstack-amd64.qcow2',
Expand Down
25 changes: 25 additions & 0 deletions teuthology/openstack/openstack-opensuse-42.1-user-data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#cloud-config
bootcmd:
- echo nameserver {nameserver} | tee /etc/resolv.conf
- echo search {lab_domain} | tee -a /etc/resolv.conf
- sed -ie 's/PEERDNS="yes"/PEERDNS="no"/' /etc/sysconfig/network-scripts/ifcfg-eth0
- ( curl --silent http://169.254.169.254/2009-04-04/meta-data/hostname | sed -e 's/[\.-].*//' ; eval printf "%03d%03d%03d%03d.{lab_domain}" $(curl --silent http://169.254.169.254/2009-04-04/meta-data/local-ipv4 | tr . ' ' ) ) | tee /etc/hostname
- hostname $(cat /etc/hostname)
- ( echo ; echo "MaxSessions 1000" ) >> /etc/ssh/sshd_config
# See https://github.com/ceph/ceph-cm-ansible/blob/master/roles/cobbler/templates/snippets/cephlab_user
- ( echo 'Defaults !requiretty' ; echo 'Defaults visiblepw' ) | tee /etc/sudoers.d/cephlab_sudo ; chmod 0440 /etc/sudoers.d/cephlab_sudo
preserve_hostname: true
users:
- name: {username}
gecos: User
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
groups: users
runcmd:
- ( MYHOME=/home/{username} ; mkdir $MYHOME/.ssh ; chmod 700 $MYHOME/.ssh ; cp /root/.ssh/authorized_keys $MYHOME/.ssh ; chown -R {username}.users $MYHOME/.ssh )
packages:
- python
- wget
- git
- ntp
- rsyslog
final_message: "{up}, after $UPTIME seconds"
13 changes: 0 additions & 13 deletions teuthology/openstack/openstack-opensuse-user-data.txt

This file was deleted.

6 changes: 5 additions & 1 deletion teuthology/orchestra/opsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class OS(object):
__slots__ = ['name', 'version', 'codename', 'package_type']

_deb_distros = ('debian', 'ubuntu')
_rpm_distros = ('fedora', 'rhel', 'centos', 'suse')
_rpm_distros = ('fedora', 'rhel', 'centos', 'opensuse')

def __init__(self, name=None, version=None, codename=None):
self.name = name
Expand Down Expand Up @@ -99,6 +99,8 @@ def from_python(cls, python_val):
name = 'centos'
elif name.startswith('fedora'):
name = 'fedora'
elif name.startswith('opensuse'):
name = 'opensuse'
obj = cls(name=name, version=version, codename=codename.lower())
return obj

Expand All @@ -124,6 +126,8 @@ def from_lsb_release(cls, lsb_release_str):
name = cls._get_value(str_, 'Distributor ID')
if name == 'RedHatEnterpriseServer':
name = 'rhel'
elif name.startswith('openSUSE'):
name = 'opensuse'
name = name.lower()

version = cls._get_value(str_, 'Release')
Expand Down

0 comments on commit 9da30bb

Please sign in to comment.