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-ctype
        - php7.3-curl
        #- php7.3-dom
        - php7.3-gd
        #- php7.3-iconv
        - php7.3-json
        - php7.3-xml
        - php7.3-mbstring
        #- php7.3-openssl
        #- php7.3-posix
        #- php7.3-session
        #- php7.3-simplexml
        #- php7.3-xmlreader
        #- php7.3-xmlwriter
        - php7.3-zip
        #- php7.3-zlib
        - php7.3-mysql
        #- php7.3-fileinfo
        - php7.3-bz2
        - php7.3-intl
        #- php7.3-exif
        - php7.3-redis
        - php7.3-imagick
        - ffmpeg

  - name: download and extract nextcloud archive
    unarchive:
      src: https://download.nextcloud.com/server/releases/nextcloud-20.0.0.zip
      dst: /var/www
      owner: www-data
      group: www-data
      remote_src: yes

  - name: Remove file packed file
    file:
      path: /var/www/nextcloud-20.0.0.zip
      state: absent

  - 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 Na:h=76m!Jx(
      --admin-user admin
      --admin-pass 2AZy={MEc6eb
      --data-dir /var/www/nextcloud/data
    args:
      chdir: /var/www/nextcloud/
      creates: /var/www/nextcloud/config/config.php

  - name: copy nginx config
    copy:
      src: ./conf/nextcloud.conf
      dest: /etc/nginx/sites-available/
      owner: root
      group: root
      mode: '0744'

  - 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

  - name: load php-fpm
    systemd:
      state: restarted
      name: php7.3-fpm

  - name: Restart nginx
    systemd:
      state: restarted
      daemon_reload: yes
      name: nginx

  • dienste/bytecluster0002/nextcloud.1601819745.txt.gz
  • Zuletzt geändert: 04.10.2020 15:55
  • von chaos