Project

General

Profile

Bug #30691

Ansible runs role dependency on the begin of every dependency role.

Added by Ondřej Ezr 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1842291

Description of problem:

Ansible would only play dependent roles once.
It plays dependent roles before every role if run by Foreman, which causes it to play them multiple times when running roles on hosts.

How reproducible:

A complete reproducer is shared publicly in connected BZ

Actual results:

When a host has roles and those roles have the same dependency, the ansible is running the dependency roles every time before the role, as the following example.

Host 1 with ansible roles 'ansible_role_1','ansible_role_2','ansible_role_3'

Running ansible role ansible_role_dependency
Running ansible role ansible_role_1
Running ansible role ansible_role_dependency
Running ansible role ansible_role_2
Running ansible role ansible_role_dependency
Running ansible role ansible_role_3

This makes ansible terribly slow and repetitive.

Expected results:

The dependency role would be executed just once if it is a dependency for other roles.

Running ansible role ansible_role_dependency
Running ansible role ansible_role_1
Running ansible role ansible_role_2
Running ansible role ansible_role_3

Also available in: Atom PDF