mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 02:10:05 +00:00 
			
		
		
		
	Refactored peertube role and implemented config volume
This commit is contained in:
		| @@ -8,7 +8,6 @@ | ||||
|     - run_once_web_svc_collabora is not defined | ||||
|     - NEXTCLOUD_COLLABORA_ENABLED | bool | ||||
|  | ||||
|  | ||||
| - name: "include role for {{ application_id }} to receive certs & do modification routines" | ||||
|   include_role: | ||||
|     name: sys-util-csp-cert | ||||
|   | ||||
| @@ -40,3 +40,4 @@ docker: | ||||
|         no_stop_required: true | ||||
|   volumes: | ||||
|     data: peertube_data | ||||
|     config: peertube_config | ||||
| @@ -4,15 +4,15 @@ | ||||
| 
 | ||||
| - name: Check if OIDC plugin is already installed | ||||
|   command: > | ||||
|     docker exec {{ peertube_name }} test -d /data/plugins/data/peertube-plugin-auth-openid-connect | ||||
|     docker exec {{ PEERTUBE_CONTAINER }} test -d /data/plugins/data/peertube-plugin-auth-openid-connect | ||||
|   register: peertube_oidc_plugin_check | ||||
|   failed_when:  false | ||||
|   changed_when: false | ||||
| 
 | ||||
| - name: "Install auth-openid-connect plugin for Peertube" | ||||
|   command: > | ||||
|     docker exec {{ peertube_name }} \ | ||||
|     npm run plugin:install -- --npm-name {{oidc_plugin}} | ||||
|     docker exec {{ PEERTUBE_CONTAINER }} \ | ||||
|     npm run plugin:install -- --npm-name {{ PEERTUBE_OIDC_PLUGIN }} | ||||
|   when: peertube_oidc_plugin_check.rc != 0 | ||||
|   notify: docker compose up | ||||
| 
 | ||||
							
								
								
									
										5
									
								
								roles/web-app-peertube/tasks/02_disable-oidc.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								roles/web-app-peertube/tasks/02_disable-oidc.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| - name: "Uninstall auth-openid-connect plugin for Peertube" | ||||
|   command: > | ||||
|     docker exec {{ PEERTUBE_CONTAINER }} \ | ||||
|     npm run plugin:uninstall -- --npm-name {{ PEERTUBE_OIDC_PLUGIN }} | ||||
|   ignore_errors: true | ||||
| @@ -1,5 +0,0 @@ | ||||
| - name: "Uninstall auth-openid-connect plugin for Peertube" | ||||
|   command: > | ||||
|     docker exec {{ peertube_name }} \ | ||||
|     npm run plugin:uninstall -- --npm-name {{oidc_plugin}} | ||||
|   ignore_errors: true | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
| - name: "include create-domains.yml for peertube" | ||||
|   include_tasks: create-domains.yml | ||||
|   loop: "{{ domains['web-app-peertube'] }}" | ||||
| - name: "include _create-domains.yml for peertube" | ||||
|   include_tasks: _create-domains.yml | ||||
|   loop: "{{ domains[application_id] }}" | ||||
|   loop_control: | ||||
|     loop_var: domain | ||||
|   vars: | ||||
| @@ -14,9 +14,9 @@ | ||||
|     name: sys-stk-back-stateful | ||||
|  | ||||
| - name: "Install and activate auth-openid-connect plugin if OIDC is enabled" | ||||
|   include_tasks: enable-oidc.yml | ||||
|   when: applications | get_app_conf(application_id, 'features.oidc', False) | ||||
|   include_tasks: 01_enable-oidc.yml | ||||
|   when: PEERTUBE_OIDC_ENABLED | ||||
|  | ||||
| - name: "Deinstall and disable auth-openid-connect plugin if OIDC is enabled" | ||||
|   include_tasks: disable-oidc.yml | ||||
|   when: applications | get_app_conf(application_id, 'features.oidc', False) | ||||
|   include_tasks: 02_disable-oidc.yml | ||||
|   when: PEERTUBE_OIDC_ENABLED | ||||
| @@ -2,8 +2,8 @@ | ||||
|  | ||||
|   application: | ||||
| {% set container_port = 9000 %} | ||||
|     image: {{ peertube_image }}:{{ peertube_version }} | ||||
|     container_name: {{ peertube_name }} | ||||
|     image: {{ PEERTUBE_IMAGE }}:{{ PEERTUBE_VERSION }} | ||||
|     container_name: {{ PEERTUBE_CONTAINER }} | ||||
| {% include 'roles/docker-container/templates/base.yml.j2' %} | ||||
|     ports: | ||||
|      - "1935:1935"  # @todo Add to ports | ||||
| @@ -18,7 +18,8 @@ | ||||
| {% include 'roles/docker-compose/templates/volumes.yml.j2' %} | ||||
|   assets: | ||||
|   data: | ||||
|     name: {{ peertube_volume }} | ||||
|     name: {{ PEERTUBE_DATA_VOLUME }} | ||||
|   config: | ||||
|     name: {{ PEERTUBE_CONFIG_VOLUME }} | ||||
|  | ||||
| {% include 'roles/docker-compose/templates/networks.yml.j2' %} | ||||
| @@ -6,10 +6,12 @@ database_type:                  "postgres" | ||||
| docker_compose_flush_handlers:  true | ||||
|  | ||||
| # Role variables | ||||
| peertube_version:               "{{ applications | get_app_conf(application_id, 'docker.services.peertube.version', True) }}" | ||||
| peertube_image:                 "{{ applications | get_app_conf(application_id, 'docker.services.peertube.image', True) }}" | ||||
| peertube_name:                  "{{ applications | get_app_conf(application_id, 'docker.services.peertube.name', True) }}" | ||||
| peertube_volume:                "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}" | ||||
| PEERTUBE_VERSION:               "{{ applications | get_app_conf(application_id, 'docker.services.peertube.version') }}" | ||||
| PEERTUBE_IMAGE:                 "{{ applications | get_app_conf(application_id, 'docker.services.peertube.image') }}" | ||||
| PEERTUBE_CONTAINER:             "{{ applications | get_app_conf(application_id, 'docker.services.peertube.name') }}" | ||||
| PEERTUBE_DATA_VOLUME:           "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}" | ||||
| PEERTUBE_CONFIG_VOLUME:         "{{ applications | get_app_conf(application_id, 'docker.volumes.config') }}" | ||||
|  | ||||
| # OIDC | ||||
| oidc_plugin:                    "peertube-plugin-auth-openid-connect" | ||||
| PEERTUBE_OIDC_PLUGIN:           "peertube-plugin-auth-openid-connect" | ||||
| PEERTUBE_OIDC_ENABLED:          "{{ applications | get_app_conf(application_id, 'features.oidc', False) }}" | ||||
		Reference in New Issue
	
	Block a user