Prefilter the list of groups for repo_masters

Filter the list of groups to those beginning with '^repo_servers_'
within the 'with_items' of the 'Prepare group of master repo servers'
task' instead of iterating and skipping each group name within the
inventory.

Change-Id: I814ad0f97badcdab83596e79720685c739f8e010
This commit is contained in:
Jimmy McCrory 2017-07-27 10:55:05 -07:00
parent 9220d693e9
commit a28beed8ef
1 changed files with 1 additions and 3 deletions

View File

@ -37,9 +37,7 @@
add_host:
name: "{{ groups[item][0] }}"
groups: repo_masters
when:
- "item.find('repo_servers_') != -1"
with_items: "{{ groups }}"
with_items: "{{ groups | select('match', '^repo_servers_') | list }}"
tags:
- always
- repo-build