Skip to content

Role fails with check handler when installing on OS with IPv6 disabled #888

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

Open
ndjilinski opened this issue May 1, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ndjilinski
Copy link

Bug Overview

When the installation is happening on the OS with IPv6 disabled, the role stops on the config check handler:

`
RUNNING HANDLER [nginxinc.nginx : (Handler) Check NGINX] *********************************************************************************************
fatal: [host]: FAILED! => {"changed": false, "cmd": ["nginx", "-t"], "delta": "0:00:00.011838", "end": "2025-05-01 05:38:43.724383", "msg": "non-zero return code", "rc": 1, "start": "2025-05-01 05:38:43.712545", "stderr": "nginx: the configuration file /etc/nginx/nginx.conf syntax is ok\nnginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)\nnginx: configuration file /etc/nginx/nginx.conf test failed", "stderr_lines": ["nginx: the configuration file /etc/nginx/nginx.conf syntax is ok", "nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)", "nginx: configuration file /etc/nginx/nginx.conf test failed"], "stdout": "", "stdout_lines": []}
...ignoring

RUNNING HANDLER [nginxinc.nginx : (Handler) Print NGINX error if syntax check fails] *****************************************************************
fatal: [host]: FAILED! => {
"config_check['stderr_lines']": [
"nginx: the configuration file /etc/nginx/nginx.conf syntax is ok",
"nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)",
"nginx: configuration file /etc/nginx/nginx.conf test failed"
],
"failed_when_result": true
}
`

Expected Behavior

I understand the nginx.conf is coming with the package, but, the role - at least - should have the trigger to "disable" the check. The role already has the control over the service enablement and start. and the nginx_config can override the nginx.conf.

Steps to Reproduce the Bug

In the target host - disable IPv6 and call the playbook with included nginx role - using those vars:

nginx_manage_repo: false
nginx_install_from: os_repository
nginx_install_epel_release: false
nginx_start: false

Environment Details

  • Target deployment platforms: Linux VM on VMware
  • Target OSs: RHEL9 (IPv6 disable)
  • Host OS (where you are running Ansible from): RHEL9
  • Version of the NGINX Ansible role (or specific commit):
  • Version of Ansible: 2.18.5
  • How is Ansible being managed: CLI
  • Version of Jinja2 (if you are using any templating capability): 3.1.6

Additional Context

No response

@ndjilinski ndjilinski added the bug Something isn't working label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant