diff --git a/templates/prep-scripts/centos_7_prep.sh.j2 b/templates/prep-scripts/centos_7_prep.sh.j2 index 408efe0b..27ad5e0e 100644 --- a/templates/prep-scripts/centos_7_prep.sh.j2 +++ b/templates/prep-scripts/centos_7_prep.sh.j2 @@ -5,7 +5,9 @@ set -e -x {% include 'templates/prep-scripts/_container_sys_setup.sh.j2' %} -rpm --import /etc/pki/rpm-gpg/* +if [[ -d "/etc/pki/rpm-gpg" ]]; then + rpm --import /etc/pki/rpm-gpg/* || true +fi # The containers do not need the LXC repository (only hosts need it). rm -f /etc/yum.repos.d/thm-lxc2.0* diff --git a/templates/prep-scripts/opensuse_leap_42_prep.sh.j2 b/templates/prep-scripts/opensuse_leap_42_prep.sh.j2 index 89098346..6d8e7331 100644 --- a/templates/prep-scripts/opensuse_leap_42_prep.sh.j2 +++ b/templates/prep-scripts/opensuse_leap_42_prep.sh.j2 @@ -23,8 +23,11 @@ chage -I -1 -d -1 -m 0 -M 99999 -E -1 root # NOTE(hwoarang): Enable sshd which has been explicitely disabled in # https://github.com/lxc/lxc-ci/commit/8dc7105399350a59698538a12b6d5a1a880ef2ba -systemctl -q unmask sshd -systemctl -q enable sshd +if systemctl list-unit-files sshd.service | egrep '(masked|disabled)'; then + systemctl -q unmask sshd + systemctl -q enable sshd +fi + rm /etc/machine-id || true rm /var/lib/dbus/machine-id || true touch /etc/machine-id diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index e860c67f..b1c21ed8 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -22,6 +22,7 @@ _lxc_cache_map: copy_from_host: - /etc/environment - /etc/localtime + - /etc/protocols - /etc/pki/rpm-gpg/ - /etc/yum/pluginconf.d/fastestmirror.conf - /etc/yum.repos.d/ @@ -42,6 +43,7 @@ _lxc_cache_distro_packages: - python2 - python-devel - rsync + - setup - sudo - systemd - systemd-sysv diff --git a/vars/suse-42.yml b/vars/suse-42.yml index 6388222a..d46a89dc 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -24,6 +24,7 @@ _lxc_cache_map: copy_from_host: - /etc/environment - /etc/localtime + - /etc/protocols - /etc/zypp/repos.d/repo-oss.repo - /etc/zypp/repos.d/repo-update.repo @@ -38,6 +39,7 @@ _lxc_cache_distro_packages: - iputils - libffi-devel - libopenssl-devel + - netcfg - openssh - openssl - python diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index ebaed795..ccbd7237 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -26,6 +26,7 @@ _lxc_cache_map: - /etc/environment - /etc/localtime - /root/repo.keys + - /etc/protocols _lxc_cache_prep_template: "prep-scripts/ubuntu_16_prep.sh.j2" @@ -39,6 +40,7 @@ _lxc_cache_distro_packages: - iputils-ping - libffi-dev - libssl-dev + - netbase - openssh-server - openssl - python2.7