Skip to content

Commit

Permalink
molecule: use new nginx test image instead of running nginx component (
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto authored Nov 13, 2024
1 parent aaa0315 commit c9c638e
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 123 deletions.
14 changes: 1 addition & 13 deletions molecule/playbook-aptly/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ scenario:
- destroy
platforms:
- name: workspace-src-ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx
command: /sbin/init
pre_build_image: true
published_ports:
Expand All @@ -30,18 +30,6 @@ provisioner:
env:
extra_prepare_tasks: ../../playbook-aptly/extra_prepare.yml # relative to <repo_root>/molecule/ext/src-molecule
components:
- name: nginx
git: https://gitlab.com/dometto/plugin-nginx.git
version: molecule_compatibility
path: plugin-nginx.yml
parameters:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
client_id: foo
- name: aptly
path: aptly.yml
parameters:
Expand Down
40 changes: 14 additions & 26 deletions molecule/playbook-flask_app/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
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx
command: /sbin/init
pre_build_image: true
published_ports:
Expand All @@ -19,28 +19,16 @@ provisioner:
env:
ANSIBLE_ROLES_PATH: ../../../
components:
- name: nginx
git: https://gitlab.com/dometto/plugin-nginx.git
path: plugin-nginx.yml
version: molecule_compatibility
parameters:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
client_id: foo
- name: flask_app
path: flask_app.yml
parameters:
flask_app_name: hello
flask_app_path: hello/app.py
flask_app_auth_basic: true
flask_app_username: tester
flask_app_password: letmein
flask_app_repo: https://github.com/dometto/flask-examples.git
flask_app_requirements: 'requirements.txt'
flask_app_location: '/'
flask_app_uwsgi_config: >
vacuum = false # just to test the flask_app_uswgi_config option
- name: flask_app
path: flask_app.yml
parameters:
flask_app_name: hello
flask_app_path: hello/app.py
flask_app_auth_basic: true
flask_app_username: tester
flask_app_password: letmein
flask_app_repo: https://github.com/dometto/flask-examples.git
flask_app_requirements: 'requirements.txt'
flask_app_location: '/'
flask_app_uwsgi_config: >
vacuum = false # just to test the flask_app_uswgi_config option
14 changes: 1 addition & 13 deletions molecule/playbook-keycloak/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
platforms:
- name: workspace-src-ubuntu_desktop
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_focal-desktop
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx
command: /sbin/init
pre_build_image: true
published_ports:
Expand All @@ -16,17 +16,5 @@ provisioner:
env:
ANSIBLE_ROLES_PATH: ../../../
components:
- name: nginx
git: https://gitlab.com/dometto/plugin-nginx.git
path: plugin-nginx.yml
version: molecule_compatibility
parameters:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
client_id: foo
- name: keycloak
path: keycloak.yml
16 changes: 2 additions & 14 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
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx
command: /sbin/init
pre_build_image: true
published_ports:
Expand All @@ -19,22 +19,10 @@ provisioner:
env:
ANSIBLE_ROLES_PATH: ../../../
components:
- name: nginx
git: https://gitlab.com/dometto/plugin-nginx.git
path: plugin-nginx.yml
version: molecule_compatibility
parameters:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
client_id: foo
- name: reverse_proxy
path: reverse_proxy.yml
parameters:
reverse_proxy_locations: '- {name: test_noauth, location: /, proxy_pass: "http://localhost:8000" }\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:8000/"}\n- {name: test_authoff, location: /test_basicauth/api, auth: noauth, alias: /etc/nginx, proxy_set_header: { X-Real-IP: ""} }'
reverse_proxy_locations: '- {name: mock_endpoint, location: /auth_endpoint, proxy_pass: "http://localhost:8000/" }\n- {name: test_noauth, location: /, proxy_pass: "http://localhost:8000" }\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'
basic_auth_default_username: 'test2'
basic_auth_default_password: 'letmeintoo'
2 changes: 1 addition & 1 deletion molecule/playbook-reverse_proxy/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
ansible.builtin.assert:
that:
- sramauth_location.redirected is true
- sramauth_location.url == "http://localhost/?client_id=foo&redirect_uri=http://localhost/oauth2_callback?rdpath=/test_sramauth/&response_type=token&scope=openid&response_format=query_param"
- sramauth_location.url == "http://localhost/auth_endpoint?client_id=foo&redirect_uri=http://localhost/oauth2_callback&response_type=token&scope=openid&response_format=query_param"
- basicauth_location.status == 200
- "'bin' in basicauth_location.content"
- root_location.status == 200
Expand Down
18 changes: 0 additions & 18 deletions playbooks/roles/nginx_uwsgi/molecule/_run_external_components.yml

This file was deleted.

2 changes: 1 addition & 1 deletion playbooks/roles/nginx_uwsgi/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provisioner:
role_name_check: 1
platforms:
- name: workspace-src-ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx
command: /sbin/init
pre_build_image: true
registry:
Expand Down
18 changes: 0 additions & 18 deletions playbooks/roles/nginx_uwsgi/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,3 @@
tasks:
- name: Common preparation tasks
ansible.builtin.include_tasks: ../_prepare.yml

- name: Run external components
ansible.builtin.include_tasks: ../_run_external_components.yml
loop:
- name: nginx
git: https://gitlab.com/dometto/plugin-nginx.git
version: molecule_compatibility
path: plugin-nginx.yml
parameters:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
client_id: foo
loop_control:
loop_var: component
2 changes: 1 addition & 1 deletion playbooks/roles/nginx_uwsgi/molecule/venv/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provisioner:
role_name_check: 1
platforms:
- name: workspace-src-ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-nginx
command: /sbin/init
pre_build_image: true
registry:
Expand Down
18 changes: 0 additions & 18 deletions playbooks/roles/nginx_uwsgi/molecule/venv/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,3 @@
name:
- build-essential
- python3-dev

- name: Run external components
ansible.builtin.include_tasks: ../_run_external_components.yml
loop:
- name: nginx
git: https://gitlab.com/dometto/plugin-nginx.git
version: molecule_compatibility
path: plugin-nginx.yml
parameters:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
client_id: foo
loop_control:
loop_var: component

0 comments on commit c9c638e

Please sign in to comment.