Skip to content

Commit

Permalink
Fix ansible<2.8.0 bug
Browse files Browse the repository at this point in the history
groups.tester|first, when Ansible is < 2.8.0, is being evaluated
even if groups.undercloud is defined.

Change-Id: Ie66c0760b705a74311769b9da009e7344de68bdd
  • Loading branch information
abregman committed May 26, 2020
1 parent 95089ae commit 55481b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
- name: Set tester node
hosts: localhost
tasks:
# TODO: change groups.tester to groups.tester|first when Ansible will be updated to at least 2.8.0 as there is a bug in ansible < 2.8.0
# where groups.tester|first causing 'name' value to evaluate groups.tester even if groups.undercloud is defined
- name: Add chosen node to tester group
add_host:
name: "{{ install.get('tester', {}).get('node', {})|default(groups.undercloud|first, true)|default(groups.tester|first) }}"
name: "{{ install.get('tester', {}).get('node')|default(groups.get('undercloud', {})|first, true)|default(groups.tester, true) }}"
groups: "tester"
- include_role:
name: inventory-update
Expand Down

0 comments on commit 55481b8

Please sign in to comment.