Compare commits

3 Commits
master ... main

Author SHA1 Message Date
362ec8c85f minor fixes 2023-12-19 13:13:33 +01:00
9866c8e6a9 add task name 2023-10-08 13:36:01 +02:00
03e26e0598 fix variables 2023-10-08 13:35:28 +02:00
5 changed files with 17 additions and 16 deletions

View File

@@ -2,5 +2,5 @@
nextcloud_instances: [] nextcloud_instances: []
nextcloud_user: "cloud" nextcloud_user: "cloud"
nextcloud_path: "/var/www/nextcloud" nextcloud_path: "/var/www/nextcloud"
php_binary: "php" php_binary_default: "php"
php_arguments: "" php_arguments_default: ""

View File

@@ -4,8 +4,8 @@
vars: vars:
nextcloud_user: "{{ nc_instance.nextcloud_user }}" nextcloud_user: "{{ nc_instance.nextcloud_user }}"
nextcloud_path: "{{ nc_instance.nextcloud_path }}" nextcloud_path: "{{ nc_instance.nextcloud_path }}"
php_binary: "{{ nc_instance.php_binary }}" php_binary: "{{ nc_instance.php_binary | default(php_binary_default) }}"
php_arguments: "{{ nc_instance.php_arguments }}" php_arguments: "{{ nc_instance.php_arguments | default(php_arguments_default) }}"
loop_control: loop_control:
loop_var: "nc_instance" loop_var: "nc_instance"
loop: "{{ nextcloud_instances }}" loop: "{{ nextcloud_instances }}"

View File

@@ -1,26 +1,26 @@
--- ---
- name: "Run Update-Check" - name: "{{ nextcloud_path }}: Run Update-Check"
become: true become: true
become_user: "{{ nextcloud_user }}" become_user: "{{ nextcloud_user }}"
shell: shell:
cmd: "{{ php_binary }} {{ php_arguments }} {{ nextcloud_path }}/occ update:check --no-interaction --no-warnings" cmd: "{{ php_binary }} {{ php_arguments }} {{ nextcloud_path }}/occ update:check --no-interaction --no-warnings"
register: nextcloud_update_check_output register: nextcloud_update_check_output
- name: "Parse Update-Check Output" - name: "{{ nextcloud_path }}: Parse Update-Check Output"
ansible.builtin.set_fact: ansible.builtin.set_fact:
nextcloud_update_needed: "{{ nextcloud_update_check_output.stdout | regex_search(update_regex) }}" nextcloud_update_needed: "{{ nextcloud_update_check_output.stdout | regex_search(update_regex) }}"
vars: vars:
update_regex: 'Nextcloud [\d\.]+ is available' update_regex: 'Nextcloud [\d\.]+ is available'
- name: "Main Update block" - name: "{{ nextcloud_path }}: Main Update block"
when: "nextcloud_update_needed" when: "nextcloud_update_needed"
block: block:
- name: "Run Update" - name: "{{ nextcloud_path }}: Entering Updater"
include_tasks: "update.yml" include_tasks: "update.yml"
when: nextcloud_update_needed when: nextcloud_update_needed
- name: "Run Maintenance tasks (after update)" - name: "{{ nextcloud_path }}: Run Maintenance tasks (after update)"
include_tasks: "occ_command.yml" include_tasks: "occ_command.yml"
vars: vars:
occ_command: "{{ item }}" occ_command: "{{ item }}"
@@ -28,7 +28,7 @@
- "maintenance:repair --no-interaction" - "maintenance:repair --no-interaction"
when: "nextcloud_update_needed" when: "nextcloud_update_needed"
- name: "Run Maintenance tasks" - name: "{{ nextcloud_path }}: Run Maintenance tasks"
include_tasks: "occ_command.yml" include_tasks: "occ_command.yml"
vars: vars:
occ_command: "{{ item }}" occ_command: "{{ item }}"

View File

@@ -1,5 +1,5 @@
--- ---
- name: "Run OCC Command: {{ occ_command }}" - name: "{{ nextcloud_path }}: Run OCC Command: {{ occ_command }}"
become: true become: true
become_user: "{{ nextcloud_user }}" become_user: "{{ nextcloud_user }}"
shell: shell:

View File

@@ -1,21 +1,22 @@
--- ---
- name: "Run Updater" - name: "{{ nextcloud_path }}: Run Updater.phar"
become: true become: true
become_user: "{{ nextcloud_user }}" become_user: "{{ nextcloud_user }}"
shell: shell:
chdir: "{{ nextcloud_path }}/updater"
cmd: "alias \"php={{ php_binary }} {{ php_arguments }}\"; php {{ nextcloud_path }}/updater/updater.phar --no-interaction" cmd: "alias \"php={{ php_binary }} {{ php_arguments }}\"; php {{ nextcloud_path }}/updater/updater.phar --no-interaction"
- name: "Disable Maintenance-Mode" - name: "{{ nextcloud_path }}: Disable Maintenance-Mode"
include_tasks: "occ_command.yml" include_tasks: "occ_command.yml"
vars: vars:
occ_command: "maintenance:mode --off" occ_command: "maintenance:mode --off"
- name: "Run Updater Part 2" - name: "{{ nextcloud_path }}: Run Updater Part 2"
include_tasks: "occ_command.yml" include_tasks: "occ_command.yml"
vars: vars:
occ_command: "upgrade --no-interaction" occ_command: "upgrade --no-interaction"
- name: "Disable Maintenance-Mode" - name: "{{ nextcloud_path }}: Disable Maintenance-Mode"
include_tasks: "occ_command.yml" include_tasks: "occ_command.yml"
vars: vars:
occ_command: "maintenance:mode --off" occ_command: "maintenance:mode --off"