Procházet zdrojové kódy

improvements

master
rodič
revize
5a87544dd2
8 změnil soubory, kde provedl 75 přidání a 33 odebrání
  1. +2
    -2
      defaults/main.yml
  2. +1
    -0
      tasks/access.yml
  3. +28
    -23
      tasks/apps.yml
  4. +30
    -0
      tasks/check.yaml
  5. +6
    -6
      tasks/core.yml
  6. +4
    -2
      tasks/main.yml
  7. +1
    -0
      tasks/setup_Debian.yml
  8. +3
    -0
      vars/main.yml

+ 2
- 2
defaults/main.yml Zobrazit soubor

@@ -4,9 +4,9 @@ nextcloud_archive_directory: /opt/nextcloud

nextcloud_directory: /var/www/nextcloud

nextcloud_data_directory: "{{nextcloud_directory}}/data"
nextcloud_data_directory: /var/lib/nextcloud/data

nextcloud_version: 14.0.2
nextcloud_version: 14.0.3

nextcloud_apps:
- contacts


+ 1
- 0
tasks/access.yml Zobrazit soubor

@@ -20,6 +20,7 @@
- apps
- themes
- updater
- data

- name: nextcloud data directory
file:


+ 28
- 23
tasks/apps.yml Zobrazit soubor

@@ -1,32 +1,37 @@
---

- name: get nextcloud apps list
uri:
url: https://apps.nextcloud.com/api/v1/platform/{{ nextcloud_version }}/apps.json
register: _nextcloud_apps_list

- debug:
msg:
_nextcloud_apps: "{{ _nextcloud_apps }}"
- name: occ app list
command: php occ app:list
args:
chdir: /var/www/nextcloud
register: _nextcloud_occ_app_list
changed_when: false
become: true
become_user: www-data
become_method: sudo

- name: nextcloud apps download
get_url:
url: "{{ _nextcloud_apps[item].url }}"
dest: "{{nextcloud_archive_directory}}/nextcloud-{{item}}-{{ _nextcloud_apps[item].version }}.tar.gz"
with_items: "{{ nextcloud_apps }}"
- name: nextcloud install apps
command: php occ app:install {{item}}
with_items: "{{ nextcloud_apps | difference(_nextcloud_apps_present) }}"
args:
chdir: /var/www/nextcloud
become: true
become_user: www-data
become_method: sudo

- name: nextcloud apps extract
unarchive:
src: "{{nextcloud_archive_directory}}/nextcloud-{{item}}-{{ _nextcloud_apps[item].version }}.tar.gz"
dest: /var/www/nextcloud/apps/
remote_src: yes
owner: root
group: root
with_items: "{{ nextcloud_apps }}"
- name: occ app list
command: php occ app:list
args:
chdir: /var/www/nextcloud
register: _nextcloud_occ_app_list
changed_when: false
become: true
become_user: www-data
become_method: sudo

- name: nextcloud enable apps
command: php occ app:enable {{item.name}}
with_items: "{{ nextcloud_apps }}"
command: php occ app:enable {{item}}
with_items: "{{ nextcloud_apps | difference(_nextcloud_apps_enabled) }}"
args:
chdir: /var/www/nextcloud
become: true


+ 30
- 0
tasks/check.yaml Zobrazit soubor

@@ -0,0 +1,30 @@
---

- name: nextcloud core integrity check
command: php occ integrity:check-core
args:
chdir: /var/www/nextcloud
changed_when: false
become: true
become_user: www-data
become_method: sudo

- name: occ app list
command: php occ app:list
args:
chdir: /var/www/nextcloud
register: _nextcloud_occ_app_list
changed_when: false
become: true
become_user: www-data
become_method: sudo

- name: nextcloud apps integrity checks
command: php occ integrity:check-app {{item}}
with_items: "{{ _nextcloud_apps_present }}"
args:
chdir: /var/www/nextcloud
changed_when: false
become: true
become_user: www-data
become_method: sudo

tasks/server.yml → tasks/core.yml Zobrazit soubor

@@ -5,34 +5,34 @@
url: https://apps.nextcloud.com/api/v1/platforms.json
register: _nextcloud_platforms

- name: nextcloud archive checksum download
- name: nextcloud core archive checksum download
get_url:
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256
dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256"

- name: nextcloud server archive checksum
- name: nextcloud core archive checksum
shell: cat "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256"
register: _nextcloud_server_archive_checksum
changed_when: false

- name: nextcloud archive download
- name: nextcloud core archive download
get_url:
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2
dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2"
checksum: sha256:{{ _nextcloud_server_archive_checksum.stdout_lines[0].split(' ')[0] }}

- name: nextcloud archive signature download
- name: nextcloud core archive signature download
get_url:
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2.asc
dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.asc"

- name: nextcloud archive signature check
- name: nextcloud core archive signature check
command: gpg --no-default-keyring --keyring "{{nextcloud_archive_directory}}/keyring.gpg"
--verify "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.asc"
"{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2"
changed_when: false

- name: nextcloud extract
- name: nextcloud core extract
unarchive:
src: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2"
remote_src: yes

+ 4
- 2
tasks/main.yml Zobrazit soubor

@@ -9,7 +9,7 @@
- import_tasks: reset.yml
when: nextcloud_state == "reinstalled"

- import_tasks: server.yml
- import_tasks: core.yml
- import_tasks: access.yml

- import_tasks: mysql.yml
@@ -22,7 +22,9 @@

- import_tasks: configure.yml

#- import_tasks: apps.yml
- import_tasks: apps.yml

- import_tasks: check.yaml

- import_tasks: upgrade.yml



+ 1
- 0
tasks/setup_Debian.yml Zobrazit soubor

@@ -22,6 +22,7 @@
- php-apcu
- memcached
- php-memcached
- libreoffice
notify: restart apache2

- name: remove default page


+ 3
- 0
vars/main.yml Zobrazit soubor

@@ -1,3 +1,6 @@
_nextcloud_config: "{{ _nextcloud_config_cmd.stdout | from_json }}"
_nextcloud_latest: "{{ lookup('template','nextcloud-latest.json.j2') |from_json }}"
_nextcloud_apps: "{{ lookup('template','nextcloud-apps.json.j2') }}"
_nextcloud_apps_enabled: "{{ _nextcloud_occ_app_list.stdout | from_yaml | json_query('Enabled|[]|map(&keys(@), @)|[]') }}"
_nextcloud_apps_disabled: "{{ _nextcloud_occ_app_list.stdout | from_yaml | json_query('Disabled|[]') }}"
_nextcloud_apps_present: "{{ _nextcloud_apps_enabled | union(_nextcloud_apps_disabled) }}"

Načítá se…
Zrušit
Uložit