Skip to content

Commit edd2868

Browse files
committed
tests: Don't rely on facts when setting become
They won't be available if the play is first, and hence no facts have been gather in previous play(s), e.g. due to --start-at-task
1 parent 1ed932e commit edd2868

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.ci/ansible_tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ def pause_if_interactive():
6666
for container in containers
6767
)
6868

69-
for distro, hostnames in distros.items():
69+
for distro, hostnames in sorted(distros.items(), key=lambda t: t[0]):
7070
fp.write('\n[%s]\n' % distro)
7171
fp.writelines('%s\n' % name for name in hostnames)
7272

73-
for family, hostnames in families.items():
73+
for family, hostnames in sorted(families.items(), key=lambda t: t[0]):
7474
fp.write('\n[%s]\n' % family)
7575
fp.writelines('%s\n' % name for name in hostnames)
7676

77+
fp.write('\n[linux:children]\ntest-targets\n')
78+
7779
ci_lib.dump_file(inventory_path)
7880

7981
if not ci_lib.exists_in_path('sshpass'):

tests/ansible/regression/issue_776__load_plugins_called_twice.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
---
33
- name: regression/issue_776__load_plugins_called_twice.yml
44
hosts: test-targets
5-
become: "{{ ansible_facts.pkg_mgr not in ['homebrew'] }}"
5+
become: "{{ groups.linux is defined and inventory_hostname in groups.linux }}"
66
gather_facts: yes
77
tags:
88
- issue_776

0 commit comments

Comments
 (0)