Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use ipaserver role from collection if it exists #256

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions tests/tasks/setup_ipa.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Set __is_beaker_env
set_fact:
__is_beaker_env: "{{ lookup('env', 'BEAKERLIB') | length > 0 }}"
__is_beaker_env: "{{ lookup('env', 'BEAKERLIB') | length > 0
and lookup('env', 'TESTING_FARM_GIT_URL') | length == 0 }}"

- name: Determine if system is ostree and set flag
when: not __certificate_is_ostree is defined
Expand Down Expand Up @@ -79,11 +80,31 @@
ipadm_password: SomeDMpassword
ipaserver_domain: test.local
ipaserver_realm: TEST.LOCAL
ipaserver_hostname: ipaserver.test.local
ipaserver_no_host_dns: true
local_log_dir: "{{ lookup('env', 'TEST_ARTIFACTS') | d('/tmp', true) }}"
role_collection_path: >-
/usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/roles/ipaserver
role_collection_name: freeipa.ansible_freeipa.ipaserver
block:
- name: Debug
shell: /usr/bin/env | grep -v LINUXSYSTEMROLES_SSH_KEY
delegate_to: localhost

- name: See if collection exists
stat:
path: "{{ role_collection_path }}"
register: __ipa_collection
delegate_to: localhost

- name: Set name of ipa server role
set_fact:
__ipa_server_role: "{{ role_collection_name
if __ipa_collection.stat.exists else 'ipaserver' }}"

- name: Include ipaserver role
include_role:
name: ipaserver
name: "{{ __ipa_server_role }}"
rescue:
- name: FAILURE - check entropy
command: cat /proc/sys/kernel/random/entropy_avail
Expand All @@ -98,6 +119,14 @@
$( [[ -e ipaclient-install.log ]] && echo ipaclient-install.log ) \
$( [[ -e pki ]] && echo pki )
chmod '0644' /tmp/ipalogs.tgz
echo "==========================="
echo " ipaserver-install.log"
echo "==========================="
cat ipaserver-install.log
echo "==========================="
echo " /var/log/messages"
echo "==========================="
cat /var/log/messages
changed_when: false
- name: FAILURE - grab archive
fetch:
Expand Down
Loading