---
- name: Pixelfed deps installed
  community.general.pkgng:
    name: "git php74-composer php74-intl php74-dom php74-tokenizer php74-xmlwriter php74-xml php74-zip php74-fileinfo php74-pcntl php74-posix php74-simplexml php74-pdo redis php74-iconv php74-curl php74-bcmath php74-pgsql php74-pdo_pgsql php74-session"
    state: latest

- name: Source folder exists
  file:
    path: /usr/local/src
    mode: 0755
    state: directory

- name: Pixelfed source fetched
  shell: git clone -b dev https://github.com/pixelfed/pixelfed.git /usr/local/src/pixelfed

- name: Pixelfed composer run
  shell: composer install
  chdir: /usr/local/src/pixelfed

- name: Pixelfed conf file installed
  template:
    src: pixelfed.php
    dest: /usr/local/src/pixelfed/config/pixelfed.php
    owner: www
    mode: 0666
  notify: Nginx restarted
