diff --git a/Vagrantfile b/Vagrantfile index bf2400c1..7691c3cc 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -31,8 +31,8 @@ Vagrant.configure(2) do |config| ./run_tests.sh SHELL - config.vm.define "centos7" do |centos7| - centos7.vm.box = "centos/7" + config.vm.define "centos8" do |centos8| + centos8.vm.box = "centos/8" end config.vm.define "debian8" do |debian8| diff --git a/defaults/main.yml b/defaults/main.yml index a82be866..77e9577a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -260,23 +260,4 @@ lxc_centos_package_key: "{{ _lxc_centos_package_key }}" # the OBS repositories. If you want to use the same mirror in both cases, then leave the # 'lxc_hosts_opensuse_mirror_obs_url' to its default value. lxc_hosts_opensuse_mirror_url: "{{ opensuse_mirror | default('http://download.opensuse.org') }}" -lxc_hosts_opensuse_mirror_obs_url: "{{ lxc_hosts_opensuse_mirror_url }}" - -## A list of 'legacy' lxc configuration keys and their corresponding new -## keys. Use this map to substitute keys suitable for other/newer lxc versions -lxc_template_config_key_mapping: - 4: - fstab: lxc.mount.fstab - rootfs: lxc.rootfs.path - rootfs_backend: lxc.rootfs.backend - uts_name: lxc.uts.name - 3: - fstab: lxc.mount.fstab - rootfs: lxc.rootfs.path - rootfs_backend: lxc.rootfs.backend - uts_name: lxc.uts.name - 2: - fstab: lxc.mount.fstab - rootfs: lxc.rootfs - rootfs_backend: lxc.rootfs.backend - uts_name: lxc.utsname +lxc_hosts_opensuse_mirror_obs_url: "{{ lxc_hosts_opensuse_mirror_url }}" \ No newline at end of file diff --git a/meta/main.yml b/meta/main.yml index eefae6cd..fd2ac9bd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -26,7 +26,7 @@ galaxy_info: - bionic - name: EL versions: - - 7 + - 8 - name: opensuse versions: - 15.0 diff --git a/run_tests.sh b/run_tests.sh index 3129599c..93e91dde 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -51,13 +51,10 @@ fi # Source distribution information source /etc/os-release || source /usr/lib/os-release -# Prefer dnf over yum for CentOS. -which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum' - # Figure out the appropriate package install command case ${ID,,} in *suse*) pkg_mgr_cmd="zypper -n in" ;; - centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;; + centos|rhel|fedora) pkg_mgr_cmd="dnf install -y" ;; ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;; # Gentoo needs to have version set since it's rolling gentoo) pkg_mgr_cmd="emerge --jobs=4"; VERSION="rolling" ;; diff --git a/tasks/lxc_install_yum.yml b/tasks/lxc_install_yum.yml deleted file mode 100644 index 11155120..00000000 --- a/tasks/lxc_install_yum.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -# 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. - -- name: Deploy upstream COPR yum repo for LXC 2.0 - yum_repository: - name: thm-lxc2.0 - description: "COPR repository for LXC 2.0 packages on CentOS 7" - baseurl: "{{ lxc_centos_package_baseurl }}" - enabled: yes - gpgcheck: yes - gpgkey: "{{ lxc_centos_package_key }}" - repo_gpgcheck: no - priority: 99 - state: present - -- name: Add GPG key for COPR LXC repo - rpm_key: - key: "{{ lxc_centos_package_key }}" - state: present - register: add_keys - until: add_keys is success - retries: 5 - delay: 2 - -- name: Download EPEL gpg keys - get_url: - url: "{{ lxc_centos_epel_key }}" - dest: /etc/pki/rpm-gpg - register: _get_yum_keys - until: _get_yum_keys is success - retries: 5 - delay: 2 - -- name: Install EPEL gpg keys - rpm_key: - key: "/etc/pki/rpm-gpg/{{ lxc_centos_epel_key.split('/')[-1] }}" - state: present - -- name: Install the EPEL repository - yum_repository: - name: epel-lxc_hosts - baseurl: "{{ lxc_centos_epel_mirror ~ '/' ~ ansible_distribution_major_version ~ '/' ~ ansible_architecture }}" - description: 'Extra Packages for Enterprise Linux 7 - $basearch' - gpgcheck: yes - enabled: yes - state: present - includepkgs: 'aria2 python2-lxc' - register: install_epel_repo - until: install_epel_repo is success - retries: 5 - delay: 2 - -- name: Install distro packages - package: - pkg: "{{ lxc_hosts_distro_packages }}" - state: "{{ lxc_hosts_package_state }}" - register: install_packages - until: install_packages is success - retries: 5 - delay: 2 - tags: - - lxc-packages - -- name: Remove sub system lock if found - file: - path: "/var/lock/subsys/lxc" - state: "absent" - owner: "root" - group: "root" - tags: - - lxc-directories - -- name: Enable lxc service - service: - name: lxc - enabled: "yes" - tags: - - lxc_hosts-config diff --git a/tasks/lxc_net.yml b/tasks/lxc_net.yml index 680887f3..4c892fc2 100644 --- a/tasks/lxc_net.yml +++ b/tasks/lxc_net.yml @@ -74,21 +74,6 @@ - lxc-bridge - lxc-interfaces -- name: Create networking post-up and post-down data for Red Hat - lineinfile: - dest: "/etc/sysconfig/network-scripts/ifdown-post" - line: ". /etc/sysconfig/network-scripts/ifdown-post-{{ lxc_net_bridge }}" - insertbefore: "^exit\ 0$" - when: - - ansible_os_family | lower == "redhat" - - ansible_distribution_major_version == "7" - notify: - - Restart bridge - tags: - - lxc-post-up - - lxc-post-down - - lxc_hosts-config - # NOTE(mhayden): There are ifup hooks that handle the customized LXC container # networking. Starting lxc-net will trample over these hooks and cause # networking issues for containers. diff --git a/tasks/lxc_post_install.yml b/tasks/lxc_post_install.yml index a248f993..f8eee2d3 100644 --- a/tasks/lxc_post_install.yml +++ b/tasks/lxc_post_install.yml @@ -39,17 +39,6 @@ - lxc-files - lxc-config -- name: Pull lxc version - command: "lxc-ls --version" - changed_when: false - register: lxc_version - tags: - - skip_ansible_lint - -- name: Enable or Disable lxc three syntax - set_fact: - lxc_major_version: "{{ lxc_version.stdout.split('.')[0] }}" - - name: Drop lxc veth check script copy: src: "lxc-veth-check.sh" diff --git a/templates/prep-scripts/centos_7_prep.sh.j2 b/templates/prep-scripts/centos_7_prep.sh.j2 deleted file mode 100644 index 27ad5e0e..00000000 --- a/templates/prep-scripts/centos_7_prep.sh.j2 +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -set -e -x - -{{ lxc_cache_prep_pre_commands }} - -{% include 'templates/prep-scripts/_container_sys_setup.sh.j2' %} - -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* - -# Prefer dnf over yum for CentOS. -which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum' - -# Create yum/dnf transaction file and run it all at once -echo "update" > /tmp/package-transaction.txt -echo "install {{ lxc_cache_distro_packages | join(' ') }}" >> /tmp/package-transaction.txt -echo "run" >> /tmp/package-transaction.txt -$RHT_PKG_MGR -y shell /tmp/package-transaction.txt -yum-complete-transaction --cleanup-only -rm -f /tmp/package-transaction.txt -rm -f /usr/bin/python -ln -s /usr/bin/python2.7 /usr/bin/python -rm /etc/machine-id || true -rm /var/lib/dbus/machine-id || true -rm /etc/sysctl.d/* || true -echo '' > /etc/sysctl.conf -touch /etc/machine-id -yum clean all -mkdir -p /var/backup -chage -I -1 -d -1 -m 0 -M 99999 -E -1 root - -# Set the IP of the lxcbr0 interface as the DNS server -echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf -systemctl enable systemd-networkd - -{{ lxc_cache_prep_post_commands }} diff --git a/vars/redhat-7-host.yml b/vars/redhat-7-host.yml deleted file mode 100644 index d7566825..00000000 --- a/vars/redhat-7-host.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# 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. - -system_config_dir: "/etc/sysconfig" -systemd_utils_prefix: "/lib/systemd" - -_lxc_centos_package_baseurl: https://copr-be.cloud.fedoraproject.org/results/thm/lxc2.0/epel-7-x86_64/ -_lxc_centos_package_key: https://copr-be.cloud.fedoraproject.org/results/thm/lxc2.0/pubkey.gpg - -# Required rpm packages. -_lxc_hosts_distro_packages: - - aria2 - - bridge-utils - - btrfs-progs - - dbus - - dnsmasq - - git - - libseccomp - - lxc - - lxc-devel - - lxc-libs - - lxc-templates - - policycoreutils-python - - procps - - python2-lxc - - unzip - - xz - -lxc_xz_bin: xz - -lxc_cached_network_interfaces: - - src: "lxc-net-redhat-bridge.cfg.j2" - dest: "/etc/sysconfig/network-scripts/ifcfg-{{ lxc_net_bridge }}" - - src: "lxc-net-suseredhat-postdown.cfg.j2" - dest: "/etc/sysconfig/network-scripts/ifdown-post-{{ lxc_net_bridge }}" - mode: "0755" - interface: "${DEVICE}" diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml deleted file mode 100644 index a0213751..00000000 --- a/vars/redhat-7.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# 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. - -_lxc_hosts_container_image_url: "http://artifacts.ci.centos.org/sig-cloudinstance/centos-7-191001/x86_64/centos-7-x86_64-docker.tar.xz" - -_lxc_cache_map: - distro: centos - arch: "{{ lxc_architecture_mapping.get( ansible_architecture ) }}" - release: 7 - copy_from_host: - - /etc/default/locale - - /etc/environment - - /etc/localtime - - /etc/locale.conf - - /etc/protocols - - /etc/pki/rpm-gpg/ - - /etc/yum/pluginconf.d/fastestmirror.conf - - /etc/yum.repos.d/ - -_lxc_cache_prep_template: "prep-scripts/centos_7_prep.sh.j2" - -_lxc_cache_distro_packages: - - ca-certificates - - cronie - - gcc - - iproute - - iputils - - libffi-devel - - openssh-server - - openssl - - openssl-devel - - policycoreutils - - python2 - - python-devel - - python3-devel - - rsync - - setup - - sudo - - systemd - - systemd-sysv - - systemd-networkd - - systemd-resolved - - tar - - wget - - which - - yum-plugin-priorities - - yum-plugin-rpm-warm-cache - - yum-utils diff --git a/vars/redhat-8-host.yml b/vars/redhat-host.yml similarity index 100% rename from vars/redhat-8-host.yml rename to vars/redhat-host.yml diff --git a/vars/redhat-8.yml b/vars/redhat.yml similarity index 100% rename from vars/redhat-8.yml rename to vars/redhat.yml diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 6b30ad32..3ecbafbb 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -34,9 +34,9 @@ tox_env: dir - job: - name: openstack-ansible-lxc-dir-centos-7 + name: openstack-ansible-lxc-dir-centos-8 parent: openstack-ansible-lxc-container-create - nodeset: centos-7 + nodeset: centos-8 vars: tox_env: dir diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 0c5df709..854f1cb6 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -21,7 +21,7 @@ - release-notes-jobs-python3 check: jobs: - - openstack-ansible-lxc-dir-centos-7 + - openstack-ansible-lxc-dir-centos-8 - openstack-ansible-lxc-dir-ubuntu-bionic - openstack-ansible-lxc-dir-ubuntu-focal - openstack-ansible-lxc-btrfs-ubuntu-bionic