mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 18:55:53 +00:00
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
65 lines
1.5 KiB
YAML
65 lines
1.5 KiB
YAML
---
|
|
- 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
|