Skip to content

Commit

Permalink
Assure python libselinux python bindings are installed
Browse files Browse the repository at this point in the history
Avoid akward error during templating of Dockerfile which happens
on selinux enabled machines when ansible template module fails
due to missing selinux bindings.

By using sitepackages=true in tox.ini we likely inherit the libselinux
bindings from the system when we create the virtualenvs.

Workaround for ansible/ansible#34340 which
happens even if selinux is set to permissive.

Documents selinux issues in install documentation in order to inform
users about what they could encounter.

Fixes: ansible#1724
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
  • Loading branch information
ssbarnea committed Apr 19, 2019
1 parent ef34773 commit 07b3de2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tox.ini
Expand Up @@ -27,6 +27,8 @@ deps =
#git+https://github.com/manahl/pytest-plugins.git@54ca3c0#egg=pytest-verbose-parametrize&subdirectory=pytest-verbose-parametrize
pytest-xdist<1.28.0 # pyup: < 1.28 # blocked by `pytest`
shade==1.31.0
# https://github.com/ansible/molecule/issues/1724
selinux; platform_system=='Linux'
yapf>=0.25.0,<0.27 # pyup: < 0.27 # disable updates, conflicts with flake8 as per https://github.com/ansible/molecule/pull/1915

ansible25: ansible>=2.5,<2.6
Expand Down Expand Up @@ -55,11 +57,6 @@ commands =
lint: python -m yamllint -s .
whitelist_externals =
find
# Enabling sitepackages is needed in order to avoid encountering exceptions
# caused by missing selinux python bindinds in ansible modules like template.
# Selinux python bindings are binary and they cannot be installed using pip
# in virtualenvs. Details: https://github.com/ansible/molecule/issues/1724
sitepackages = true

[testenv:lint]
# f'' is used inside docs
Expand Down

0 comments on commit 07b3de2

Please sign in to comment.