|
4 | 4 | # Run Keycloak in the environment and publish how tests reach it. |
5 | 5 | # |
6 | 6 | # Environment setup applies this once and caches the disk, so the container |
7 | | -# restarts on every boot (see the keycloak role). Tests read the variables in |
8 | | -# the env file below through openshell-test-runner, which passes every |
9 | | -# /etc/openshell-test/env.d/*.env file to them. The keycloak features suite |
10 | | -# (tests/suites/features/keycloak) reads them. |
| 7 | +# restarts on every boot (see the keycloak role). The keycloak features suite |
| 8 | +# (tests/suites/features/keycloak) reads the variables published below. |
11 | 9 | --- |
12 | 10 | - name: Keycloak for tests |
13 | 11 | hosts: all |
14 | 12 | gather_facts: false |
15 | 13 | roles: |
16 | 14 | - keycloak |
17 | 15 | tasks: |
18 | | - - name: Create the test environment directory |
19 | | - become: true |
20 | | - ansible.builtin.file: |
21 | | - path: /etc/openshell-test/env.d |
22 | | - state: directory |
23 | | - owner: root |
24 | | - group: root |
25 | | - mode: "0755" |
26 | | - |
27 | 16 | # The values are the throwaway fixture realm's (scripts/keycloak-realm.json). |
28 | 17 | - name: Publish Keycloak test variables |
29 | | - become: true |
30 | | - ansible.builtin.copy: |
31 | | - dest: /etc/openshell-test/env.d/keycloak.env |
32 | | - owner: tmachine |
33 | | - group: tmachine |
34 | | - mode: "0600" |
35 | | - content: | |
36 | | - OPENSHELL_TEST_KEYCLOAK_ISSUER=http://127.0.0.1:{{ keycloak_port }}/realms/{{ keycloak_realm }} |
37 | | - OPENSHELL_TEST_KEYCLOAK_CLIENT_ID=openshell-cli |
38 | | - OPENSHELL_TEST_KEYCLOAK_USERNAME=admin@test |
39 | | - OPENSHELL_TEST_KEYCLOAK_PASSWORD=admin |
| 18 | + ansible.builtin.include_tasks: test-env.yaml |
| 19 | + vars: |
| 20 | + test_env_name: keycloak |
| 21 | + test_env_vars: |
| 22 | + OPENSHELL_TEST_KEYCLOAK_ISSUER: "http://127.0.0.1:{{ keycloak_port }}/realms/{{ keycloak_realm }}" |
| 23 | + OPENSHELL_TEST_KEYCLOAK_CLIENT_ID: openshell-cli |
| 24 | + OPENSHELL_TEST_KEYCLOAK_USERNAME: admin@test |
| 25 | + OPENSHELL_TEST_KEYCLOAK_PASSWORD: admin |
0 commit comments