mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
New location management module
There is a new location management module placed in the plugins folder:
plugins/modules/ipalocation.py
The location module allows to ensure presence or absence of locations.
Here is the documentation for the module:
README-location.md
New example playbooks have been added:
playbooks/location/location-absent.yml
playbooks/location/location-present.yml
New tests for the module:
tests/location/test_location.yml
This commit is contained in:
64
tests/location/test_location.yml
Normal file
64
tests/location/test_location.yml
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
- name: Test location
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
|
||||
# CLEANUP TEST ITEMS
|
||||
|
||||
- name: Ensure location my_location1 is absent
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
state: absent
|
||||
|
||||
# CREATE TEST ITEMS
|
||||
|
||||
# TESTS
|
||||
|
||||
- name: Ensure location my_location1 is present
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
register: result
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Ensure location my_location1 is present again
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
register: result
|
||||
failed_when: result.changed or result.failed
|
||||
|
||||
- name: Ensure location my_location1 is present with description
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
description: My Location 1
|
||||
register: result
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Ensure location my_location1 is present again with description
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
description: My Location 1
|
||||
register: result
|
||||
failed_when: result.changed or result.failed
|
||||
|
||||
- name: Ensure location my_location1 is absent
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Ensure location my_location1 is absent again
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: result.changed or result.failed
|
||||
|
||||
# CLEANUP TEST ITEMS
|
||||
|
||||
- name: Ensure location my_location1 is absent
|
||||
ipalocation:
|
||||
name: my_location1
|
||||
state: absent
|
||||
Reference in New Issue
Block a user