From 25188ab4ce32a63e583c74a0a9ca009e735b0597 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Thu, 2 Jan 2025 14:41:45 -0300 Subject: [PATCH] fixup! Enable deployment roles testing using Github workflows --- .github/workflows/test_deployment.yml | 3 +++ tests/deployment/test_kinit.yml | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/deployment/test_kinit.yml diff --git a/.github/workflows/test_deployment.yml b/.github/workflows/test_deployment.yml index e56537698..83004d8e0 100644 --- a/.github/workflows/test_deployment.yml +++ b/.github/workflows/test_deployment.yml @@ -69,6 +69,7 @@ jobs: # ansible_vars: test/deployment/ipaserver-vars.yml distro: ${{ matrix.distro }} test_playbooks: >- + ${{ env.test_path }}/tests/deployment/test_kinit.yml ${{ env.test_path }}/tests/user/test_user.yml ${{ env.test_path }}/tests/group/test_group.yml ${{ env.test_path }}/tests/host/test_host.yml @@ -106,6 +107,7 @@ jobs: ansible_vars: test/deployment/ipareplica-vars.yml distro: ${{ matrix.distro }} test_playbooks: >- + ${{ env.test_path }}/tests/deployment/test_kinit.yml ${{ env.test_path }}/tests/user/test_user.yml ${{ env.test_path }}/tests/group/test_group.yml ${{ env.test_path }}/tests/host/test_host.yml @@ -141,6 +143,7 @@ jobs: # ansible_vars: test/deployment/ipaclient-vars.yml distro: ${{ matrix.distro }} test_playbooks: >- + ${{ env.test_path }}/tests/deployment/test_kinit.yml ${{ env.test_path }}/tests/user/test_user_client_context.yml ${{ env.test_path }}/tests/group/test_group_client_context.yml ${{ env.test_path }}/tests/host/test_host_client_context.yml diff --git a/tests/deployment/test_kinit.yml b/tests/deployment/test_kinit.yml new file mode 100644 index 000000000..6126f5477 --- /dev/null +++ b/tests/deployment/test_kinit.yml @@ -0,0 +1,17 @@ +--- +- name: Test if admin user can get TGT on the host + hosts: all + become: false + gather_facts: false + + tasks: + - name: Run kinit on host + ansible.builtin.shell: "kinit admin <<< {{ ipaadmin_password }}" + register: kinit + changed_when: not kinit.failed + + - name: Cleanup TGT ticket + ansible.builtin.shell: "kdestroy -A" + when: not kinit.failed + register: cleanup + changed_when: not cleanup.failed