From 413fc4c456546f5dff052a7de27751720c29bbcb Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Mon, 30 Dec 2024 16:21:18 -0300 Subject: [PATCH] fixup! Enable Github workflow for basic deployment role testing --- .github/workflows/test_deployment.yml | 77 ++++++++++++++++++++++----- tests/deployment/ipaserver_ca.yml | 10 ++++ 2 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 tests/deployment/ipaserver_ca.yml diff --git a/.github/workflows/test_deployment.yml b/.github/workflows/test_deployment.yml index 0c645c4e3..09074d568 100644 --- a/.github/workflows/test_deployment.yml +++ b/.github/workflows/test_deployment.yml @@ -8,9 +8,9 @@ jobs: name: Verify modified roles runs-on: ubuntu-latest outputs: - ipaserver: ${{ steps.mod_files.output.ipaserver }} - ipareplica: ${{ steps.mod_files.output.ipareplica }} - ipaclient: ${{ steps.mod_files.output.ipaclient }} + ipaserver: ${{ steps.mod_files.outputs.ipaserver }} + ipareplica: ${{ steps.mod_files.outputs.ipareplica }} + ipaclient: ${{ steps.mod_files.outputs.ipaclient }} steps: - uses: actions/checkout@v4.1.1 with: @@ -23,28 +23,77 @@ jobs: set -eu git remote add upstream https://github.com/freeipa/ansible-freeipa git fetch --depth 1 upstream master + git diff -M --name-only upstream/master \ + | grep "^roles" \ + | cut -d/ -f2 \ + | sort | uniq \ + | sed "s/\(.*\)/\1=true/" git diff -M --name-only upstream/master \ | grep "^roles" \ | cut -d/ -f2 \ | sort | uniq \ | sed "s/\(.*\)/\1=true/" >> $GITHUB_OUTPUT - test_ipaserver: - name: Test ipaserver role + debug: + name: Debug needs: [check_roles] - if: ${{ needs.check_roles.outputs.ipaserver || "false" }} == "true" runs-on: ubuntu-latest steps: - - name: Test ipaserver + - name: Check vars run: | - echo "testing ipaserver" + echo ${{ needs.check_roles.outputs.ipaserver }} + echo ${{ needs.check_roles.outputs.ipareplica }} + echo ${{ needs.check_roles.outputs.ipaclient }} - test_ipareplica: - name: Test ipareplica role + test_ipaserver: + name: Test ipaserver role needs: [check_roles] - if: ${{ needs.check_roles.outputs.ipareplica || "false" }} == "true" + if: ${{ needs.check_roles.outputs.ipaserver }} runs-on: ubuntu-latest + strategy: + matrix: + cluster_config: + - ipaserver_ca.yml + # - ipaserver_ca_dns_kra_ad.yml + # - ipaserver_ipaclient_ca.yml steps: - - name: Test ipareplica - run: | - echo "testing ipareplica" + - uses: actions/checkout@v4.1.1 + with: + fetch-depth: 1 + + - name: Test ipaserver + uses: rjeffman/FreeIPA-Cluster-Test@main + with: + cluster_configuration: tests/deployment/${{ matrix.cluster_config }} + test_paybooks: | + tests/user/test_user.yml + tests/group/test_group.yml + tests/host/test_host.yml + tests/hbacrule/test_hbacrule.yml + +# test_ipareplica: +# name: Test ipareplica role +# needs: [check_roles] +# if: ${{ needs.check_roles.outputs.ipareplica }} +# runs-on: ubuntu-latest +# strategy: +# matrix: +# # The ipaserver configuration is always "ca-dns-kra-ad" +# cluster_config: +# - ipareplica_none.yml +# - ipareplica_ca.yml +# steps: +# +# test_ipaclientt: +# name: Test ipareplica role +# needs: [check_roles] +# if: ${{ needs.check_roles.outputs.ipareplica }} +# runs-on: ubuntu-latest +# strategy: +# matrix: +# # The ipaserver configuration is always "ca-dns-kra-ad" +# cluster_config: +# - ipareplica_none.yml +# - ipareplica_ca.yml +# - ipareplica_copy.yml +# steps: diff --git a/tests/deployment/ipaserver_ca.yml b/tests/deployment/ipaserver_ca.yml new file mode 100644 index 000000000..a49de8061 --- /dev/null +++ b/tests/deployment/ipaserver_ca.yml @@ -0,0 +1,10 @@ +lab_name: ipaserver_ca +ipa-deployments: + - name: ipaserver_with_ca + domain: ipa.test + admin_password: SomeADMINpassword + dm_password: SomeDMpassword + distro: fedora-latest + cluster: + servers: + - name: ipaserver