Bug 1696706 - Playbook execution freezes if selinux is enforcing and python3-libselinux is not installed
Summary: Playbook execution freezes if selinux is enforcing and python3-libselinux is ...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: ansible
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-05 13:01 UTC by Tomas Tomecek
Modified: 2019-04-08 12:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-08 12:31:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ansible-community ansible-bender issues 101 0 None closed ansible-bender build hangs 2021-02-01 00:34:28 UTC

Description Tomas Tomecek 2019-04-05 13:01:46 UTC
Description of problem:
```
14:58:19.706 utils.py          DEBUG  TASK [copy] *****************************************************************************************************************************************************************
14:58:20.079 utils.py          DEBUG  fatal: [localhost]: FAILED! => {"changed": false, "checksum": "4cceffc67fd1c2f2443b143224b437931cff03db", "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}
```

Should ansible just `Requires: python3-libselinux`? Should I open an issue upstream?


Version-Release number of selected component (if applicable):
ansible-2.7.9-1.fc29.noarch

Comment 1 Jiri Popelka 2019-04-05 14:29:06 UTC
Well, I see the linked ansible-bender issue even with python3-libselinux-2.8-6.fc29.x86_64 installed.
Also, I don't see any problem if I run a simple playbook directly (without ansible-bender), so do you Tomas have a simple reproducer playbook?

Comment 2 Jiri Popelka 2019-04-05 14:33:39 UTC
Ah, I think you can scratch the previous comment as I'm running the bender in virtualenv, so the installed rpm package is irrelevant.

Comment 3 Tomas Tomecek 2019-04-05 15:29:15 UTC
Just for the record, it fails on a simple copy task: https://github.com/ansible-community/ansible-bender/blob/master/ansible_bender/core.py#L317 (bender generates that playbook for sake of expanding variables)

I also forgot to say that after ansible prints the error message I posted in the original post, it freezes for like 3 minutes which is the reason I opened this bug and Jiri opened the bug on ansible-bender linked above.

Comment 4 Kevin Fenzi 2019-04-07 18:40:37 UTC
huh, yeah, a freeze for minutes after printing that error seems like a bug/issue. Can you perhaps strace it or the like and see where it's hanging?

> Should ansible just `Requires: python3-libselinux`? Should I open an issue upstream?

No, we have resisted such requires in the ansible package for a number of reasons (I guess I should make this a template I repeat it so often. ;)
* This would only help you in the case that your target host is localhost/the management host. Not any other target hosts. If you have to handle that case anyhow, why not just do the same thing for your target host (check for and install the thing you need)
* This locks people into installing/using things on their target host that they perhaps do not want (perhaps they have selinux disabled, or perhaps installing this package could cause another application to do selinux things,etc)
* There's no clear line, if we start adding things because we like/use them, folks will expect us to do that for everything and then ansible wouldn't even be installable. :) 
* Each requires increases the footprint, for things people may never use (if your management host isn't even managed by ansible, this does no good). 

The hang may well be good to file upstream...especially if you can see where it's hanging...

Comment 5 Tomas Tomecek 2019-04-08 12:31:05 UTC
Screw these heisenbugs: I can't reproduce the freeze anymore: tried a clean VM and my dirty workstation and the freeze happened on neither.

> This would only help you in the case that your target host is localhost/the management host.

You're right, I always forget about this since I use ansible locally most of the time.


Thanks, Kevin, let's close. We'll report the freeze upstream if we reproduce it.


Note You need to log in before you can comment on or make changes to this bug.