dienste:bytecluster0002:wordpress

Dies ist eine alte Version des Dokuments!


Proxmox container 'wordpress.test'

  • testing …
  • image: debian10 with users
  • 1. Netzwerkinterface
    • eth0
    • 10.2.0.30/24 DG: 10.2.0.254; fd00:10:2:0::30/64 DGfd00:10:2:0::0
    • bridge: vmbr0
  • 2. Netzwerkinterface:
    • eth1,
    • 10.3.0.30/24; fd00:10:3:0::30/64
    • 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: wordpress
  become: true

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

  - name: install packages
    apt:
      pkg:
        - php7.3
        - php7.3-xml
        - php7.3-mbstring
        - php7.3-zip
        - php7.3-mysql
        - php7.3-imagick
        - nginx

  - name: check if nextcloud is already installed
    stat:
      path: /var/www/wordpress
    register: wordpress_exists

  - name: Download wordpress and unpack
    unarchive:
      src: https://wordpress.org/latest.zip
      dest: /var/www
      owner: www-data
      group: www-data
      remote_src: yes
    when: not wordpress_exists.stat.exists

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


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

  - name: Create a symbolic link
    file:
      src: /etc/nginx/sites-available/wordpress.conf
      dest: /etc/nginx/sites-enabled/wordpress.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/wordpress.1601934964.txt.gz
  • Zuletzt geändert: 05.10.2020 23:56
  • von chaos