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

Apache Enable Module... Module fails if already enabled #22635

Closed
PenguinzPlays opened this issue Mar 15, 2017 · 4 comments · Fixed by #22649
Closed

Apache Enable Module... Module fails if already enabled #22635

PenguinzPlays opened this issue Mar 15, 2017 · 4 comments · Fixed by #22649
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. module This issue/PR relates to a module.

Comments

@PenguinzPlays
Copy link

PenguinzPlays commented Mar 15, 2017

Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.

DONE , using latest version from pip... will try and use latest from source.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

http://docs.ansible.com/ansible/apache2_module_module.html

ANSIBLE VERSION
ansible 2.2.1.0
  config file =
  configured module search path = Default w/o overrides

CONFIGURATION
OS / ENVIRONMENT
SUMMARY

Ansible apache module fails if evasive is already enabled, only seems to be evasive.

STEPS TO REPRODUCE

https://github.com/ShadeySecurity/pyAssetContext/blob/master/playbooks/install-pyAssetContext.yml

EXPECTED RESULTS

I expected an ok / no change

ACTUAL RESULTS

Failed due to already existing

TASK [Apache Modules Setup] ****************************************************
ok: [127.0.0.1] => (item=ssl)
ok: [127.0.0.1] => (item=proxy)
ok: [127.0.0.1] => (item=proxy_http)
ok: [127.0.0.1] => (item=headers)
ok: [127.0.0.1] => (item=expires)
ok: [127.0.0.1] => (item=wsgi)
ok: [127.0.0.1] => (item=rewrite)
ok: [127.0.0.1] => (item=security2)
...ignoring
failed: [127.0.0.1] (item=evasive) => {"failed": true, "item": "evasive", "msg": "Failed to set module evasive to enabled: Module evasive already enabled\n", "rc": 0, "stderr": "", "stdout": "Module evasive already enabled\n", "stdout_lines": ["Module evasive already enabled"]}
@ansibot
Copy link
Contributor

ansibot commented Mar 15, 2017

@ansibot ansibot added affects_2.2 This issue/PR affects Ansible v2.2 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Mar 15, 2017
@robinro
Copy link
Contributor

robinro commented Mar 15, 2017

@theshades Thanks for this bug report.

Which OS/version are you using?

I can reproduce the issue with ubuntu 16.04. The reason is that apache2ctl -M outputs evasive20_module instead of evasive_module, which breaks this module.

This problem is similar to
ansible/ansible-modules-core#5779, ansible/ansible-modules-core#4744, #20288

I'd ask you to file a bug report against the distribution that you are using and ask them to fix that output, since it obviously deviates from the default that the vast majority of modules (and all others that you use) follow. Please link to that bug report here.

We could construct a workaround here, like in #20341. I'm not really happy with that, but we starting to go down the "workaround" road and there is no good argument why to stop now. @n0trax What's your view on that?

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Mar 15, 2017
@n0trax
Copy link
Contributor

n0trax commented Mar 15, 2017

@theshades Thanks for this bug report.

I can reproduce this issue too...

@robinro I agree with you.

robinro pushed a commit to robinro/ansible that referenced this issue Mar 15, 2017
* Fixes ansible#22635
* Clean up workarounds for php/shib
* Add test for evasive workaround
* Remove use of re module, since all searches work with native python
@robinro
Copy link
Contributor

robinro commented Mar 15, 2017

I openes a PR #22649 to fix this and run it in the integration tests.

@theshades Please test whether this fix works for you.

@n0trax I startes a list of searches/replacements to better organize our workarounds. Please comment on that. I got rid of the use of the re module, which was actually not needed.

bcoca pushed a commit that referenced this issue Apr 4, 2017
* Add workaround for evasive in apache2_module

* Fixes #22635
* Clean up workarounds for php/shib
* Add test for evasive workaround
* Remove use of re module, since all searches work with native python

* Add unit tests to apache2_module name replacements

Go back to using re package where needed

* Rename replace_name to create_apache_identifier
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. module This issue/PR relates to a module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants