dienste:bytecluster0002:nextcloud

Dies ist eine alte Version des Dokuments!


Proxmox container 'nextcloud.test'

  • IP: 10.2.0.20
  • image: debian10 with users

#!/usr/bin/env ansible-playbook

- name: 'install nextcloud'

hosts: nextcloud
become: true
tasks:
- name: install packages
  apt:
    pkg:
      - php7.3
      - php7.3-curl
      - php7.3-gd
      - php7.3-json
      - php7.3-xml
      - php7.3-mbstring
      - php7.3-zip
      - php7.3-mysql
      - php7.3-bz2
      - php7.3-intl
      - php7.3-redis
      - php7.3-imagick
      - ffmpeg
  1. name: Download nextcloud and unpack

unarchive:

    src: https://download.nextcloud.com/server/releases/nextcloud-20.0.0.zip
    dest: /var/www
    owner: www-data
    group: www-data
    remote_src: yes
  1. name: Remove file packed file

file:

    path: /var/www/nextcloud-20.0.0.zip
    state: absent
  1. name: first setup nextcloud

become_user: www-data

  become: yes
  shell: >
    php occ  maintenance:install 
    --database mysql 
    --database-host 10.3.0.100 
    --database-name nextcloud 
    --database-table-prefix nc 
    --database-user nc_user 
    --database-pass <pass>
    --admin-user admin
    --admin-pass <pass>
    --data-dir /var/www/nextcloud/data
  args:
    chdir: /var/www/nextcloud/
    creates: /var/www/nextcloud/config/config.php
  1. name: copy nginx config

copy:

    src: ./conf/nextcloud.conf
    dest: /etc/nginx/sites-available/
    owner: root
    group: root
    mode: '0744'
  1. name: Create a symbolic link

file:

    src: /etc/nginx/sites-available/nextcloud.conf
    dest: /etc/nginx/sites-enabled/nextcloud.conf
    owner: root
    group: root
    state: link
  1. name: load php-fpm

systemd:

    state: restarted
    name: php7.3-fpm
  1. name: Restart nginx

systemd:

    state: restarted
    daemon_reload: yes
    name: nginx
  • dienste/bytecluster0002/nextcloud.1601819949.txt.gz
  • Zuletzt geändert: 04.10.2020 15:59
  • von chaos