debian: add support

This patch adds the Debian jobs for this role to make sure
it's always passing as well as updates the meta and creates
debian.yml var file to reflect it's support of Debian accordingly.

Change-Id: I2653aea2aebc95bfc67fe49bc66fb68a4f996170
This commit is contained in:
Guilherme Steinmüller 2019-04-12 13:21:49 +00:00
parent 1cfa60ca9c
commit 29bd1ed281
5 changed files with 134 additions and 0 deletions

View File

@ -20,6 +20,9 @@ galaxy_info:
license: Apache2
min_ansible_version: 2.2.0
platforms:
- name: Debian
versions:
- stretch
- name: Ubuntu
versions:
- bionic

View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# {{ ansible_managed }}
set -e
{{ nspawn_cache_prep_pre_commands }}
{% include 'templates/prep-scripts/_container_sys_setup.sh.j2' %}
# Update base distribution
export DEBIAN_FRONTEND=noninteractive
apt-get remove -y --purge snap* nspawn* lxd* resolvconf || true
apt-get update
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes eatmydata
export LD_PRELOAD=/usr/lib/{{ ansible_architecture }}-linux-gnu/libeatmydata.so
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes {{ nspawn_container_distro_required_packages | join(' ') }}
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes {{ nspawn_container_distro_packages | join(' ') }}
apt-get upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes
apt-get clean
rm /var/cache/apt/archives/lock || true
rm -f /usr/bin/python || true
ln -s /usr/bin/python2.7 /usr/bin/python
for action in disable; do
systemctl ${action} resolvconf.service || true
systemctl ${action} systemd-networkd-resolvconf-update.path || true
systemctl ${action} systemd-networkd-resolvconf-update.service || true
systemctl ${action} ssh.service || true
done
systemctl enable systemd-hostnamed.service
systemctl enable systemd-networkd.service
systemctl enable systemd-resolved.service
ln -sf /var/run/systemd/resolve/resolv.conf /etc/resolv.conf
userdel --force --remove debian || true
{{ nspawn_cache_prep_post_commands }}

67
vars/debian-9.yml Normal file
View File

@ -0,0 +1,67 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
_nspawn_hosts_container_image_url: "https://github.com/debuerreotype/docker-debian-artifacts/raw/dist-{{ nspawn_cache_map.arch }}/{{ ansible_distribution_release }}/rootfs.tar.xz"
_nspawn_hosts_distro_packages:
- bridge-utils
- btrfs-tools
- dbus
- dnsmasq
- git
- iptables
- irqbalance
- psmisc
- pxz
- systemd-container
_nspawn_container_distro_required_packages:
- gnupg
_nspawn_container_distro_packages:
- apt-transport-https
- ca-certificates
- cron
- dbus
- debianutils
- gcc
- iproute2
- iputils-ping
- libnss-resolve
- libpython2.7
- locales
- netbase
- openssh-server
- openssl
- python2.7
- python-apt
- python-dev
- rsync
- sudo
- systemd
- tzdata
- tar
- wget
_nspawn_cache_map:
distro: debian
arch: "{{ nspawn_architecture_mapping.get(ansible_architecture) }}"
release: stretch
_nspawn_copy_from_host:
- /etc/apt/sources.list
- /etc/apt/apt.conf.d/
- /etc/apt/preferences.d/
- /etc/apt/trusted.gpg.d

View File

@ -27,6 +27,11 @@
parent: openstack-ansible-nspawn-container-create
nodeset: centos-7
- job:
name: openstack-ansible-nspawn-container-create-debian-stable
parent: openstack-ansible-nspawn-container-create
nodeset: debian-stable
- job:
name: openstack-ansible-nspawn-container-create-opensuse-423
parent: openstack-ansible-nspawn-container-create

View File

@ -21,6 +21,8 @@
check:
jobs:
- openstack-ansible-nspawn-container-create-centos-7
- openstack-ansible-nspawn-container-create-debian-stable:
voting: false
- openstack-ansible-nspawn-container-create-opensuse-423
- openstack-ansible-nspawn-container-create-ubuntu-xenial
- openstack-ansible-nspawn-container-create-ubuntu-bionic