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

No concurrency when using delegate_to #1197

Open
bmerry opened this issue Dec 2, 2024 · 0 comments
Open

No concurrency when using delegate_to #1197

bmerry opened this issue Dec 2, 2024 · 0 comments
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@bmerry
Copy link

bmerry commented Dec 2, 2024

Background: we have a playbook that loads a new BIOS on a server, using a command-line tool that runs on the controller and remotely uploads the BIOS. This takes about 20-30 minutes. Since it runs on the controller, we use delegate_to: localhost.

With the standard ansible strategy, this works fine, but when using mitogen, the executions are serialised, and it takes much longer to update a fleet.

I've put a minimal example below.

  • Which version of Ansible are you running? ansible-10.6.0, ansible-core-2.17.6

  • Is your version of Ansible patched in any way? No, installed directly from pip in a fresh virtualenv.

  • Are you running with any custom modules, or module_utils loaded? No

  • Have you tried the latest master version from Git? No, using 0.3.18

  • Do you have some idea of what the underlying problem may be? No

  • Mention your host and target OS and versions: Ubuntu 24.04 on host (targets are not connected to)

  • Mention your host and target Python versions: Python 3.12.3

To reproduce

ansible.cfg:

[defaults]
inventory = inventory
strategy_plugins = <YOUR PATH HERE>

[ssh_connection]
pipelining = True

play.yml:

- hosts: all
  gather_facts: false
  tasks:
    - name: sleep on localhost
      delegate_to: localhost
      ansible.builtin.command: "sleep 20"

inventory:

host1
host2

Running ansible-playbook play.yml takes ±20s as the sleeps run in parallel.

Running ANSIBLE_STRATEGY=mitogen_linear takes ±40s as the sleeps run serially.

@bmerry bmerry added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome
Projects
None yet
Development

No branches or pull requests

1 participant