Remove support for gentoo

Openstack-Ansible does not maintain support for deploying on gentoo
so we can simplify this ansible role

Change-Id: If2a63a2743714745e0f0b0eea2ee3d5b8d4c9a35
This commit is contained in:
Jonathan Rosser 2021-02-17 16:41:14 +00:00
parent 1e8055c5bf
commit 59abc5a288
7 changed files with 1 additions and 200 deletions

View File

@ -41,9 +41,6 @@ openssl-devel [platform:rpm]
python3-dnf [platform:fedora]
python3-devel [platform:rpm]
# Base requirements for Gentoo
git [platform:gentoo]
# For SELinux
libselinux-python3 [platform:redhat]
libsemanage-python3 [platform:redhat]

View File

@ -64,24 +64,10 @@
shell: "ifdown {{ lxc_net_bridge }} || true"
notify:
- Bring bridge up
- Reload networkd
- Veth check
- name: Bring bridge up
command: "ifup {{ lxc_net_bridge }}"
when:
- "ansible_distribution | lower != 'gentoo'"
- name: Reload networkd
systemd:
name: "systemd-networkd"
state: "restarted"
enabled: "yes"
daemon_reload: "yes"
retries: 5
delay: 5
when:
- "ansible_distribution | lower == 'gentoo'"
- name: Veth check
command: "/usr/local/bin/lxc-veth-check"

View File

@ -1,47 +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: Remove conflicting packages
portage:
package: "{{ lxc_hosts_remove_distro_packages }}"
state: absent
tags:
- lxc-ebuild-packages
- name: Install gentoo packages
portage:
package: "{{ lxc_hosts_distro_packages }}"
state: "{{ lxc_hosts_package_state }}"
jobs: 4
register: install_packages
until: install_packages is success
retries: 5
delay: 2
tags:
- lxc-ebuild-packages
- name: Drop irqbalance config
template:
src: "irqbalance.j2"
dest: "{{ system_config_dir }}/irqbalance"
owner: "root"
group: "root"
mode: "0644"
notify:
- Restart irqbalance
tags:
- lxc-files
- lxc-irqbalance
- lxc_hosts-config

View File

@ -1,4 +1,5 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -41,7 +42,6 @@
with_items: "{{ lxc_cached_network_interfaces }}"
notify:
- Restart bridge
- Reload networkd
tags:
- lxc-files
- lxc-net
@ -58,14 +58,11 @@
# 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.
# NOTE(prometheanfire): lxc-net is not installed on gentoo
- name: Disable and stop lxc-net
service:
name: lxc-net
enabled: no
state: stopped
when:
- "ansible_distribution | lower != 'gentoo'"
tags:
- lxc-net
@ -74,8 +71,6 @@
src: /dev/null
path: /etc/systemd/system/lxc-net.service
state: link
when:
- "ansible_distribution | lower != 'gentoo'"
tags:
- lxc-files
- lxc-net
@ -115,7 +110,6 @@
changed_when: not bridge_check.stat.exists
notify:
- Bring bridge up
- Reload networkd
tags:
- lxc-bridge

View File

@ -32,18 +32,3 @@
- "{{ lxc_container_cache_path }}"
tags:
- lxc-directories
# NOTE(prometheanfire): only set the var on gentoo
- name: fetch latest Gentoo systemd image metadata
uri:
url: "http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-stage4-amd64-systemd.txt"
return_content: yes
register: _gentoo_latest_stage4_systemd_metadata
when:
- ansible_distribution | lower == 'gentoo'
- name: set _lxc_hosts_container_image_url fact for gentoo
set_fact:
_lxc_hosts_container_image_url: "http://distfiles.gentoo.org/releases/amd64/autobuilds/{{ _gentoo_latest_stage4_systemd_metadata.content.split('\n')[-2].split()[0] }}"
when:
- ansible_distribution | lower == 'gentoo'

View File

@ -1,67 +0,0 @@
#!/usr/bin/env bash
set -e -x
{{ lxc_cache_prep_pre_commands }}
{% include 'templates/prep-scripts/_container_sys_setup.sh.j2' %}
mount -t proc proc /proc
mkdir /dev/shm
mount -t tmpfs none /dev/shm
chmod 1777 /dev/shm
mkdir -p /etc/portage/repos.conf
echo -n '[DEFAULT]
main-repo = gentoo
[gentoo]
sync-type = webrsync
sync-webrsync-verify-signature = true
sync-openpgp-key-refresh-retry-count = 0
sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
location = /usr/portage
auto-sync = true' > /etc/portage/repos.conf/repos.conf
emerge --sync
emerge -C app-emulation/lxc app-emulation/lxc-templates sys-fs/lxcfs || true
## Update base distribution
# make world consistant
USE="-build" emerge -q --complete-graph=y --jobs=4 --update --newuse --deep --with-bdeps=y @world
# rebuild packages that might need it
USE="-build" emerge -q --jobs=4 --usepkg=n @preserved-rebuild
# remove unneeded packages
USE="-build" emerge --verbose=n --ask=n --depclean
# rebuild packages that might have somehow depended on the unneeded packages
USE="-build" emerge -q --jobs=4 --usepkg=n @preserved-rebuild
# update config files
etc-update --automode -5
emerge --jobs=4 {{ lxc_cache_distro_packages | join(' ') }}
eselect python set python2.7
rm /etc/machine-id || true
rm /var/lib/dbus/machine-id || true
touch /etc/machine-id
rm /etc/sysctl.d/* || true
echo '' > /etc/sysctl.conf
mkdir -p /root/.ssh
chmod 700 /root/.ssh
eclean-dist
mkdir -p /var/backup
chage -I -1 -d -1 -m 0 -M 99999 -E -1 root
systemctl disable systemd-resolved.service || true
#systemctl mask systemd-resolved.service || true
{% for locale in lxc_cache_locales %}
echo "{{ locale }}" >> /etc/locale.gen
{% if loop.first | bool %}
{% endif %}
{% endfor %}
locale-gen
# Set the IP of the lxcbr0 interface as the DNS server
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
systemctl enable systemd-networkd
umount -f /dev/shm
rmdir /dev/shm
umount -f /proc
{{ lxc_cache_prep_post_commands }}

View File

@ -1,47 +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_cache_map:
distro: gentoo
arch: "{{ lxc_architecture_mapping.get( ansible_architecture ) }}"
release: 17.0-systemd
copy_from_host:
- /etc/portage/make.conf
- /etc/portage/package.keywords/*
- /etc/portage/package.use/*
- /etc/environment
- /etc/localtime
- /etc/protocols
_lxc_cache_prep_template: "prep-scripts/gentoo_systemd_prep.sh.j2"
_lxc_cache_prep_timeout: 1800
_lxc_cache_locales:
- "en_US.UTF-8 UTF-8"
_lxc_cache_distro_packages:
- app-portage/gentoolkit
- app-misc/ca-certificates
- sys-process/cronie
- sys-apps/dbus
- sys-apps/iproute2
- net-misc/iputils
- virtual/libffi
- dev-libs/openssl
- net-misc/openssh
- net-misc/rsync
- app-admin/sudo
- app-arch/tar
- net-misc/wget