Files
ansible-freeipa/tests/trust/test_trust_client_context.yml
Rafael Guterres Jeffman 50b16cb33f tests/ipatrust: Modify AD realm name to an invalid name.
As the task is expected to fail, the AD realm name was modified to show
the expected behavior more clearly.
2022-04-26 14:42:40 -03:00

40 lines
1.2 KiB
YAML

---
- name: Test trust
hosts: ipaclients, ipaserver
become: no
gather_facts: no
tasks:
- name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server.
- name: Execute with server context in the client.
ipatrust:
ipaadmin_password: SomeADMINpassword
ipaapi_context: server
realm: this.test.should.fail
register: result
failed_when: not (result.failed and result.msg is regex("No module named '*ipaserver'*"))
when: ipa_host_is_client
# Import basic module tests, and execute with ipa_context set to 'client'.
# If ipaclients is set, it will be executed using the client, if not,
# ipaserver will be used.
#
# With this setup, tests can be executed against an IPA client, against
# an IPA server using "client" context, and ensure that tests are executed
# in upstream CI.
- name: Test trust using client context, in client host.
import_playbook: test_trust.yml
when: groups['ipaclients']
vars:
ipa_test_host: ipaclients
- name: Test trust using client context, in server host.
import_playbook: test_trust.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars:
ipa_context: client