mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 18:55:53 +00:00
There is a new automount location management module placed in the plugins folder: plugins/modules/ipaautomountlocation.py This module allows to ensure presence and absence of automount locations that act as containers for automount onjects in ipa. Here is the documentation for the module: README-automountlocation.md New example playbooks have been added: playbooks/automount/automount-location-absent.yml playbooks/automount/automount-location-present.yml New tests for the module: tests/automount/test_automountlocation.yml
105 lines
3.0 KiB
YAML
105 lines
3.0 KiB
YAML
---
|
|
- name: Test automountlocation
|
|
hosts: ipaserver
|
|
become: true
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: ensure automountlocation TestLocations are absent before testing
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name:
|
|
- TestLocation_01
|
|
- TestLocation_02
|
|
state: absent
|
|
|
|
- name: ensure empty automountlocation does nothing
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: []
|
|
state: present
|
|
register: result
|
|
failed_when: not result.failed or "At least one location must be provided" not in result.msg
|
|
|
|
- name: ensure empty automountlocation does nothing on absent
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: []
|
|
state: absent
|
|
register: result
|
|
failed_when: not result.failed or "At least one location must be provided" not in result.msg
|
|
|
|
- name: ensure automountlocation TestLocation is present
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: TestLocation_01
|
|
state: present
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|
|
|
|
- name: ensure automountlocation TestLocation is present again
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: TestLocation_01
|
|
state: present
|
|
register: result
|
|
failed_when: result.changed or result.failed
|
|
|
|
- name: ensure automountlocation TestLocation is absent
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: TestLocation_01
|
|
state: absent
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|
|
|
|
- name: ensure automountlocation TestLocation is absent again
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: TestLocation_01
|
|
state: absent
|
|
register: result
|
|
failed_when: result.changed or result.failed
|
|
|
|
- name: ensure a list of automountlocations are present
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name:
|
|
- TestLocation_01
|
|
- TestLocation_02
|
|
state: present
|
|
register: result
|
|
failed_when: result.failed or not result.changed
|
|
|
|
- name: ensure a list of automountlocations exist
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name:
|
|
- TestLocation_01
|
|
- TestLocation_02
|
|
state: present
|
|
register: result
|
|
failed_when: result.changed or result.failed
|
|
|
|
- name: ensure a list of automountlocations are absent
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name:
|
|
- TestLocation_01
|
|
- TestLocation_02
|
|
state: absent
|
|
register: result
|
|
failed_when: result.failed or not result.changed
|
|
|
|
- name: ensure multiple automountlocations are absent
|
|
ipaautomountlocation:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name:
|
|
- TestLocation_01
|
|
- TestLocation_02
|
|
- TestLocation_03
|
|
- TestLocation_04
|
|
state: absent
|
|
register: result
|
|
failed_when: result.changed or result.failed
|