diff options
| author | wangxiyuan <wangxiyuan1007@gmail.com> | 2022-02-21 06:33:41 +0000 |
|---|---|---|
| committer | Radosław Piliszek <radoslaw.piliszek@gmail.com> | 2022-03-28 07:54:49 +0000 |
| commit | 01ed75acefddb3247b697f3ab37c1a222e35e129 (patch) | |
| tree | b1841ed55241a6a0cc7347ee52a4eea55ed0b29b | |
| parent | 318e739f12ec09b05eac6dfa46ac3f828155fbde (diff) | |
| download | kolla-ansible-01ed75acefddb3247b697f3ab37c1a222e35e129.tar.gz kolla-ansible-01ed75acefddb3247b697f3ab37c1a222e35e129.zip | |
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
| -rw-r--r-- | ansible/roles/prechecks/vars/main.yml | 2 | ||||
| -rw-r--r-- | doc/source/user/quickstart.rst | 14 | ||||
| -rw-r--r-- | doc/source/user/support-matrix.rst | 1 | ||||
| -rw-r--r-- | releasenotes/notes/add-openeuler-support-for-host-os-9ccd799fa4a5b979.yaml | 5 | ||||
| -rw-r--r-- | tests/pre.yml | 26 | ||||
| -rw-r--r-- | tests/templates/globals-default.j2 | 7 | ||||
| -rw-r--r-- | zuul.d/jobs.yaml | 10 | ||||
| -rw-r--r-- | zuul.d/nodesets.yaml | 6 | ||||
| -rw-r--r-- | zuul.d/project.yaml | 1 |
9 files changed, 66 insertions, 6 deletions
diff --git a/ansible/roles/prechecks/vars/main.yml b/ansible/roles/prechecks/vars/main.yml index 941ac268a..e42a60473 100644 --- a/ansible/roles/prechecks/vars/main.yml +++ b/ansible/roles/prechecks/vars/main.yml @@ -13,6 +13,8 @@ host_os_distributions: - "8" Debian: - "bullseye" + openEuler: + - "20.03" RHEL: - "8" Rocky: diff --git a/doc/source/user/quickstart.rst b/doc/source/user/quickstart.rst index 3fc2a11c5..e8d9d7629 100644 --- a/doc/source/user/quickstart.rst +++ b/doc/source/user/quickstart.rst @@ -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 diff --git a/doc/source/user/support-matrix.rst b/doc/source/user/support-matrix.rst index eeec537ba..a3d92451c 100644 --- a/doc/source/user/support-matrix.rst +++ b/doc/source/user/support-matrix.rst @@ -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) diff --git a/releasenotes/notes/add-openeuler-support-for-host-os-9ccd799fa4a5b979.yaml b/releasenotes/notes/add-openeuler-support-for-host-os-9ccd799fa4a5b979.yaml new file mode 100644 index 000000000..08e12c49b --- /dev/null +++ b/releasenotes/notes/add-openeuler-support-for-host-os-9ccd799fa4a5b979.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + openEuler 20.03-LTS-SP2 distro is supported as host os for kolla-ansible + now. diff --git a/tests/pre.yml b/tests/pre.yml index 7bbd5ae55..def38158a 100644 --- a/tests/pre.yml +++ b/tests/pre.yml @@ -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 diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 22dda70c7..88632db72 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -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 }}" diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index ac0557ac8..9da16862d 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -27,6 +27,16 @@ 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 nodeset: kolla-ansible-rocky-8 diff --git a/zuul.d/nodesets.yaml b/zuul.d/nodesets.yaml index 7bcc6ebbd..36d087474 100644 --- a/zuul.d/nodesets.yaml +++ b/zuul.d/nodesets.yaml @@ -34,6 +34,12 @@ 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: - name: primary diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index c4ceba318..8bcbcefec 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -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 |
