mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 11:54:47 +00:00
Add FreeIPA version as Ansible facts for testing.
Some attributes are not present in all supported versions of FreeIPA, and this might cause tests to fail due to unsupported versions. This patch add the means to test if a test can be executed based on the target host FreeIPA version.
This commit is contained in:
18
tests/env_freeipa_facts.yml
Normal file
18
tests/env_freeipa_facts.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
# This playbook should be included with `include_tasks` as the first task
|
||||
# of a test playbook that requires FreeIPA information.
|
||||
#
|
||||
# Available Facts:
|
||||
#
|
||||
# ipa_version: The installed FreeIPA version.
|
||||
# ipa_api_version: The installed FreeIPA API version.
|
||||
#
|
||||
---
|
||||
- name: Retrieving FreeIPA version.
|
||||
shell:
|
||||
cmd: 'ipa --version | sed -n "s/VERSION: \([^,]*\).*API_VERSION: \([^,]*\).*/\1\\n\2/p"'
|
||||
register: ipa_cmd_version
|
||||
|
||||
- name: Set FreeIPA facts.
|
||||
set_fact:
|
||||
ipa_version: "{{ ipa_cmd_version.stdout_lines[0] }}"
|
||||
ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}"
|
||||
Reference in New Issue
Block a user