diff --git a/roles/web-app-nextcloud/tasks/main.yml b/roles/web-app-nextcloud/tasks/main.yml index ddf6811b..29a7ac0a 100644 --- a/roles/web-app-nextcloud/tasks/main.yml +++ b/roles/web-app-nextcloud/tasks/main.yml @@ -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 diff --git a/roles/web-app-peertube/config/main.yml b/roles/web-app-peertube/config/main.yml index 99c6a35e..507cf262 100644 --- a/roles/web-app-peertube/config/main.yml +++ b/roles/web-app-peertube/config/main.yml @@ -40,3 +40,4 @@ docker: no_stop_required: true volumes: data: peertube_data + config: peertube_config \ No newline at end of file diff --git a/roles/web-app-peertube/tasks/enable-oidc.yml b/roles/web-app-peertube/tasks/01_enable-oidc.yml similarity index 81% rename from roles/web-app-peertube/tasks/enable-oidc.yml rename to roles/web-app-peertube/tasks/01_enable-oidc.yml index 7a1e4748..afc9eed0 100644 --- a/roles/web-app-peertube/tasks/enable-oidc.yml +++ b/roles/web-app-peertube/tasks/01_enable-oidc.yml @@ -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 diff --git a/roles/web-app-peertube/tasks/02_disable-oidc.yml b/roles/web-app-peertube/tasks/02_disable-oidc.yml new file mode 100644 index 00000000..02925047 --- /dev/null +++ b/roles/web-app-peertube/tasks/02_disable-oidc.yml @@ -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 diff --git a/roles/web-app-peertube/tasks/create-domains.yml b/roles/web-app-peertube/tasks/_create-domains.yml similarity index 100% rename from roles/web-app-peertube/tasks/create-domains.yml rename to roles/web-app-peertube/tasks/_create-domains.yml diff --git a/roles/web-app-peertube/tasks/disable-oidc.yml b/roles/web-app-peertube/tasks/disable-oidc.yml deleted file mode 100644 index d5a28440..00000000 --- a/roles/web-app-peertube/tasks/disable-oidc.yml +++ /dev/null @@ -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 diff --git a/roles/web-app-peertube/tasks/main.yml b/roles/web-app-peertube/tasks/main.yml index 6a2923ab..2d41f112 100644 --- a/roles/web-app-peertube/tasks/main.yml +++ b/roles/web-app-peertube/tasks/main.yml @@ -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) \ No newline at end of file + include_tasks: 02_disable-oidc.yml + when: PEERTUBE_OIDC_ENABLED \ No newline at end of file diff --git a/roles/web-app-peertube/templates/docker-compose.yml.j2 b/roles/web-app-peertube/templates/docker-compose.yml.j2 index 10f2a5ed..c4460ac6 100644 --- a/roles/web-app-peertube/templates/docker-compose.yml.j2 +++ b/roles/web-app-peertube/templates/docker-compose.yml.j2 @@ -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' %} \ No newline at end of file diff --git a/roles/web-app-peertube/vars/main.yml b/roles/web-app-peertube/vars/main.yml index 754e9d4f..ea31f569 100644 --- a/roles/web-app-peertube/vars/main.yml +++ b/roles/web-app-peertube/vars/main.yml @@ -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" \ No newline at end of file +PEERTUBE_OIDC_PLUGIN: "peertube-plugin-auth-openid-connect" +PEERTUBE_OIDC_ENABLED: "{{ applications | get_app_conf(application_id, 'features.oidc', False) }}" \ No newline at end of file