From 696cbf06fae7f7f79e6554ed38b6722ffd5db3db Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Tue, 8 Feb 2022 10:26:40 +0100 Subject: [PATCH] Migrate to centos-9-stream to fix CI errors This also tries to read the nameservers from NetworkManager. Change-Id: I772b5554f3bb73bdd146e89632d11241d7a18fa3 --- setup.py | 1 + tox.ini | 7 +++++-- tripleo_ipa/molecule/default/prepare.yml | 11 ++++++++--- tripleo_ipa/molecule/deregister/prepare.yml | 11 ++++++++--- zuul.d/base.yaml | 4 ++-- zuul.d/layout.yaml | 4 ++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 6a931a6..58ffb52 100644 --- a/setup.py +++ b/setup.py @@ -16,4 +16,5 @@ import setuptools setuptools.setup( setup_requires=['pbr'], + py_modules=[], pbr=True) diff --git a/tox.ini b/tox.ini index 0af17b7..952785b 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ basepython = python3 minversion = 2.0 # add docs to the list of environments once we actually have docs to generate -envlist = py36,pep8,molecule,linters +envlist = py3,pep8,molecule,linters skipsdist = True [testenv] @@ -30,11 +30,14 @@ deps = -r {toxinidir}/requirements.txt -r {toxinidir}/molecule-requirements.txt changedir = {toxinidir}/tripleo_ipa -commands = molecule test --all +commands = + ansible-galaxy install -fr {toxinidir}/ansible-collections-requirements.yml + molecule test --all [testenv:ansible-lint] deps = {[testenv:linters]deps} commands = + ansible-galaxy install -fr {toxinidir}/ansible-collections-requirements.yml ansible-lint -c .ansible-lint {toxinidir}/tripleo_ipa [testenv:yamllint] diff --git a/tripleo_ipa/molecule/default/prepare.yml b/tripleo_ipa/molecule/default/prepare.yml index 6d06523..3ff4141 100644 --- a/tripleo_ipa/molecule/default/prepare.yml +++ b/tripleo_ipa/molecule/default/prepare.yml @@ -24,7 +24,7 @@ - name: Download FreeIPA Container containers.podman.podman_image: - name: freeipa/freeipa-server:fedora-28 + name: docker.io/freeipa/freeipa-server:fedora-28 pull: true become: true @@ -46,6 +46,10 @@ state: absent become: true + - name: Get configuration from NetworkManager + command: nmcli device show + register: nmcli_device_show + - name: Configure FreeIPA shell: > sudo podman run -d --name freeipa-server-container @@ -59,8 +63,9 @@ -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /tmp/ipa-data:/data:Z freeipa/freeipa-server:fedora-28 no-exit -U -r {{ domain | upper }} --setup-dns --no-reverse --no-ntp - --forwarder={{ unbound_primary_nameserver_v4 | default('1.1.1.1') }} - --forwarder={{ unbound_secondary_nameserver_v4 | default('8.8.8.8') }} + --forwarder={{ nameservers[0] | default('8.8.8.8') }} + vars: + nameservers: "{{ nmcli_device_show.stdout | regex_findall('\\s*IP4.DNS\\[.\\]:\\s*(.*)') }}" - block: - name: Wait for FreeIPA server install diff --git a/tripleo_ipa/molecule/deregister/prepare.yml b/tripleo_ipa/molecule/deregister/prepare.yml index 04aad11..a3949cc 100644 --- a/tripleo_ipa/molecule/deregister/prepare.yml +++ b/tripleo_ipa/molecule/deregister/prepare.yml @@ -24,7 +24,7 @@ - name: Download FreeIPA Container containers.podman.podman_image: - name: freeipa/freeipa-server:fedora-28 + name: docker.io/freeipa/freeipa-server:fedora-28 pull: true become: true @@ -46,6 +46,10 @@ state: absent become: true + - name: Get configuration from NetworkManager + command: nmcli device show + register: nmcli_device_show + - name: Configure FreeIPA shell: > sudo podman run -d --name freeipa-server-container @@ -59,8 +63,9 @@ -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /tmp/ipa-data:/data:Z freeipa/freeipa-server:fedora-28 exit-on-finished -U -r {{ domain | upper }} --setup-dns --no-reverse --no-ntp - --forwarder={{ unbound_primary_nameserver_v4 | default('1.1.1.1') }} - --forwarder={{ unbound_secondary_nameserver_v4 | default('8.8.8.8') }} + --forwarder={{ nameservers[0] | default('8.8.8.8') }} + vars: + nameservers: "{{ nmcli_device_show.stdout | regex_findall('\\s*IP4.DNS\\[.\\]:\\s*(.*)') }}" - name: Wait for FreeIPA server install wait_for: diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 6d1d5fe..72ad617 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -1,8 +1,8 @@ --- - job: description: tripleo-ipa molecule job - name: tripleo-ipa-centos-8-molecule - nodeset: centos-8-stream + name: tripleo-ipa-centos-9-molecule + nodeset: centos-9-stream parent: base success-url: "reports.html" failure-url: "reports.html" diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml index 90fab0f..ec3a54e 100644 --- a/zuul.d/layout.yaml +++ b/zuul.d/layout.yaml @@ -7,7 +7,7 @@ - tripleo-standalone-multinode-ipa-pipeline check: jobs: - - tripleo-ipa-centos-8-molecule + - tripleo-ipa-centos-9-molecule gate: jobs: - - tripleo-ipa-centos-8-molecule + - tripleo-ipa-centos-9-molecule