Add openEuler Distro support

openEuler is the newest open source operating system, which is quite
famous and widely used in China. This patch aims to add the OS support
in kolla-ansible for the host OS.

bp: support-openeuler-os

Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/830320

Change-Id: I66dc84f02c324dbc0787ec25d4bd92ada9362e94
This commit is contained in:
wangxiyuan 2022-02-21 06:33:41 +00:00 committed by Radosław Piliszek
parent 318e739f12
commit 01ed75acef
9 changed files with 66 additions and 6 deletions

View File

@ -13,6 +13,8 @@ host_os_distributions:
- "8"
Debian:
- "bullseye"
openEuler:
- "20.03"
RHEL:
- "8"
Rocky:

View File

@ -48,7 +48,7 @@ execution, which is described in
#. Install Python build dependencies:
For CentOS or RHEL 8, run:
For CentOS, RHEL 8 or openEuler, run:
.. code-block:: console
@ -67,7 +67,7 @@ If not installing Kolla Ansible in a virtual environment, skip this section.
#. Install the virtual environment dependencies.
For CentOS or RHEL 8, you don't need to do anything.
For CentOS, RHEL 8 or openEuler, you don't need to do anything.
For Debian or Ubuntu, run:
@ -105,7 +105,7 @@ If installing Kolla Ansible in a virtual environment, skip this section.
#. Install ``pip``.
For CentOS or RHEL, run:
For CentOS, RHEL or openEuler, run:
.. code-block:: console
@ -132,6 +132,12 @@ If installing Kolla Ansible in a virtual environment, skip this section.
sudo dnf install ansible
For openEuler, run:
.. code-block:: console
sudo pip install ansible
For Debian or Ubuntu, run:
.. code-block:: console
@ -334,7 +340,7 @@ than one node, edit ``multinode`` inventory:
errors in the ``ping`` module. To quickly install Python with Ansible you
can run: for Debian or Ubuntu:
``ansible -i multinode all -m raw -a "apt -y install python3"``,
and for CentOS or RHEL:
and for CentOS, RHEL or openEuler:
``ansible -i multinode all -m raw -a "dnf -y install python3"``.
Kolla passwords

View File

@ -23,6 +23,7 @@ Kolla Ansible supports the following host Operating Systems (OS):
* CentOS Stream 8
* Debian Bullseye (11)
* openEuler 20.03 LTS SP2
* RHEL 8 (deprecated)
* Rocky Linux 8
* Ubuntu Focal (20.04)

View File

@ -0,0 +1,5 @@
---
features:
- |
openEuler 20.03-LTS-SP2 distro is supported as host os for kolla-ansible
now.

View File

@ -102,6 +102,32 @@
use: systemd
become: true
# NOTE(wxy): There are some issues on openEuler, fix them by hand.
# 1. iptables-legacy is used by default.
# 2. NTP sync doesn't work by default.
- block:
# The CentOS Stream 8 in container uses iptables-nft while the host
# openEuler uses iptables-legacy by default. We should update openEuler
# to keep iptables the same.
# Ubuntu 20.04 container OS uses iptables-legacy by default. It works
# well on openEuler.
- name: Set iptables from legacy to nft for centos stream container
shell:
cmd: |
dnf install -y iptables-nft
iptables-save > iptables.txt
iptables-nft-restore < iptables.txt
update-alternatives --set iptables /usr/sbin/iptables-nft
become: true
when: base_distro == 'centos'
# The command `timedatectl status` always times out if the command
# `timedatectl show-timesync` is not run first.
- name: Let ntp service work
shell: timedatectl show-timesync
become: true
when: ansible_facts.distribution == 'openEuler'
- name: Wait for ntp time sync
command: timedatectl status
register: timedatectl_status

View File

@ -1,6 +1,6 @@
---
{% if ansible_os_family == 'Debian' %}
# Force the use of python3 on Debian and Ubuntu remote hosts. These distros
{% if ansible_os_family == 'Debian' or ansible_facts.distribution == "openEuler" %}
# Force the use of python3 on Debian, Ubuntu and openEuler remote hosts. These distros
# typically have an unversioned Python interpreter which links to python2.7.
ansible_python_interpreter: /usr/bin/python3
{% endif %}
@ -14,6 +14,9 @@ docker_custom_config:
debug: true
registry-mirrors:
- {{ infra_dockerhub_mirror }}
{% if ansible_facts.distribution == "openEuler" %}
exec-opts: ["native.umask=normal"]
{% endif %}
{% if kolla_python_version is defined and not is_previous_release %}
distro_python_version: "{{ kolla_python_version }}"

View File

@ -26,6 +26,16 @@
install_type: source
tls_enabled: true
- job:
name: kolla-ansible-openeuler-source
parent: kolla-ansible-base
nodeset: kolla-ansible-openeuler-20.03-lts-sp2
voting: false
vars:
base_distro: centos
install_type: source
tls_enabled: true
- job:
name: kolla-ansible-rocky8-source
parent: kolla-ansible-base

View File

@ -33,6 +33,12 @@
- name: secondary2
label: debian-bullseye
- nodeset:
name: kolla-ansible-openeuler-20.03-lts-sp2
nodes:
- name: primary
label: openEuler-20-03-LTS-SP2
- nodeset:
name: kolla-ansible-rocky-8
nodes:

View File

@ -12,6 +12,7 @@
jobs:
- kolla-ansible-centos8s-source
- kolla-ansible-debian-source
- kolla-ansible-openeuler-source
- kolla-ansible-rocky8-source
- kolla-ansible-ubuntu-source
- kolla-ansible-centos8s-source-kvm