mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 02:35:54 +00:00
There was state: rebuild before, but the code was incomplete and was not able to run properly. New parameters: - users: Limit the rebuild to the given users only - hosts: Limit the rebuild to the given hosts only - no_wait: Don't wait for rebuilding membership New parameters and examples have been added to README-automember.md tests/automember/test_automember_client_context.yml has been using state: rebuild and lacked the automember_type parameter. grouping was used in functions and has been replaced by automember_type. Some typos in examples have been fixed also. New playbooks: - playbooks/automember/automember-group-membership-all-users-rebuilt.yml - playbooks/automember/automember-group-membership-users-rebuilt.yml - playbooks/automember/automember-hostgroup-membership-all-hosts-rebuilt.yml - playbooks/automember/automember-hostgroup-membership-hosts-rebuilt.yml New tests: - tests/automember/test_automember_rebuilt.yml
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
---
|
|
- name: Test automember
|
|
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.
|
|
ipaautomember:
|
|
ipaadmin_password: SomeADMINpassword
|
|
ipaapi_context: server
|
|
name: ThisShouldNotWork
|
|
automember_type: group
|
|
state: rebuilt
|
|
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 automember using client context, in client host.
|
|
import_playbook: test_automember.yml
|
|
when: groups['ipaclients']
|
|
vars:
|
|
ipa_test_host: ipaclients
|
|
|
|
- name: Test automember using client context, in server host.
|
|
import_playbook: test_automember.yml
|
|
when: groups['ipaclients'] is not defined or not groups['ipaclients']
|
|
vars:
|
|
ipa_context: client
|