nginxinc / ansible-role-nginx

Ansible role for installing NGINX
https://galaxy.ansible.com/nginxinc/nginx
Apache License 2.0
618 stars 340 forks source link

Validation support for Ubuntu 24.04 (Noble) #708

Closed mnlm closed 3 weeks ago

mnlm commented 1 month ago

Is your feature request related to a problem? Please describe

Playing around with the latest Ubuntu 24.04 (Noble) release I noticed the role's validation fails:

ASK [nginxinc.nginx : Check whether you are using a supported NGINX distribution] **********************************************************************************************************
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ ansible_facts['distribution'] | lower in nginx_distributions.keys() |
list }}
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ (ansible_facts['distribution_version'] | regex_search('\d{1,2}\.\d{2}')
| float in nginx_distributions[ansible_facts['distribution'] | lower]['versions'] | map('float')) if ansible_facts['distribution'] | lower in ['alpine', 'ubuntu'] else
ansible_facts['distribution_major_version'] in nginx_distributions[ansible_facts['distribution'] | lower]['versions'] | string }}
fatal: [***]: FAILED! => {
    "assertion": "{{ (ansible_facts['distribution_version'] | regex_search('\\d{1,2}\\.\\d{2}') | float in nginx_distributions[ansible_facts['distribution'] | lower]['versions'] | map('float')) if ansible_facts['distribution'] | lower in ['alpine', 'ubuntu'] else ansible_facts['distribution_major_version'] in nginx_distributions[ansible_facts['distribution'] | lower]['versions'] | string }}",
    "changed": false,
    "evaluated_to": false,
    "msg": "Your distribution, Ubuntu 24.04 (x86_64), is not supported by NGINX Open Source."
}
...ignoring

The role ran with default vars except for:

nginx_setup_license: false
nginx_install_epel_release: false

Other than this validation error the role works on Noble. So does NGINX:

***:~$ nginx -v
nginx version: nginx/1.25.5
***:~$ systemctl status nginx
● nginx.service - nginx - high performance web server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-05-05 15:20:13 UTC; 3min 40s ago

Describe the solution you'd like

Update validation to include the latest Ubuntu 24.04 release.

shivamb commented 1 month ago

Getting same issue

alessfg commented 1 month ago

I need to update the CI pipeline and add Ubuntu noble to the list of supported platforms. I'll hopefully get to it early next week!