nextcloud: Aktualisiere Variablen, automatische Versionsermittlung

This commit is contained in:
phil 2022-10-08 22:47:54 +02:00
parent e3e6cf142b
commit d0caf506f9
5 changed files with 28 additions and 24 deletions

View file

@ -2,22 +2,13 @@
nextcloud_admin_user: systemausfall.org
nextcloud_admin_pw: admin
nextcloud_db_password: "{{ lookup('password', '/tmp/{{ instance.name }}_db_pwd length=42 chars=ascii_letters,digits') }}"
nextcloud_dl_url: https://download.nextcloud.com/server/releases
nextcloud_github_api_url: https://api.github.com/repos/nextcloud/server/releases/latest
nextcloud_dl_url: "https://download.nextcloud.com/server/releases/nextcloud-{{ latest_version.stdout }}.tar.bz2"
nextcloud_root: /data/nextcloud
nextcloud_install_path: "{{ nextcloud_root }}/{{ instance.name }}"
nextcloud_config_file: "{{ nextcloud_install_path }}/config/config.php"
nextcloud_php_memory_limit: 512M
nextcloud_php_upload_limit: 512M
nextcloud_trusted_domains: ['localhost', '{{ instance.name }}']
nextcloud_trusted_proxies: ['10.42.7.1']
nextcloud_version: nextcloud-22.2.0
nextcloud_mail_from: noreply
nextcloud_mail_domain: postfach.senselab.org
nextcloud_smtp_auth_type: LOGIN
nextcloud_smtp_host: sl-postbote.kahlo
nextcloud_smtp_port: 25
php_fpm_log_dir: /var/log/phpfpm
php_fpm_pool_dir: /etc/php/{{ php_version.stdout }}/fpm/pool.d
redis_config_file: /etc/redis/redis.conf

View file

@ -8,15 +8,20 @@
- { name: expires }
- { name: headers }
- { name: macro }
- { name: mpm_prefork, state: absent }
- { name: mpm_event }
- { name: mpm_prefork, state: absent }
- { name: proxy_fcgi }
- { name: setenvif }
notify: restart apache
- name: "common | Apache-Konfiguration für NC-Seiten"
file:
path: /etc/apache2/conf-available/nextcloud_sites.conf
state: touch
- name: "common | Apache-Vorlage für Seitenkonfiguration kopieren"
copy:
src: ../roles/nextcloud/files/apache_site.conf
template:
src: ../roles/nextcloud/templates/apache_site.conf.j2
dest: /etc/apache2/sites-available/nextcloud.conf
- name: "common | Apache-Seitenkonfiguration aktivieren"
@ -37,6 +42,13 @@
dest: "/etc/php/{{ php_version.stdout }}/cli/conf.d/30-sao-nextcloud.ini"
state: link
- name: "common | Ermittle letzte Version"
shell:
cmd: curl -sL "{{ nextcloud_github_api_url }}" | jq -r ".tag_name" | cut -d 'v' -f2
warn: false
changed_when: false
register: latest_version
- name: "common | Kopiere Update-Skript"
template:
src: ../roles/nextcloud/templates/nextcloud-updater.j2

View file

@ -5,7 +5,6 @@
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
config_file: /etc/mysql/debian.cnf
delegate_to: "{{ database_host }}"
- name: "database | {{ instance.name }} | Benutzer einrichten"

View file

@ -7,21 +7,23 @@
- name: "nextcloud: {{ instance.name }}: herunterladen und entpacken"
unarchive:
src: "{{ nextcloud_dl_url }}/{{ nextcloud_version }}.tar.bz2"
src: "{{ nextcloud_dl_url }}"
remote_src: true
extra_opts:
- "--strip-components=1"
dest: "{{ nextcloud_install_path }}"
owner: "{{ user }}"
group: "{{ user }}"
owner: "{{ instance.user }}"
group: "{{ instance.user }}"
mode: 0755
- name: "nextcloud: {{ instance.name }}: Installation"
command: >
php "{{ nextcloud_install_path }}"/occ maintenance:install --database "mysql"
--database-name "{{ instance.database }}" --database-user "{{ instance.database }}"
--database-pass "{{ nextcloud_db_password }}" --database-host "{{ database_host }}"
--admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_pw }}"
command:
cmd: >
php occ maintenance:install --database "mysql"
--database-name "{{ instance.database }}" --database-user "{{ instance.database }}"
--database-pass "{{ nextcloud_db_password }}" --database-host "{{ database_host }}"
--admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_pw }}"
chdir: "{{ nextcloud_install_path }}"
become: true
become_user: "{{ instance.user }}"
changed_when: true

View file

@ -19,7 +19,7 @@
</FilesMatch>
</IfModule>
<Directory /data/nextcloud/$domain/>
<Directory {{ nextcloud_root }}/$domain/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews