dienste:bytecluster0002:nextcloud

Dies ist eine alte Version des Dokuments!


Proxmox container 'nextcloud.test'

  • nginx momentan deaktiviert
  • /etc/nginx/sites-enabled leer
  • image: debian10 with users
  • 1. Netzwerkinterface
    • eth0
    • 10.2.0.20/24 DG: 10.2.0.254; fd00:10:2:0::20/64 DGfd00:10:2:0::0
    • bridge: vmbr0
  • 2. Netzwerkinterface:
    • eth1,
    • 10.3.0.20/24 DG: 10.3.0.254; fd00:10:3:0::20/64 DGfd00:10:3:0::0
    • bridge: vmbr1
  • verbindet man sich als unpriviligierter user und möchte ein Command als ein anderer, unpriviligierter user ausführen (z.B. www-data), benötigt man
    allow_world_readable_tmpfiles = yes
    in der ansible.cfg, damit dies nicht als Fehler zum Abbruch führt.

#!/usr/bin/env ansible-playbook

- name: 'install nextcloud'
  hosts: nextcloud
  become: true

  tasks:
  - name: remove apache2
    apt:
      name: apache2
      state: absent

  - 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
        - php7.3-fpm
        - ffmpeg
        - nginx

  - 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

  - 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 "db-pass" --admin-user admin --admin-pass "admin-pass" --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.1601926307.txt.gz
  • Zuletzt geändert: 05.10.2020 21:31
  • von chaos