Skip to content
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

The '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. #227

Open
idelsink opened this issue Dec 2, 2019 · 4 comments

Comments

@idelsink
Copy link

idelsink commented Dec 2, 2019

I get the following error:

ERROR! The '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 '/home/username/.ansible/roles/sensu.sensu/tasks/rabbit.yml': line 53, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Wait for RabbitMQ to be up and running before asking to create a vhost
  ^ here

The following statement uses a pause to wait for something:

- name: Wait for RabbitMQ to be up and running before asking to create a vhost
tags: rabbitmq
pause:
seconds: 3
when: sensu_rabbitmq_state is changed

I'm running ansible ansible 2.9.1 and am using version 5.4.0 of the sensu role.

Proposed solution

It would be better to use the wait_for option and to actually wait for RabbitMQ to be up and running.

@jaredledvina
Copy link
Contributor

Hey @idelsink ,

Oh fun, I wonder if this is something new with updated versions of Ansible. If you're willing to PR the change, I'm happy to check it out. Would also be interested in the version of Ansible you're using and on what operating systems.

@idelsink
Copy link
Author

idelsink commented Dec 3, 2019

Hi @jaredledvina ,

Yeah always fun when something seems to break. I'm running Ansible v2.9.1.
For my OS i'm using Fedora 30 (soon to be 31) and Ubuntu 18.04.3 LTS as a target.

ansible 2.9.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ingmar/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.5 (default, Oct 17 2019, 12:09:47) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]

@idelsink
Copy link
Author

idelsink commented Dec 3, 2019

Interesting in te docs for the pause module it states:

Pauses playbook execution for a set amount of time, or until a prompt is acknowledged. All parameters are optional. The default behavior is to pause with a prompt.
To pause/wait/sleep per host, use the wait_for module.

So I think that the most basic solution would be to replace it with the following:

- name: Wait for RabbitMQ to be up and running before asking to create a vhost
  tags: rabbitmq
  wait_for:
    timeout: 3
  when: sensu_rabbitmq_state is changed

@Rohlik
Copy link

Rohlik commented Aug 23, 2022

I'm getting same error in our playbook for this task with strategy set to free even when new_node_name is defined 😢:

- name: Prompt for new_node_name if not defined
  ansible.builtin.pause:
    prompt: "Enter 'new_node_name' "
    register: new_node_name_prompt
  when: new_node_name is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants