artis3n / ansible-role-tailscale

Ansible role to install and configure a Tailscale node.

Home Page:https://galaxy.ansible.com/artis3n/tailscale

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pause module is incompatible with non-linear strategies

horzadome opened this issue · comments

The use of ansible.builtin.pause module makes the role incompatible with ansible free strategy, and likely any other non-linear strategies.
Is this an intentional design decision, or a bug?

Considering that it's used for decorative purposes rather than a vital function, could the task simply be removed?
Alternatively, would it make sense to accomplish the same functionality using ansible.builtin.wait_for module ?

Relevant code:

- name: Install | Pausing to highlight stdout message above
ansible.builtin.pause:
seconds: 5
when: nonsensitive_stdout is not skipped

Error message:

TASK [artis3n.tailscale : Install | Bring Tailscale Up] ************************
changed: [instance]
 [started TASK: artis3n.tailscale : Install | Report non-sensitive stdout from "tailscale up" on instance]
ERROR! The 'ansible.builtin.pause' module bypasses the host loop, which is currently not supported in the free strategy and would instead execute for every host in the inventory list.
The error appears to be in '/root/.ansible/roles/artis3n.tailscale/tasks/install.yml': line 156, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Install | Pausing to highlight stdout message above
  ^ here

Hmm, the pause is there for the following, from the readme:

Any stdout/stderr output from the tailscale binary will be printed. Since the tasks move quickly in this section, a 5 second pause is introduced to grant more time for users to realize a message was printed.

We could remove the pauses entirely, or use 'wait_for' with a 5 second timeout. Would the latter resolve compatibility with the free strategy?

Reproduced and created a Molecule scenario to capture this use case. Fix PR is up, I'll merge and release a new version shortly.