ipaautomountlocation: Allow execution of plugin in client host.

Update automountlocation README file and add tests for executing plugin
with `ipaapi_context` set to `client`.

A new test playbook can be found at:

    tests/automountlocation/test_automountlocation_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.
This commit is contained in:
Rafael Guterres Jeffman
2021-09-03 13:45:22 -03:00
parent e6ecae0d4b
commit e4d2b62bdb
3 changed files with 51 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
---
- name: Test automountlocation
hosts: ipaserver
hosts: "{{ ipa_test_host | default('ipaserver') }}"
become: true
gather_facts: false
@@ -8,6 +8,7 @@
- name: ensure automountlocation TestLocations are absent before testing
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name:
- TestLocation_01
- TestLocation_02
@@ -16,6 +17,7 @@
- name: ensure empty automountlocation does nothing
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name: []
state: present
register: result
@@ -24,6 +26,7 @@
- name: ensure empty automountlocation does nothing on absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name: []
state: absent
register: result
@@ -32,6 +35,7 @@
- name: ensure automountlocation TestLocation is present
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name: TestLocation_01
state: present
register: result
@@ -40,6 +44,7 @@
- name: ensure automountlocation TestLocation is present again
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name: TestLocation_01
state: present
register: result
@@ -48,6 +53,7 @@
- name: ensure automountlocation TestLocation is absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name: TestLocation_01
state: absent
register: result
@@ -56,6 +62,7 @@
- name: ensure automountlocation TestLocation is absent again
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name: TestLocation_01
state: absent
register: result
@@ -64,6 +71,7 @@
- name: ensure a list of automountlocations are present
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name:
- TestLocation_01
- TestLocation_02
@@ -74,6 +82,7 @@
- name: ensure a list of automountlocations exist
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name:
- TestLocation_01
- TestLocation_02
@@ -84,6 +93,7 @@
- name: ensure a list of automountlocations are absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name:
- TestLocation_01
- TestLocation_02
@@ -94,6 +104,7 @@
- name: ensure multiple automountlocations are absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
name:
- TestLocation_01
- TestLocation_02