diff --git a/molecule/playbook-reverse_proxy/molecule.yml b/molecule/playbook-reverse_proxy/molecule.yml index 00c5b320..1eb4ba46 100644 --- a/molecule/playbook-reverse_proxy/molecule.yml +++ b/molecule/playbook-reverse_proxy/molecule.yml @@ -1,7 +1,7 @@ --- platforms: - name: workspace-src-ubuntu_jammy - image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx + image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_noble-nginx command: /sbin/init pre_build_image: true published_ports: @@ -22,7 +22,14 @@ provisioner: - name: reverse_proxy path: reverse_proxy.yml parameters: - reverse_proxy_locations: '- {name: mock_endpoint, location: /auth_endpoint, proxy_pass: "http://localhost:8000/" }\n- {name: test_noauth, location: /, proxy_pass: "http://localhost:8000", add_header: {myheader: foo } }\n- {name: test_basicauth, location: = /test_basicauth, auth: basic, htpasswd: myauth, proxy_pass: "http://localhost:8000/" }\n- {name: test_basicauth2, location: = /test_basicauth2, auth: basic, htpasswd: myauth2, proxy_pass: "http://localhost:8000/" }\n- {name: test_sramauth, location: /test_sramauth, auth: sram, proxy_pass: "http://localhost/"}\n- {name: test_authoff, location: /test_basicauth/api, auth: noauth, alias: /etc/nginx, proxy_set_header: { X-Real-IP: ""} }' - reverse_proxy_auth_info: '- {name: myauth, username: test, password: letmein}\n' + reverse_proxy_locations: | + - {name: mock_endpoint, location: /auth_endpoint, proxy_pass: "http://localhost:8000/" } + - {name: test_noauth, location: /, proxy_pass: "http://localhost:8000", add_header: {myheader: foo}} + - {name: test_basicauth, location: = /test_basicauth, auth: basic, htpasswd: myauth, proxy_pass: "http://localhost:8000/"} + - {name: test_basicauth2, location: = /test_basicauth2, auth: basic, htpasswd: myauth2, proxy_pass: "http://localhost:8000/"} + - {name: test_sramauth, location: /test_sramauth, auth: sram, proxy_pass: "http://localhost/"} + - {name: test_authoff, location: /test_basicauth/api, auth: noauth, alias: /etc/nginx,proxy_set_header: { X-Real-IP: ""}} + reverse_proxy_auth_info: | + - {name: myauth, username: test, password: letmein} basic_auth_default_username: 'test2' basic_auth_default_password: 'letmeintoo' diff --git a/playbooks/reverse_proxy.yml b/playbooks/reverse_proxy.yml index dbd5d762..e2a1b924 100644 --- a/playbooks/reverse_proxy.yml +++ b/playbooks/reverse_proxy.yml @@ -10,12 +10,12 @@ - name: Parse reverse proxy locations variable as yaml ansible.builtin.set_fact: - locations: "{{ reverse_proxy_locations.split('\\n') | join('\n') | from_yaml }}" + locations: "{{ reverse_proxy_locations.split('\\n') | list | join('\n') | from_yaml }}" - name: Parse auth info variable as yaml when: reverse_proxy_auth_info is defined and reverse_proxy_auth_info | length > 0 ansible.builtin.set_fact: - auth_info: "{{ reverse_proxy_auth_info.split('\\n') | join('\n') | from_yaml }}" + auth_info: "{{ reverse_proxy_auth_info.split('\\n') | list | join('\n') | from_yaml }}" no_log: true roles: