Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support again EL7 #151

Merged
merged 1 commit into from
Dec 11, 2023
Merged

feat: support again EL7 #151

merged 1 commit into from
Dec 11, 2023

Conversation

ptoscano
Copy link
Collaborator

@ptoscano ptoscano commented Dec 7, 2023

Enhancement:
After yet another internal discussion, re-enable the support for EL7; no other changes are needed in the role.

Issue Tracker Tickets (Jira or BZ if any):
https://issues.redhat.com/browse/RHEL-16976
https://issues.redhat.com/browse/RHEL-16977

@ptoscano ptoscano requested a review from richm as a code owner December 7, 2023 08:33
@ptoscano
Copy link
Collaborator Author

ptoscano commented Dec 7, 2023

[citest]

@richm
Copy link
Contributor

richm commented Dec 7, 2023

TASK [Start Candlepin container] ***********************************************
task path: /WORKDIR/git-el77tlm7wdc/tests/tasks/setup_candlepin.yml:34
Thursday 07 December 2023  09:09:51 +0000 (0:00:00.702)       0:00:01.533 ***** 
fatal: [sut]: FAILED! => {
    "changed": false
}

STDERR:

Error: error creating container storage: the container name "candlepin" is already in use by "335a59c41a515e50435af7f2ac700071f8fadc87603771c4923047070a85c0c6". You have to remove that container to be able to reuse that name.: that name is already in use

missing some cleanup somewhere in some test?

@ptoscano
Copy link
Collaborator Author

ptoscano commented Dec 7, 2023

[citest bad]

@richm
Copy link
Contributor

richm commented Dec 8, 2023

@ptoscano maybe a difference of behavior of containers.podman.podman_container on EL7 vs. later releases? NOTE that baseos ci will reuse the same VM for each test. The rhc tests that call start_candlepin.yml do not clean up, so the candlepin container will be running after the test is complete.

For example, here is the Start Candlepin container task on rhel 9.4 ansible-core 2.16:

TASK [Start Candlepin container] ***********************************************
task path: /WORKDIR/git-el7uggnl2zl/tests/tasks/setup_candlepin.yml:34
Thursday 07 December 2023  09:08:36 +0000 (0:00:01.199)       0:00:02.284 ***** 
changed: [sut] => {
    "actions": [
        "recreated candlepin"
    ],

and here is rhel 7:

TASK [Start Candlepin container] ***********************************************
task path: /WORKDIR/git-el7ew7f9vwd/tests/tasks/setup_candlepin.yml:34
Thursday 07 December 2023  14:53:35 +0000 (0:00:00.718)       0:00:01.537 ***** 
fatal: [sut]: FAILED! => {
    "changed": false
}

STDERR:

Error: error creating container storage: the container name "candlepin" is already in use by "3ecce0017f2fd8db8eea8d6608b687d1648f3b544337bb82c1cecc3b1498edd3". You have to remove that container to be able to reuse that name.: that name is already in use

That is - on rhel9, the candlepin container is recreated and restarted, but not on rhel7. Looking at the documentation - https://docs.ansible.com/ansible/latest/collections/containers/podman/podman_container_module.html#parameter-recreate - you could try adding recreate: true to the task.

What's odd is that the behavior on RHEL8 and 9 seems to be recreate: true by default even though the default value is false according to the documentation.

@ptoscano
Copy link
Collaborator Author

ptoscano commented Dec 8, 2023

NOTE that baseos ci will reuse the same VM for each test.

Hm is it really the case? Looking at the output of each test that actually runs (e.g. not the Insights-related tests), it seems to install podman again, which means the guest is clean... except for the last test, i.e. tests_repositories.yml.

Regarding the behaviour of podman_container: considering that it uses state: started, then I don't understand why it tries to create the container again, rather than using the existing running container. According to the doc:

started - Asserts there is a running container matching the name and any provided configuration. If no container matches the name, a container will be created and started. Use recreate to always re-create a matching container, even if it is running. Use force_restart to force a matching container to be stopped and restarted.

@ptoscano
Copy link
Collaborator Author

ptoscano commented Dec 8, 2023

[citest]

@richm
Copy link
Contributor

richm commented Dec 8, 2023

I guess the version of podman on el7 is just too old for the module :-(

This is how I get all of the tests to pass:

@@ -32,6 +32,11 @@
         use: "{{ __rhc_is_ostree |
                  ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
 
+    - name: Stop and remove Candlepin container
+      containers.podman.podman_container:
+        name: candlepin
+        state: absent
+
     - name: Start Candlepin container
       containers.podman.podman_container:

testing on centos-9 now

@richm
Copy link
Contributor

richm commented Dec 8, 2023

centos-9 passes - so it looks like the right way is to set the container state: absent first

@ptoscano
Copy link
Collaborator Author

Let try then: #153.

@richm
Copy link
Contributor

richm commented Dec 11, 2023

Let try then: #153.

merged

After yet another internal discussion, re-enable the support for EL7;
no other changes are needed in the role.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
@ptoscano
Copy link
Collaborator Author

[citest]

@richm richm merged commit bfde809 into linux-system-roles:main Dec 11, 2023
23 checks passed
@ptoscano ptoscano deleted the el7 branch December 11, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants