nickjj / ansible-docker

Install / Configure Docker and Docker Compose using Ansible.
MIT License
750 stars 224 forks source link

Error in new v2.2.0 version when using ansible 2.9.14 #124

Closed vitorbaptista closed 1 year ago

vitorbaptista commented 1 year ago

First of all, thank you for this great project.

I haven't pinned nickjj/ansible-docker version, so when deploying my product, I started seeing the following error:

ERROR! this task 'ansible.builtin.meta' has extra params, which is only allowed in the following modules: command, shell, win_command, include_role, import_tasks, set_fact, include, include_vars, include_tasks, meta, import_role, win_shell, raw, add_host, script, group_by
The error appears to be in '/root/.ansible/roles/nickjj.docker/tasks/main.yml': line 141, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Restart Docker now to make sure `docker login` works
  ^ here

This was fixed by downgrading ansible-docker to v2.1.0. I'm guessing this breaking change wasn't intentional, otherwise it should be released as version v3.0.0 (assuming you're following the semantic versioning standard). Regardless, downgrading fixed it for me.

nickjj commented 1 year ago

Hi,

Which version of Ansible are you using?

This looks like a breaking change with a recent version of Ansible because this wasn't an issue back when v2.2.0 shipped.

joekinley commented 1 year ago

This is a problem with ansible 2.9.6 (which I am currently stuck with temporarily). What fixed it was to change this line: https://github.com/nickjj/ansible-docker/blob/master/tasks/main.yml#L142 I changed it to the following: meta: "flush_handlers" (Basically just removing the ansible.builtin prefix. Not ideal, but works for now. Still pending to test whether it works with a newer ansible version

nickjj commented 1 year ago

Ah, that makes sense then.

Part of the changelog for v2.2.0 includes Bump minimum Ansible version to 2.10.0 to start using collection namespaces. That's the Ansible feature that begins using ansible.builtin namespaces.

I'm surprised the other tasks work with ansible.builtin tho.

If I change the meta task to remove the namespace then ansible-lint throws:

fqcn[action-core]: Use FQCN for builtin module actions (meta).
tasks/main.yml:141 Use `ansible.builtin.meta` or `ansible.legacy.meta` instead.