ansible-role-nextcloud/tasks/nextcloud.yml

30 lines
973 B
YAML
Raw Normal View History

2020-12-03 15:52:14 +01:00
---
- name: "nextcloud: {{ instance.name }}: Verzeichnis prüfen"
2020-12-03 15:52:14 +01:00
file:
path: "{{ nextcloud_install_path }}"
mode: 0644
2020-12-03 15:52:14 +01:00
state: directory
- name: "nextcloud: {{ instance.name }}: herunterladen und entpacken"
2020-12-03 15:52:14 +01:00
unarchive:
src: "{{ nextcloud_dl_url }}"
2020-12-03 15:52:14 +01:00
remote_src: true
extra_opts:
- "--strip-components=1"
dest: "{{ nextcloud_install_path }}"
owner: "{{ instance.user }}"
group: "{{ instance.user }}"
mode: 0644
2020-12-03 15:52:14 +01:00
- name: "nextcloud: {{ instance.name }}: Installation"
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 }}"
2020-12-03 15:52:14 +01:00
become: true
become_user: "{{ instance.user }}"
2020-12-03 15:52:14 +01:00
changed_when: true