forked from freeipa/ansible-freeipa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipatrust: Allow execution of plugin in client host.
Update trust README file and add tests for executing plugin with `ipaapi_context` set to `client`. A new test playbook can be found at: tests/trust/test_trust_client_context.yml The new test file can be executed in a FreeIPA client host that is not a server. In this case, it should be defined in the `ipaclients` group, in the inventory file.
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
- 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: windows.local | ||
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'] | ||
|