Skip to content
Snippets Groups Projects
Commit 957b5910 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

Fixes ipaservice disable tests.

Due to use of some shell commands that required a Kerberos ticket,
the ipaservice test test_service_disable would no work if a ticket
was not granted before it ran. This patch adresses this issue by
acquiring a ticket for the `admin` user before it is needed, and
destroying the tickets by the end of the test execution.
parent 0303f153
No related branches found
No related tags found
No related merge requests found
# Due to not having some Ansible modules for IPA, some tasks are executed
# in this playbook using the `shell` module, as a Kerberos tikcket is needed
# for these tasks.
# The Kerberos cache is cleaned in the end, so you might need to `kinit` on
# the testing target after running this playbook.
--- ---
- name: Playbook to manage IPA service. - name: Playbook to manage IPA service.
hosts: ipaserver hosts: ipaserver
become: yes become: yes
gather_facts: yes gather_facts: yes
environment:
KRB5CCNAME: test_service_disable_ccache
tasks: tasks:
- name: Get Kerberos ticket for `admin`.
shell: echo SomeADMINpassword | kinit -c ${KRB5CCNAME} admin
- name: Ensure service is absent - name: Ensure service is absent
ipaservice: ipaservice:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: "mysvc1/{{ ansible_fqdn }}" name: "mysvc1/{{ ansible_fqdn }}"
state: absent
- name: Ensure service is present - name: Ensure service is present
ipaservice: ipaservice:
...@@ -66,3 +78,6 @@ ...@@ -66,3 +78,6 @@
ipaservice: ipaservice:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: "mysvc1/{{ ansible_fqdn }}" name: "mysvc1/{{ ansible_fqdn }}"
- name: Destroy Kerberos tickets.
shell: kdestroy -A -q -c ${KRB5CCNAME}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment