Skip to content

Missing ansible version check / usage of unsupported feature allow_downgrade #478

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

Closed
cdm-arm opened this issue Dec 21, 2021 · 3 comments · Fixed by #485
Closed

Missing ansible version check / usage of unsupported feature allow_downgrade #478

cdm-arm opened this issue Dec 21, 2021 · 3 comments · Fixed by #485
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers
Milestone

Comments

@cdm-arm
Copy link

cdm-arm commented Dec 21, 2021

Describe the bug

Starting with version 0.22.0 the role no longer works with ansible < 2.12. Hence debian buster is by default not supported as only python 3.7 is available.

To reproduce

Steps to reproduce the behavior:

  1. Use Debian 10 VM
  2. Install ansible via python3 -m pip ansible
  3. install role in version 0.22
  4. Deploy NGINX role using a playbook.yml
  5. See error

build 21-Dec-2021 16:17:15 Ensuring that all ansible roles are installed in the latest version
error 21-Dec-2021 16:17:15 [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the
error 21-Dec-2021 16:17:15 controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22
error 21-Dec-2021 16:17:15 2021, 20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in
error 21-Dec-2021 16:17:15 version 2.12. Deprecation warnings can be disabled by setting
error 21-Dec-2021 16:17:15 deprecation_warnings=False in ansible.cfg.
build 21-Dec-2021 16:17:16 Starting galaxy role install process
build 21-Dec-2021 16:17:17 - downloading role 'nginx', owned by nginxinc
build 21-Dec-2021 16:17:18 - downloading role from https://github.com/nginxinc/ansible-role-nginx/archive/0.22.0.tar.gz
build 21-Dec-2021 16:17:19 - extracting nginxinc.nginx to ....../ansible-env/.ansible/roles/nginxinc.nginx
build 21-Dec-2021 16:17:19 - nginxinc.nginx (0.22.0) was installed successfully
build 21-Dec-2021 16:17:19 - downloading role 'nginx_config', owned by nginxinc
build 21-Dec-2021 16:17:20 - downloading role from https://github.com/nginxinc/ansible-role-nginx-config/archive/0.3.3.tar.gz
build 21-Dec-2021 16:17:20 - extracting nginxinc.nginx_config to ..../ansible-env/.ansible/roles/nginxinc.nginx_config
build 21-Dec-2021 16:17:20 - nginxinc.nginx_config (0.3.3) was installed successfully
error 21-Dec-2021 16:17:20 [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the
error 21-Dec-2021 16:17:20 controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22
error 21-Dec-2021 16:17:20 2021, 20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in
error 21-Dec-2021 16:17:20 version 2.12. Deprecation warnings can be disabled by setting
error 21-Dec-2021 16:17:20 deprecation_warnings=False in ansible.cfg.
build 21-Dec-2021 16:17:21
build 21-Dec-2021 16:17:21 PLAY [frontendservers:&dev] *****************************************
build 21-Dec-2021 16:17:21
build 21-Dec-2021 16:17:21 TASK [Gathering Facts] *********************************************************
.....

build 21-Dec-2021 16:17:24 TASK [nginxinc.nginx : Check whether you are using a supported NGINX distribution] ***
build 21-Dec-2021 16:17:24 ok: [xxxxxxx] => {
build 21-Dec-2021 16:17:24 "changed": false,
build 21-Dec-2021 16:17:24 "msg": "Your OS, Debian is supported by NGINX Open Source"
build 21-Dec-2021 16:17:24 }
build 21-Dec-2021 16:17:24
build 21-Dec-2021 16:17:24 TASK [nginxinc.nginx : Check that NGINX setup is an allowed value] *************
build 21-Dec-2021 16:17:24 ok: [xxxxxxx] => {
build 21-Dec-2021 16:17:24 "changed": false,
build 21-Dec-2021 16:17:24 "msg": "All assertions passed"
build 21-Dec-2021 16:17:24 }
build 21-Dec-2021 16:17:24
build 21-Dec-2021 16:17:24 TASK [nginxinc.nginx : Set up prerequisites] ***********************************
build 21-Dec-2021 16:17:24 included: ...../ansible-env/.ansible/roles/nginxinc.nginx/tasks/prerequisites/prerequisites.yml for xxxxxxx
build 21-Dec-2021 16:17:24
build 21-Dec-2021 16:17:24 TASK [nginxinc.nginx : Install dependencies] ***********************************
build 21-Dec-2021 16:17:24 included: ....../ansible-env/.ansible/roles/nginxinc.nginx/tasks/prerequisites/install-dependencies.yml for xxxxxxx
build 21-Dec-2021 16:17:24
build 21-Dec-2021 16:17:25 TASK [nginxinc.nginx : (Debian/Ubuntu) Install dependencies] *******************
build 21-Dec-2021 16:17:27 ok: [xxxxxxx]
build 21-Dec-2021 16:17:27

build 21-Dec-2021 16:17:29 TASK [nginxinc.nginx : (Debian/Ubuntu) Install NGINX] **************************
build 21-Dec-2021 16:17:29 fatal: [xxxxxxx]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (apt) module: allow_downgrade. Supported parameters include: dpkg_options, update_cache_retry_max_delay, autoremove, force, force_apt_get, policy_rc_d, upgrade, update_cache (update-cache), autoclean, install_recommends (install-recommends), fail_on_autoremove, purge, state, update_cache_retries, package (name, pkg), deb, only_upgrade, default_release (default-release), allow_unauthenticated (allow-unauthenticated), cache_valid_time."}
build 21-Dec-2021 16:17:29
build 21-Dec-2021 16:17:29 PLAY RECAP *********************************************************************
build 21-Dec-2021 16:17:29 xxxxxxx : ok=15 changed=1 unreachable=0 failed=1 skipped=11 rescued=0 ignored=0

Expected behavior

System check should fail due to unsupported ansible version

Your environment

  • Version of the NGINX role or specific commit: 0.22
  • Version of Ansible: 2.11
  • Target deployment platform: debian buster
@alessfg
Copy link
Member

alessfg commented Dec 28, 2021

Checking within the role for unsupported versions of Ansible is on the roadmap. I'm aiming to add it before the next major release but I have no ETA at the moment. PRs are welcome too!

@alessfg alessfg added dependencies Pull requests that update a dependency file good first issue Good for newcomers feature labels Dec 28, 2021
@alessfg alessfg modified the milestone: 0.22.1 Dec 28, 2021
@TuxInvader
Copy link

This also applies to Ubuntu Bionic (18.04 LTS) where the most recent Ansible PPA release is currently 2.9.27. Newer Ubuntu versions have 5.x releases, so Focal (20.04 LTS) works.

@w0rldart
Copy link

w0rldart commented Jan 29, 2022

I'm experiencing this issue with Ubuntu Focal too

ansible [core 2.11.6]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants