# Problems with centos8 docker image with ansible-test

**URL:** <https://forum.ansible.com/t/problems-with-centos8-docker-image-with-ansible-test/34578>\
**Category:** Ansible Developer\
**Tags:** ansible-devel\
**Created:** [February 5, 2021, 4:37pm UTC](https://forum.ansible.com/t/problems-with-centos8-docker-image-with-ansible-test/34578 "2021-02-05T16:37:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 5, 2021, 4:37pm UTC](https://forum.ansible.com/t/problems-with-centos8-docker-image-with-ansible-test/34578/1 "2021-02-05T16:37:29Z")

</div>

The tests seem to be installing python2, causing the test environment to be modified.

Per the error message:

ERROR: Test target “lookup\_mongodb” has changed the test environment!  
If these changes are necessary, they must be reverted before the test finishes.

This is being done in the following task:

TASK [setup\_mongodb : Ensure mongod package is installed] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

[https://github.com/ansible-collections/community.mongodb/blob/master/tests/integration/targets/setup\_mongodb/tasks/main.yml#L76-L80](https://github.com/ansible-collections/community.mongodb/blob/master/tests/integration/targets/setup_mongodb/tasks/main.yml#L76-L80)

You’ll either need to remove the python2 packages that were installed in `setup_mongodb`. This already existed, but was commented out in [https://github.com/ansible-collections/community.mongodb/commit/71d1de33c73423df4f2b5aed7d2403c1e4ef5220](https://github.com/ansible-collections/community.mongodb/commit/71d1de33c73423df4f2b5aed7d2403c1e4ef5220)

---

<div class="post-metadata">

**Author:** ![rhysmeister](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rhysmeister/32/10599_2.png) [@rhysmeister](https://forum.ansible.com/u/rhysmeister)\
**Post date:** [February 5, 2021, 5:22pm UTC](https://forum.ansible.com/t/problems-with-centos8-docker-image-with-ansible-test/34578/2 "2021-02-05T17:22:49Z")

</div>

That task is defined as follows…

- name: Ensure mongod package is installed  
yum:  
name: ‘{{ mongodb\_packages.mongod }}’  
state: present  
when: ansible\_os\_family == “RedHat”

and the variable used is defined as follows…

mongodb\_packages:  
mongod: mongodb-org-server

Running locally I see the following (expected) output…

TASK [setup\_mongodb : Ensure mongod package is installed] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [testhost] =\> {“changed”: true, “msg”: “”, “rc”: 0, “results”: [“Installed: openssl-pkcs11-0.4.10-2.el8.x86\_64”, “Installed: mongodb-org-server-4.2.12-1.el8.x86\_64”, “Installed: openssl-1:1.1.1g-12.el8\_3.x86\_64”, “Installed: openssl-devel-1:1.1.1g-12.el8\_3.x86\_64”, “Installed: openssl-libs-1:1.1.1g-12.el8\_3.x86\_64”, “Removed: openssl-devel-1:1.1.1-8.el8.x86\_64”, “Removed: openssl-libs-1:1.1.1-8.el8.x86\_64”]}

But in Github actions I see the following (unexpected) output…

changed: [testhost] =\> {“changed”: true, “msg”: “”, “rc”: 0, “results”: [“Installed: python2-setuptools-39.0.1-12.module\_el8.3.0+478+7570e00c.noarch”, “Installed: python2-setuptools-wheel-39.0.1-12.module\_el8.3.0+478+7570e00c.noarch”, “Installed: python2-libs-2.7.17-2.module\_el8.3.0+478+7570e00c.x86\_64”, “Installed: python2-pip-9.0.3-18.module\_el8.3.0+478+7570e00c.noarch”, “Installed: python2-pip-wheel-9.0.3-18.module\_el8.3.0+478+7570e00c.noarch”, “Installed: python2-2.7.17-2.module\_el8.3.0+478+7570e00c.x86\_64”, “Installed: mongodb-org-server-4.2.12-1.el8.x86\_64”, “Installed: openssl-1:1.1.1g-12.el8\_3.x86\_64”]}

There is the redhat\_packages\_py2 variable but I don’t see how this is being picked up in GA/centos8 only. The only references to this variable are in…

tests/integration/targets/setup\_mongodb/defaults/main.yml

tests/integration/targets/setup\_mongodb/handlers/main.yml (commented out)

How on earth this is getting merged with the mongod task is currently unknown. This is legacy stuff left over from Shippable so I’ll clean this up and hope it goes away.

Have a great weekend

Cheers,

Rhys
