ansible-community / ansible-nomad

:watch: Ansible role for Nomad
https://galaxy.ansible.com/brianshumate/nomad
BSD 2-Clause "Simplified" License
294 stars 163 forks source link

ansible.builtin.include was removed from ansible-core 2.16 version #181

Closed ruslan-y closed 8 months ago

ruslan-y commented 9 months ago

Hi there! I use community ansible role (master branch) for managing clients and servers.

- src: https://github.com/ansible-community/ansible-nomad.git
  name: ansible-community.ansible-nomad
  scm: git
  version: master

After update ansible up to 2.16.1 version I get an error:

PLAY [clients] *********************************************************************************************************************************************************************************************
ERROR! [DEPRECATED]: ansible.builtin.include has been removed. Use include_tasks or import_tasks instead. This feature was removed from ansible-core in a release after 2023-05-16. Please update your playbooks.

Ansible version

ansible [core 2.16.1]
  config file = /Users/user/.ansible.cfg
  configured module search path = ['/Users/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/9.1.0/libexec/lib/python3.12/site-packages/ansible
  ansible collection location = /Users/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin//ansible
  python version = 3.12.0 (main, Oct  2 2023, 12:03:24) [Clang 15.0.0 (clang-1500.0.40.1)] (/opt/homebrew/Cellar/ansible/9.1.0/libexec/bin/python)
  jinja version = 3.1.2
  libyaml = True

Could you update your playbooks where the include occurs?

Also there is one more issue related to new version of jinja2 I guess

[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: ansible_distribution_version is version('{{ version_to_compare }}', '>')
fatal: [host]: FAILED! =>
  msg: 'The conditional check ''ansible_distribution_version is version(''{{ version_to_compare }}'', ''>'')'' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated.'

I suppose we need use it without braces.

beechesII commented 8 months ago

Dear @ruslan-y ,

thank your for this issue and your PR. I had to fix this issues within the implementation of molecule tests in #95 .

I will close this issue and your PR.