ipa[user,host]: Fail on duplucate names in the users and hosts lists

It was possible to have several entries for names with the hosts and users
lists. This resulted sometimes in errors but also unexpected changes. A new
check has been added to make sure that the names in the users and hosts
lists are unique.

New tests have been added to verify this in the existing files:
- tests/host/test_hosts.yml
- tests/user/test_users.yml
This commit is contained in:
Thomas Woerner
2020-06-29 14:50:56 +02:00
parent 34f1a45641
commit 1d7fb31b8b
4 changed files with 48 additions and 0 deletions

View File

@@ -85,6 +85,25 @@
register: result
failed_when: result.changed
- name: Duplicate names in users failure test
ipauser:
ipaadmin_password: SomeADMINpassword
users:
- name: user1
givenname: user1
last: Last
- name: user2
first: user2
last: Last
- name: user3
first: user3
last: Last
- name: user3
first: user3
last: Last
register: result
failed_when: result.changed or "is used more than once" not in result.msg
- name: Remove test users
ipauser:
ipaadmin_password: SomeADMINpassword