Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions molecule/playbook-reverse_proxy/molecule.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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'
4 changes: 2 additions & 2 deletions playbooks/reverse_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading