Skip to content
Snippets Groups Projects
Commit d366dd7e authored by Chen's avatar Chen
Browse files

Avoid facts gathered twice when deploying with --limit

When deploying with argument --limit, both first and second plays
in site.yml will be processed, causing host facts gathered twice,
which is unnecessary. Thus a condition is added to the first play
to avoid such redundancy.

Change-Id: I20b84c59bf73aaeca929fc56465ff2cf1cf52b8e
Closes-Bug: #1691033
parent dc5e05d8
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
gather_facts: false gather_facts: false
tasks: tasks:
- setup: - setup:
tags: always when:
- (play_hosts | length) == (groups['all'] | length)
# NOTE(pbourke): This case covers deploying subsets of hosts using --limit. The # NOTE(pbourke): This case covers deploying subsets of hosts using --limit. The
# limit arg will cause the first play to gather facts only about that node, # limit arg will cause the first play to gather facts only about that node,
# meaning facts such as IP addresses for rabbitmq nodes etc. will be undefined # meaning facts such as IP addresses for rabbitmq nodes etc. will be undefined
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment