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

Add ability to skip SELinux python bindings checks (#34340). #53015

Open
wants to merge 1 commit into
base: devel
from

Conversation

@estheruary
Copy link

estheruary commented Feb 26, 2019

SUMMARY

Adds the ability to run Ansible modules on hosts without the SELinux python bindings. For me, this fixes the issue of having to drop to raw modules in order to prep a system before that package can be installed.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Adds the ability for users to specify the seignore option on modules that perform file operations that are SELinux sensitive.

ADDITIONAL INFORMATION

Relevant to issue #34340.

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 26, 2019

@estheruary, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot

This comment was marked as resolved.

Copy link
Contributor

ansibot commented Feb 26, 2019

The test ansible-test sanity --test pylint [explain] failed with 5 errors:

lib/ansible/modules/packaging/os/apt_repository.py:313:75: undefined-variable Undefined variable 'module'
lib/ansible/modules/system/mount.py:602:0: syntax-error invalid syntax (<unknown>, line 602)
lib/ansible/modules/system/sysctl.py:361:75: undefined-variable Undefined variable 'module'
lib/ansible/modules/web_infrastructure/jenkins_plugin.py:600:84: undefined-variable Undefined variable 'module'
lib/ansible/modules/web_infrastructure/jenkins_plugin.py:635:57: undefined-variable Undefined variable 'module'

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
cat _themes/srtd/static/css/theme.css | sed -e 's/^[ 	]*//g; s/[ 	]*$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$/d' | sed -e :a -e '$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css
PYTHONPATH=../../lib ../bin/dump_config.py --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ -d ../../lib/ansible/config/base.yml
mkdir -p rst/cli
PYTHONPATH=../../lib ../bin/generate_man.py --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
PYTHONPATH=../../lib ../bin/dump_keywords.py --template-dir=../templates --output-dir=rst/reference_appendices/ -d ./keyword_desc.yml
PYTHONPATH=../../lib ../bin/plugin_formatter.py -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ 
Evaluating module files...
Makefile:93: recipe for target 'modules' failed
--> Standard Error
Traceback (most recent call last):
  File "../bin/plugin_formatter.py", line 774, in <module>
    main()
  File "../bin/plugin_formatter.py", line 729, in main
    plugin_info, categories = get_plugin_info(options.module_dir, limit_to=options.limit_to, verbose=(options.verbosity > 0))
  File "../bin/plugin_formatter.py", line 294, in get_plugin_info
    doc, examples, returndocs, metadata = plugin_docs.get_docstring(module_path, fragment_loader, verbose=verbose)
  File "/root/ansible/lib/ansible/utils/plugin_docs.py", line 103, in get_docstring
    data = read_docstring(filename, verbose=verbose, ignore_errors=ignore_errors)
  File "/root/ansible/lib/ansible/parsing/plugin_docs.py", line 40, in read_docstring
    M = ast.parse(b_module_data.read())
  File "/usr/lib/python3.6/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 602
    seignore=dict(type='bool' default=False),
                                    ^
SyntaxError: invalid syntax
make: *** [modules] Error 1

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: seignore=dict(type='bool' default=False),

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: seignore=dict(type='bool' default=False),

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: seignore=dict(type='bool' default=False),

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: seignore=dict(type='bool' default=False),

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: seignore=dict(type='bool' default=False),

The test ansible-test sanity --test compile --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:39: SyntaxError: seignore=dict(type='bool' default=False),

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:39: SyntaxError: invalid syntax

The test ansible-test sanity --test validate-modules [explain] failed with 22 errors:

lib/ansible/modules/crypto/openssl_dhparam.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/files/copy.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/files/xml.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/monitoring/sensu_check.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/monitoring/sensu_subscription.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/net_tools/basics/get_url.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/network/f5/bigip_ucs_fetch.py:0:0: E319 RETURN.seignore.default: extra keys not allowed @ data['seignore']['default']. Got False
lib/ansible/modules/network/f5/bigip_ucs_fetch.py:0:0: E319 RETURN.seignore.required: extra keys not allowed @ data['seignore']['required']. Got False
lib/ansible/modules/network/f5/bigip_ucs_fetch.py:0:0: E319 RETURN.seignore.returned: required key not provided @ data['seignore']['returned']. Got None
lib/ansible/modules/packaging/os/apt_repository.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/packaging/os/redhat_subscription.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/packaging/os/rhn_register.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/authorized_key.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/interfaces_file.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/known_hosts.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/mount.py:0:0: E401 Python SyntaxError while parsing module
lib/ansible/modules/system/pam_limits.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/pamd.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/service.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/sysctl.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/system/user.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/web_infrastructure/jenkins_plugin.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:602:45: python-syntax-error invalid syntax (<unknown>, line 602)

click here for bot help

@estheruary estheruary force-pushed the estheruary:devel branch from c9a2181 to fba192a Feb 27, 2019

@ansibot

This comment was marked as resolved.

Copy link
Contributor

ansibot commented Feb 27, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

lib/ansible/modules/files/copy.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/files/xml.py:0:0: E309 version_added for new option (seignore) should be '2.8'. Currently StrictVersion ('0.0')
lib/ansible/modules/network/f5/bigip_ucs_fetch.py:0:0: E319 RETURN.seignore.default: extra keys not allowed @ data['seignore']['default']. Got False
lib/ansible/modules/network/f5/bigip_ucs_fetch.py:0:0: E319 RETURN.seignore.required: extra keys not allowed @ data['seignore']['required']. Got False
lib/ansible/modules/network/f5/bigip_ucs_fetch.py:0:0: E319 RETURN.seignore.returned: required key not provided @ data['seignore']['returned']. Got None

click here for bot help

@estheruary estheruary force-pushed the estheruary:devel branch from fba192a to 5040654 Feb 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.