Compare commits

..

20 Commits

Author SHA1 Message Date
eea141b844 update(nextcloud): bump version to 30.0.6 2025-02-21 16:48:06 +01:00
4969faeb70 meta: bump galaxy version to 0.7.3 2025-01-30 15:38:28 +01:00
00fa76be14 update(nginx_fpm_proxy): bump nginx version to 1.27.3 2025-01-30 15:37:37 +01:00
23f70c9f26 update(server): bump version to 30.0.5 2025-01-20 21:09:35 +01:00
4f7cd41d72 update(server): bump version to 30.0.4 2024-12-22 20:18:40 +01:00
bb0e1f3ad5 meta: bump collection version to 0.7.2 2024-11-30 19:31:50 +01:00
12ac351254 chore(server): 'purge_networks' option for 'docker_container' module is removed 2024-11-30 19:29:26 +01:00
dbb6fe15ce chore(server): support setting /etc/hosts in container 2024-11-26 20:19:20 +01:00
3616ad5f45 update(server): bump version to 30.0.2 2024-11-25 21:46:16 +01:00
0a3b32c823 fix(server): use correct jinja2 tags 2024-11-02 12:08:08 +01:00
e2e8d84c13 chore(nginx_fpm_proxy): provide defaults for not defined variables 2024-10-26 19:01:08 +02:00
6027db3f5f update(server): bump version to 30.0.1 2024-10-23 20:46:49 +02:00
8eae295b83 meta: add tags to collection 2024-10-05 10:30:04 +02:00
f759064c1e meta: bump collection version to 0.7.1 2024-10-04 19:52:29 +02:00
38246ea585 meta: add role metadata 2024-10-04 19:51:33 +02:00
ff312f8214 meta(server): add role metadata 2024-10-04 19:44:33 +02:00
31f326016b chore(server): retry configure during nextcloud restart 2024-10-04 19:44:28 +02:00
6640ba726e chore(server): split container image into parts 2024-10-04 19:44:22 +02:00
4a67f38f11 meta: bump collection to 0.7.0 2024-10-02 20:58:52 +02:00
23301a0a86 feat(oidc_user_backend): add ansible role 2024-09-29 22:18:55 +02:00
17 changed files with 94 additions and 27 deletions

View File

@ -1,6 +1,6 @@
namespace: finallycoffee namespace: finallycoffee
name: nextcloud name: nextcloud
version: 0.6.1 version: "0.7.3"
readme: README.md readme: README.md
authors: authors:
- transcaffeine <transcaffeine@finally.coffee> - transcaffeine <transcaffeine@finally.coffee>
@ -12,3 +12,7 @@ build_ignore:
- '*.tar.gz' - '*.tar.gz'
repository: https://git.finally.coffee/finallycoffee/nextcloud repository: https://git.finally.coffee/finallycoffee/nextcloud
issues: https://codeberg.org/finallycoffee/ansible-collection-nextcloud/issues issues: https://codeberg.org/finallycoffee/ansible-collection-nextcloud/issues
tags:
- nextcloud
- nextcloud_apps
- docker

12
roles/apps/meta/main.yml Normal file
View File

@ -0,0 +1,12 @@
---
allow_duplicates: true
dependencies: []
galaxy_info:
role_name: apps
description: Install Nextcloud apps using ansible
galaxy_tags:
- nextcloud
- owncloud
- apps
- nextcloud-apps
- docker

View File

@ -1,4 +1,12 @@
--- ---
allow_duplicates: true
collections: dependencies: []
- community.docker galaxy_info:
role_name: ldap_user_backend
description: Configure a nextcloud ldap user backend using ansible
galaxy_tags:
- nextcloud
- owncloud
- ldap
- authentication
- docker

View File

@ -1,6 +1,5 @@
--- ---
nextcloud_nginx_version: "1.27.3"
nextcloud_nginx_version: "1.25.3"
nextcloud_nginx_basepath: /opt/nextcloud-nginx nextcloud_nginx_basepath: /opt/nextcloud-nginx
nextcloud_nginx_config: "{{ nextcloud_nginx_basepath }}/nextcloud.conf" nextcloud_nginx_config: "{{ nextcloud_nginx_basepath }}/nextcloud.conf"
nextcloud_nginx_servernames: ~ nextcloud_nginx_servernames: ~

View File

@ -0,0 +1,12 @@
---
allow_duplicates: true
dependencies: []
galaxy_info:
role_name: nginx_fpm_proxy
description: Configure nginx as a FPM proxy for nextcloud
galaxy_tags:
- nextcloud
- owncloud
- nginx
- fpm
- docker

View File

@ -29,9 +29,9 @@
env: "{{ nextcloud_nginx_container_env }}" env: "{{ nextcloud_nginx_container_env }}"
name: "{{ nextcloud_nginx_container_name }}" name: "{{ nextcloud_nginx_container_name }}"
image: "{{ nextcloud_nginx_container_image_ref }}" image: "{{ nextcloud_nginx_container_image_ref }}"
ports: "{{ nextcloud_nginx_container_ports }}" ports: "{{ nextcloud_nginx_container_ports | default(omit, true) }}"
volumes: "{{ nextcloud_nginx_container_volumes }}" volumes: "{{ nextcloud_nginx_container_volumes }}"
labels: "{{ nextcloud_nginx_container_labels }}" labels: "{{ nextcloud_nginx_container_labels | default(omit, true) }}"
networks: "{{ nextcloud_nginx_container_networks | default(omit) }}" networks: "{{ nextcloud_nginx_container_networks | default(omit, true) }}"
restart_policy: "{{ nextcloud_nginx_container_restart_policy }}" restart_policy: "{{ nextcloud_nginx_container_restart_policy }}"
state: started state: started

View File

@ -4,9 +4,6 @@ Configure OIDC user backends in nextcloud using this ansible role.
This role can be run multiple times with different arguments in order to This role can be run multiple times with different arguments in order to
configure multiple oidc-based user backends. configure multiple oidc-based user backends.
> [!WARNING]
> This role is not production ready or finished
## Configuration ## Configuration
Set `oidc_user_backend_provider_identifier` to a unique identifier. Set `oidc_user_backend_provider_identifier` to a unique identifier.

View File

@ -9,7 +9,7 @@ oidc_user_backend_config_provider_scopes:
- email - email
- profile - profile
oidc_user_backend_config_provider_settings_unique_id: true oidc_user_backend_config_provider_settings_unique_uid: true
oidc_user_backend_config_provider_settings_check_bearer: true oidc_user_backend_config_provider_settings_check_bearer: true
oidc_user_backend_config_provider_settings_send_id_token_hint: true oidc_user_backend_config_provider_settings_send_id_token_hint: true
oidc_user_backend_config_provider_settings_bearer_provisioning: false oidc_user_backend_config_provider_settings_bearer_provisioning: false

View File

@ -0,0 +1,12 @@
---
allow_duplicates: true
dependencies: []
galaxy_info:
role_name: oidc_user_backend
description: Configure a nextcloud oidc user backend using ansible
galaxy_tags:
- nextcloud
- owncloud
- oidc
- authentication
- docker

View File

@ -38,3 +38,4 @@
oidc_user_backend_occ_command_result: >-2 oidc_user_backend_occ_command_result: >-2
{{ oidc_user_backend_occ_result_map[oidc_user_backend_deployment_method] {{ oidc_user_backend_occ_result_map[oidc_user_backend_deployment_method]
| default(false, true) }} | default(false, true) }}
when: oidc_user_backend_occ_command_result_var | default(false, true)

View File

@ -45,8 +45,8 @@
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: execute-occ.yml file: execute-occ.yml
vars: vars:
occ_command: >- oidc_user_backend_occ_command_to_exec: >-
{{ oidc_user_backend_occ_user_oidc_provider_set_command }} {{ oidc_user_backend_occ_user_oidc_provider_set_command }}
occ_become_user: "{{ oidc_user_backend_deployment_become_user_info.uid }}" oidc_user_backend_occ_user_to_become: "{{ oidc_user_backend_deployment_become_user_info.uid }}"
occ_command_result_var: "oidc_user_backend_occ_user_oidc_provider_update_info" oidc_user_backend_occ_command_result_var: ~
when: oidc_user_backend_backend_force_update | default(false, true) when: oidc_user_backend_backend_force_update | default(false, true)

View File

@ -9,7 +9,7 @@ oidc_user_backend_occ_user_oidc_config_provider_dict:
scope: "{{ oidc_user_backend_config_provider_scopes | default([], true) | join(' ') }}" scope: "{{ oidc_user_backend_config_provider_scopes | default([], true) | join(' ') }}"
settings: settings:
uniqueUid: >-2 uniqueUid: >-2
{{ oidc_user_backend_config_provider_settings_unique_id | bool }} {{ oidc_user_backend_config_provider_settings_unique_uid | bool }}
providerBasedId: >-2 providerBasedId: >-2
{{ oidc_user_backend_config_provider_settings_provider_based_id | bool }} {{ oidc_user_backend_config_provider_settings_provider_based_id | bool }}
checkBearer: >-2 checkBearer: >-2

View File

@ -7,7 +7,7 @@ oidc_user_backend_occ_user_oidc_provider_options_dict:
endsessionendpointuri: "{{ oidc_user_backend_config_provider_end_session_endpoint }}" endsessionendpointuri: "{{ oidc_user_backend_config_provider_end_session_endpoint }}"
scope: "'{{ oidc_user_backend_config_provider_scopes | default([], true) | join(' ') }}'" scope: "'{{ oidc_user_backend_config_provider_scopes | default([], true) | join(' ') }}'"
"unique-uid": >-2 "unique-uid": >-2
{{ oidc_user_backend_config_provider_settings_unique_id | bool | ternary(1, 0) }} {{ oidc_user_backend_config_provider_settings_unique_uid | bool | ternary(1, 0) }}
"check-bearer": >-2 "check-bearer": >-2
{{ oidc_user_backend_config_provider_settings_check_bearer | bool | ternary(1, 0) }} {{ oidc_user_backend_config_provider_settings_check_bearer | bool | ternary(1, 0) }}
"send-id-token-hint": >-2 "send-id-token-hint": >-2

View File

@ -1,6 +1,5 @@
--- ---
nextcloud_version: "30.0.6"
nextcloud_version: 30.0.0
nextcloud_user: nextcloud nextcloud_user: nextcloud
nextcloud_basepath: /opt/nextcloud nextcloud_basepath: /opt/nextcloud
nextcloud_config_path: "{{ nextcloud_basepath }}/config" nextcloud_config_path: "{{ nextcloud_basepath }}/config"
@ -20,9 +19,20 @@ nextcloud_database_pass: ~
nextcloud_database_host: localhost nextcloud_database_host: localhost
nextcloud_container_name: nextcloud nextcloud_container_name: nextcloud
nextcloud_container_image: docker.io/library/nextcloud nextcloud_container_image_server: docker.io
nextcloud_container_image_namespace: library
nextcloud_container_image_name: nextcloud
nextcloud_container_image: >-2
{{
[
nextcloud_container_image_server,
nextcloud_container_image_namespace,
nextcloud_container_image_name,
] | join('/')
}}
nextcloud_container_image_variant: "-fpm-alpine" nextcloud_container_image_variant: "-fpm-alpine"
nextcloud_container_image_ref: "{{ nextcloud_container_name }}:{{ nextcloud_version }}{{ nextcloud_container_image_variant }}" nextcloud_container_image_ref: >-2
{{ nextcloud_container_image }}:{{ nextcloud_version }}{{ nextcloud_container_image_variant }}
nextcloud_container_image_force_source: false nextcloud_container_image_force_source: false
nextcloud_container_restart_policy: "unless-stopped" nextcloud_container_restart_policy: "unless-stopped"
@ -41,7 +51,6 @@ nextcloud_container_extra_labels: {}
nextcloud_container_extra_environment: {} nextcloud_container_extra_environment: {}
nextcloud_container_networks: ~ nextcloud_container_networks: ~
nextcloud_container_purge_other_networks: true
nextcloud_paths: nextcloud_paths:
- path: "{{ nextcloud_config_path }}" - path: "{{ nextcloud_config_path }}"

View File

@ -0,0 +1,10 @@
---
allow_duplicates: true
dependencies: []
galaxy_info:
role_name: server
description: Deploy nextcloud server, the self-hosted nextcloud
galaxy_tags:
- nextcloud
- owncloud
- docker

View File

@ -9,6 +9,9 @@
user: "{{ nextcloud_user_info.uid }}" user: "{{ nextcloud_user_info.uid }}"
tty: yes tty: yes
register: nextcloud_current_config_entry register: nextcloud_current_config_entry
until: nextcloud_current_config_entry is success
retries: 30
delay: 10
check_mode: false check_mode: false
changed_when: false changed_when: false
@ -25,9 +28,9 @@
value_type: >- value_type: >-
{% if value is boolean %} {% if value is boolean %}
boolean boolean
{% elsif value is integer %} {% elif value is integer %}
integer integer
{% elsif value is float %} {% elif value is float %}
float float
{% else %} {% else %}
string string

View File

@ -29,7 +29,7 @@
group: "{{ item.group }}" group: "{{ item.group }}"
loop: "{{ nextcloud_paths }}" loop: "{{ nextcloud_paths }}"
- name: Ensure docker container for nextcloud is pulled - name: Ensure docker container image '{{ nextcloud_container_image_ref }}' for nextcloud is pulled
community.docker.docker_image: community.docker.docker_image:
name: "{{ nextcloud_container_image_ref }}" name: "{{ nextcloud_container_image_ref }}"
state: present state: present
@ -118,8 +118,8 @@
volumes: "{{ nextcloud_container_volumes }}" volumes: "{{ nextcloud_container_volumes }}"
labels: "{{ nextcloud_container_labels }}" labels: "{{ nextcloud_container_labels }}"
env: "{{ nextcloud_container_env }}" env: "{{ nextcloud_container_env }}"
etc_hosts: "{{ nextcloud_container_etc_hosts | default(omit, true) }}"
networks: "{{ nextcloud_container_networks | default(omit, true) }}" networks: "{{ nextcloud_container_networks | default(omit, true) }}"
purge_networks: "{{ nextcloud_container_purge_other_networks }}"
restart_policy: "{{ nextcloud_container_restart_policy }}" restart_policy: "{{ nextcloud_container_restart_policy }}"
state: started state: started